-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump Gradle to 8.10.2, require Java 11
Also bump various plugins, especially error prone, which required some changes to the code.
- Loading branch information
Showing
25 changed files
with
194 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
GRADLE ?= ./gradlew | ||
|
||
.PHONY: all | ||
all: check codecov eclipse javadocAll | ||
|
||
.PHONY: codecov | ||
codecov: | ||
$(GRADLE) jxmpp-repl:testCodeCoverageReport | ||
echo "Code coverage report available at file://$(PWD)/jxmpp-repl/build/reports/jacoco/testCodeCoverageReport/html/index.html" | ||
|
||
.PHONY: check | ||
check: | ||
$(GRADLE) $@ | ||
|
||
.PHONY: eclipse | ||
eclipse: | ||
$(GRADLE) $@ | ||
|
||
.PHONY: javadocAll | ||
javadocAll: | ||
$(GRADLE) $@ | ||
echo "javadoc available at file://$(PWD)/build/javadoc/index.html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
build-logic/src/main/groovy/org.jxmpp.android-conventions.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
build-logic/src/main/groovy/org.jxmpp.common-conventions.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
ext { | ||
javaVersion = JavaVersion.VERSION_11 | ||
javaMajor = javaVersion.getMajorVersion() | ||
minAndroidSdk = 19 | ||
|
||
androidBootClasspath = getAndroidRuntimeJar(minAndroidSdk) | ||
|
||
// Export the function by turning it into a closure. | ||
// https://stackoverflow.com/a/23290820/194894 | ||
getAndroidRuntimeJar = this.&getAndroidRuntimeJar | ||
} | ||
|
||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
} | ||
|
||
def getAndroidRuntimeJar(androidApiLevel) { | ||
def androidHome = getAndroidHome() | ||
def androidJar = new File("$androidHome/platforms/android-${androidApiLevel}/android.jar") | ||
if (androidJar.isFile()) { | ||
return androidJar | ||
} else { | ||
throw new Exception("Can't find android.jar for API level ${androidApiLevel}. Please install corresponding SDK platform package") | ||
} | ||
} | ||
|
||
def getAndroidHome() { | ||
def androidHomeEnv = System.getenv("ANDROID_HOME") | ||
if (androidHomeEnv == null) { | ||
throw new Exception("ANDROID_HOME environment variable is not set") | ||
} | ||
def androidHome = new File(androidHomeEnv) | ||
if (!androidHome.isDirectory()) throw new Exception("Environment variable ANDROID_HOME is not pointing to a directory") | ||
return androidHome | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
build-logic/src/main/groovy/org.jxmpp.javadoc-conventions.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
plugins { | ||
// Javadoc linking requires repositories to bet configured. And | ||
// those are declared in common-conventions, hence we add it here. | ||
id 'org.jxmpp.common-conventions' | ||
} | ||
|
||
|
||
tasks.withType(Javadoc) { | ||
// The '-quiet' as second argument is actually a hack, | ||
// since the one parameter addStringOption doesn't seem to | ||
// work, we extra add '-quiet', which is added anyway by | ||
// gradle. | ||
// We disable 'missing' as we do most of javadoc checking via checkstyle. | ||
options.addStringOption('Xdoclint:all,-missing', '-quiet') | ||
// Abort on javadoc warnings. | ||
// See JDK-8200363 (https://bugs.openjdk.java.net/browse/JDK-8200363) | ||
// for information about the -Xwerror option. | ||
options.addStringOption('Xwerror', '-quiet') | ||
options.addStringOption('-release', javaMajor) | ||
} | ||
|
||
tasks.withType(Javadoc) { | ||
options.charSet = "UTF-8" | ||
} |
3 changes: 0 additions & 3 deletions
3
build-logic/src/main/groovy/org.jxmpp.root-conventions.gradle
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,56 @@ | ||
plugins { | ||
id 'org.jxmpp.root-conventions' | ||
// The scalastyle plugin of jxmpp-repl wants the root project to | ||
// have a ideaProject task, so let's add one. | ||
id 'idea' | ||
|
||
id 'org.jxmpp.javadoc-conventions' | ||
} | ||
|
||
ext { | ||
javadocAllDir = new File(buildDir, 'javadoc') | ||
javadocAllProjects = subprojects | ||
} | ||
|
||
evaluationDependsOnChildren() | ||
task javadocAll(type: Javadoc) { | ||
source javadocAllProjects.collect {project -> | ||
project.sourceSets.main.allJava.findAll { | ||
// Filter out symbolic links to avoid | ||
// "warning: a package-info.java file has already been seen for package" | ||
// javadoc warnings. | ||
!java.nio.file.Files.isSymbolicLink(it.toPath()) | ||
} | ||
} | ||
destinationDir = javadocAllDir | ||
// Might need a classpath | ||
classpath = files(subprojects.collect {project -> | ||
project.sourceSets.main.compileClasspath}) | ||
classpath += files(androidBootClasspath) | ||
options { | ||
linkSource = true | ||
use = true | ||
links = [ | ||
"https://docs.oracle.com/en/java/javase/${javaMajor}/docs/api/", | ||
] as String[] | ||
overview = "$projectDir/resources/javadoc-overview.html" | ||
} | ||
|
||
// Finally copy the javadoc doc-files from the subprojects, which | ||
// are potentially generated, to the javadocAll directory. Note | ||
// that we use a copy *method* and not a *task* because the inputs | ||
// of copy tasks is determined within the configuration phase. And | ||
// since some of the inputs are generated, they will not get | ||
// picked up if we used a copy method. See also | ||
// https://stackoverflow.com/a/40518516/194894 | ||
doLast { | ||
copy { | ||
javadocAllProjects.each { | ||
from ("${it.projectDir}/src/javadoc") { | ||
include '**/doc-files/*.*' | ||
} | ||
} | ||
|
||
into javadocAllDir | ||
} | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.