From 9cdd2d5d10d44f25c3c6c8b188a3688d62a37aae Mon Sep 17 00:00:00 2001 From: Gabriel Ittner Date: Mon, 1 Jan 2024 22:38:35 +0100 Subject: [PATCH] update tested versions (#697) --- gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew.bat | 20 ++++----- .../vanniktech/maven/publish/TestOptions.kt | 18 ++++++-- .../com/vanniktech/maven/publish/Platform.kt | 43 ++++++++++++++----- 4 files changed, 59 insertions(+), 24 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1af9e093..ae57b137 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.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-rc-1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew.bat b/gradlew.bat index 93e3f59f..25da30db 100755 --- 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/src/integrationTest/kotlin/com/vanniktech/maven/publish/TestOptions.kt b/plugin/src/integrationTest/kotlin/com/vanniktech/maven/publish/TestOptions.kt index 4a482e71..54b166b0 100644 --- a/plugin/src/integrationTest/kotlin/com/vanniktech/maven/publish/TestOptions.kt +++ b/plugin/src/integrationTest/kotlin/com/vanniktech/maven/publish/TestOptions.kt @@ -40,9 +40,16 @@ enum class AgpVersion( minJdkVersion = JavaVersion.VERSION_17, ), - // canary channel + // beta channel AGP_8_3( - value = "8.3.0-alpha17", + value = "8.3.0-beta01", + minGradleVersion = GradleVersion.GRADLE_8_1, + minJdkVersion = JavaVersion.VERSION_17, + ), + + // canary channel + AGP_8_4( + value = "8.4.0-alpha01", minGradleVersion = GradleVersion.GRADLE_8_1, minJdkVersion = JavaVersion.VERSION_17, ), @@ -63,7 +70,7 @@ enum class KotlinVersion( KT_1_9_21("1.9.21"), // beta - KT_2_0_0("2.0.0-Beta1"), + KT_2_0_0("2.0.0-Beta2"), ; companion object { @@ -87,6 +94,11 @@ enum class GradleVersion( GRADLE_8_5( value = "8.5", ), + + // rc + GRADLE_8_6( + value = "8.6-rc-1", + ), ; companion object { diff --git a/plugin/src/main/kotlin/com/vanniktech/maven/publish/Platform.kt b/plugin/src/main/kotlin/com/vanniktech/maven/publish/Platform.kt index a8668328..1a5eac82 100644 --- a/plugin/src/main/kotlin/com/vanniktech/maven/publish/Platform.kt +++ b/plugin/src/main/kotlin/com/vanniktech/maven/publish/Platform.kt @@ -4,6 +4,7 @@ import com.android.build.api.dsl.LibraryExtension import com.vanniktech.maven.publish.tasks.JavadocJar.Companion.javadocJarTask import org.gradle.api.Action import org.gradle.api.Project +import org.gradle.api.artifacts.Configuration import org.gradle.api.attributes.DocsType import org.gradle.api.internal.project.ProjectInternal import org.gradle.api.plugins.JavaPluginExtension @@ -191,7 +192,7 @@ data class AndroidSingleVariantLibrary @JvmOverloads constructor( * be added to the publication. * * If the [includedBuildTypeValues] and [includedFlavorDimensionsAndValues] parameters are not provided or - * empty all variants will be published. Otherwise only variants matching those filters will be included. + * empty all variants will be published. Otherwise, only variants matching those filters will be included. * * Equivalent Gradle set up (AGP 7.1.1): * android { @@ -551,15 +552,37 @@ private fun setupTestFixtures(project: Project, sourcesJar: Boolean) { val extension = project.extensions.getByType(JavaPluginExtension::class.java) val testFixturesSourceSet = extension.sourceSets.maybeCreate(testFixtureSourceSetName) - val sourceElements = JvmPluginsHelper.createDocumentationVariantWithArtifact( - testFixturesSourceSet.sourcesElementsConfigurationName, - testFixtureSourceSetName, - DocsType.SOURCES, - listOf(ProjectDerivedCapability(project, "testFixtures")), - testFixturesSourceSet.sourcesJarTaskName, - testFixturesSourceSet.allSource, - project as ProjectInternal, - ) + val sourceElements = if (GradleVersion.current() >= GradleVersion.version("8.6-rc-1")) { + JvmPluginsHelper.createDocumentationVariantWithArtifact( + testFixturesSourceSet.sourcesElementsConfigurationName, + testFixtureSourceSetName, + DocsType.SOURCES, + setOf(ProjectDerivedCapability(project, "testFixtures")), + testFixturesSourceSet.sourcesJarTaskName, + testFixturesSourceSet.allSource, + project as ProjectInternal, + ) + } else { + JvmPluginsHelper::class.java.getMethod( + "createDocumentationVariantWithArtifact", + String::class.java, + String::class.java, + String::class.java, + List::class.java, + String::class.java, + Object::class.java, + ProjectInternal::class.java, + ).invoke( + null, + testFixturesSourceSet.sourcesElementsConfigurationName, + testFixtureSourceSetName, + DocsType.SOURCES, + listOf(ProjectDerivedCapability(project, "testFixtures")), + testFixturesSourceSet.sourcesJarTaskName, + testFixturesSourceSet.allSource, + project as ProjectInternal, + ) as Configuration + } val component = JavaPluginHelper.getJavaComponent(project) as DefaultJvmSoftwareComponent component.addVariantsFromConfiguration(sourceElements, JavaConfigurationVariantMapping("compile", true))