diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b573f4a..fa24657 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: 'zulu' - java-version: '17' + java-version: '21' - name: test uses: reactivecircus/android-emulator-runner@v2 with: diff --git a/.gitignore b/.gitignore index 90130cf..e1d7298 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ build/ plugin/src/test/test-fixtures/multi-module/gradle.properties plugin/src/test/test-fixtures/multi-module/build.gradle plugin/src/test/test-fixtures/multi-module/app/build.gradle +.kotlin/ diff --git a/gradle.properties b/gradle.properties index a913ff5..513a0de 100644 --- a/gradle.properties +++ b/gradle.properties @@ -26,4 +26,6 @@ POM_LICENCE_DIST=repo POM_DEVELOPER_ID=rolf-smit POM_DEVELOPER_NAME=Rolf Smit -POM_DEVELOPER_URL=https://github.com/rolf-smit \ No newline at end of file +POM_DEVELOPER_URL=https://github.com/rolf-smit + +org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7d5e09b..9f9c932 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,9 +1,9 @@ [versions] androidMinSdk = "21" -androidTargetSdk = "34" -androidCompileSdk = "34" -kotlin = "1.9.23" -androidGradlePlugin = "8.6.0" +androidTargetSdk = "35" +androidCompileSdk = "35" +kotlin = "2.1.10" +androidGradlePlugin = "8.8.0" [libraries] appCompat = { module = "androidx.appcompat:appcompat", version = "1.7.0" } @@ -17,12 +17,12 @@ truth = { module = "com.google.truth:truth", supportTestRunner = { module = "androidx.test:runner", version = "1.6.2" } espressoCore = { module = "androidx.test.espresso:espresso-core", version = "3.6.1" } androidJUnit = { module = "androidx.test.ext:junit", version = "1.2.1" } -commonsCsv = { module = "org.apache.commons:commons-csv", version = "1.11.0" } +commonsCsv = { module = "org.apache.commons:commons-csv", version = "1.13.0" } kotlinTest = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" } -robolectric = { module = "org.robolectric:robolectric", version = "4.13" } -mockk = { module = "io.mockk:mockk", version = "1.13.12" } -jacksonYaml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml", version = "2.17.2"} -jacksonKotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version = "2.17.2"} +robolectric = { module = "org.robolectric:robolectric", version = "4.14.1" } +mockk = { module = "io.mockk:mockk", version = "1.13.16" } +jacksonYaml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml", version = "2.18.2"} +jacksonKotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version = "2.18.2"} [bundles] androidInstrumentedTest = ["supportTestRunner", "espressoCore", "androidJUnit"] @@ -32,9 +32,9 @@ jvmTest = ["kotlinTest", "junit", "truth", "commonsCsv"] [plugins] kotlinJvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } -kotlinDokka = { id = "org.jetbrains.dokka", version = "1.9.20" } -pluginPortalPublish = { id = "com.gradle.plugin-publish", version = "1.2.2" } -mavenPublish = { id = "com.vanniktech.maven.publish", version = "0.29.0" } -versionCheck = { id = "com.github.ben-manes.versions", version = "0.51.0" } +kotlinDokka = { id = "org.jetbrains.dokka", version = "2.0.0" } +pluginPortalPublish = { id = "com.gradle.plugin-publish", version = "1.3.1" } +mavenPublish = { id = "com.vanniktech.maven.publish", version = "0.30.0" } +versionCheck = { id = "com.github.ben-manes.versions", version = "0.52.0" } androidApp = { id = "com.android.application", version.ref = "androidGradlePlugin"} androidLibrary = { id = "com.android.library", version.ref = "androidGradlePlugin"} \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7f93135..e644113 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b82aa23..df97d72 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 0adc8e1..1aa94a4 100755 --- a/gradlew +++ b/gradlew @@ -145,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -153,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -202,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/gradlew.bat b/gradlew.bat index 6689b85..7101f8e 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/plugin/build.gradle b/plugin/build.gradle index e424395..97db379 100644 --- a/plugin/build.gradle +++ b/plugin/build.gradle @@ -1,4 +1,5 @@ import com.vanniktech.maven.publish.SonatypeHost +import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { // Core Gradle plugins @@ -25,10 +26,16 @@ version = VERSION_NAME group = GROUP java { - sourceCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_21 targetCompatibility = JavaVersion.VERSION_17 } +kotlin { + compilerOptions { + jvmTarget = JvmTarget.JVM_17 + } +} + jacocoTestReport { reports { xml.required = true @@ -65,8 +72,8 @@ tasks.named('javadoc') { } tasks.register('javadocJar', Jar) { archiveClassifier.set('javadoc') - dependsOn tasks.dokkaHtml - from tasks.dokkaHtml + dependsOn tasks.dokkaGeneratePublicationHtml + from tasks.dokkaGeneratePublicationHtml } test { testLogging { diff --git a/plugin/src/main/kotlin/org/neotech/plugin/rootcoverage/RootCoveragePlugin.kt b/plugin/src/main/kotlin/org/neotech/plugin/rootcoverage/RootCoveragePlugin.kt index c775c7a..99ffbfd 100644 --- a/plugin/src/main/kotlin/org/neotech/plugin/rootcoverage/RootCoveragePlugin.kt +++ b/plugin/src/main/kotlin/org/neotech/plugin/rootcoverage/RootCoveragePlugin.kt @@ -26,7 +26,7 @@ import java.io.File class RootCoveragePlugin : Plugin { - private val minimumRequiredAgpVersion = AndroidPluginVersion(8, 3, 0).alpha(5) + private val minimumRequiredAgpVersion = AndroidPluginVersion(8, 8, 0) private lateinit var rootProjectExtension: RootCoveragePluginExtension diff --git a/plugin/src/test/kotlin/org/neotech/plugin/rootcoverage/IntegrationTest.kt b/plugin/src/test/kotlin/org/neotech/plugin/rootcoverage/IntegrationTest.kt index 5d1d941..c26dd2e 100644 --- a/plugin/src/test/kotlin/org/neotech/plugin/rootcoverage/IntegrationTest.kt +++ b/plugin/src/test/kotlin/org/neotech/plugin/rootcoverage/IntegrationTest.kt @@ -232,7 +232,7 @@ class IntegrationTest( val fixture = File("src/test/test-fixtures/multi-module") - val gradleVersions = arrayOf("8.7", "8.10") + val gradleVersions = arrayOf("8.10.2", "8.11.1", "8.12.1") val configurations = File(fixture, "configurations").listFiles() ?: error("Configurations folder not found in $fixture") return configurations.flatMap { configuration -> diff --git a/plugin/src/test/test-fixtures/multi-module/app/build.gradle.tmp b/plugin/src/test/test-fixtures/multi-module/app/build.gradle.tmp index f717a9b..c5c245d 100644 --- a/plugin/src/test/test-fixtures/multi-module/app/build.gradle.tmp +++ b/plugin/src/test/test-fixtures/multi-module/app/build.gradle.tmp @@ -40,8 +40,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } testOptions { @@ -55,7 +55,7 @@ android { } kotlinOptions { - jvmTarget = "17" + jvmTarget = "21" } } diff --git a/plugin/src/test/test-fixtures/multi-module/build.gradle.tmp b/plugin/src/test/test-fixtures/multi-module/build.gradle.tmp index 9d20dff..aa29b6e 100644 --- a/plugin/src/test/test-fixtures/multi-module/build.gradle.tmp +++ b/plugin/src/test/test-fixtures/multi-module/build.gradle.tmp @@ -17,7 +17,7 @@ task clean(type: Delete) { jacoco { // https://www.jacoco.org/jacoco/trunk/doc/changes.html - toolVersion = "0.8.7" + toolVersion = "0.8.12" } rootCoverage { diff --git a/plugin/src/test/test-fixtures/multi-module/library_android/build.gradle b/plugin/src/test/test-fixtures/multi-module/library_android/build.gradle index e757e3d..170186a 100644 --- a/plugin/src/test/test-fixtures/multi-module/library_android/build.gradle +++ b/plugin/src/test/test-fixtures/multi-module/library_android/build.gradle @@ -33,8 +33,8 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 } testOptions { @@ -50,7 +50,7 @@ android { } kotlinOptions { - jvmTarget = "17" + jvmTarget = "21" } } diff --git a/plugin/src/test/test-fixtures/multi-module/library_android_flavors/build.gradle b/plugin/src/test/test-fixtures/multi-module/library_android_flavors/build.gradle index 3c4eeeb..a3521a1 100644 --- a/plugin/src/test/test-fixtures/multi-module/library_android_flavors/build.gradle +++ b/plugin/src/test/test-fixtures/multi-module/library_android_flavors/build.gradle @@ -43,8 +43,8 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 } testOptions { @@ -60,7 +60,7 @@ android { } kotlinOptions { - jvmTarget = "17" + jvmTarget = "21" } } diff --git a/plugin/src/test/test-fixtures/multi-module/library_java/build.gradle b/plugin/src/test/test-fixtures/multi-module/library_java/build.gradle index 301120c..ab48789 100644 --- a/plugin/src/test/test-fixtures/multi-module/library_java/build.gradle +++ b/plugin/src/test/test-fixtures/multi-module/library_java/build.gradle @@ -6,5 +6,5 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) } -sourceCompatibility = JavaVersion.VERSION_17 -targetCompatibility = JavaVersion.VERSION_17 +sourceCompatibility = JavaVersion.VERSION_21 +targetCompatibility = JavaVersion.VERSION_21 diff --git a/plugin/src/test/test-fixtures/multi-module/library_nested/java/build.gradle b/plugin/src/test/test-fixtures/multi-module/library_nested/java/build.gradle index 301120c..ab48789 100644 --- a/plugin/src/test/test-fixtures/multi-module/library_nested/java/build.gradle +++ b/plugin/src/test/test-fixtures/multi-module/library_nested/java/build.gradle @@ -6,5 +6,5 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) } -sourceCompatibility = JavaVersion.VERSION_17 -targetCompatibility = JavaVersion.VERSION_17 +sourceCompatibility = JavaVersion.VERSION_21 +targetCompatibility = JavaVersion.VERSION_21