Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

temporarily switch back to single variant publishing #372

Merged
merged 2 commits into from Jul 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
53 changes: 50 additions & 3 deletions CHANGELOG.md
@@ -1,12 +1,59 @@
# Change Log

Version 0.21.0 *(UNRELEASED)*
---------------------------------

**Behavior changes**

The `com.vanniktech.maven.publish` stops adding Maven Central (Sonatype OSS) as a
publishing target and will not enable GPG signing by default. To continue publishing to maven central and signing artifacts either add this to your Groovy build files:
```gradle
mavenPublishing {
publishToMavenCentral() // use publishToMavenCentral("S01") for publishing through s01.oss.sonatype.org
enableReleaseSigning()
}
```
the following to your kts build files:
```kotlin
mavenPublishing {
publishToMavenCentral() // use publishToMavenCentral(SonatypeHost.S01) for publishing through s01.oss.sonatype.org
enableReleaseSigning()
}
```
or the following to your `gradle.properties`:
```properties
SONATYPE_HOST=DEFAULT
# SONATYPE_HOST=S01 for publishing through s01.oss.sonatype.org
RELEASE_SIGNING_ENABLED=true
```

The base plugin is unaffected by these changes because it already has this behavior.

**Android variant publishing**

Since version 0.19.0 the plugin was publishing a multi variant library by
default for Android projects. Due to [a bug in Android Studio](https://issuetracker.google.com/issues/197636221)
that will cause it to not find the sources for libraries published this way the
plugin will temporarily revert to publishing single variant libraries again.
Unless another variant is specified by setting the `ANDROID_VARIANT_TO_PUBLISH`
Gradle property the `release` variant will be published.

To continue publishing multi variant libraries you can use the
[base plugin](https://github.com/vanniktech/gradle-maven-publish-plugin#base-plugin).

**Removals**

The deprecated `mavenPublish` extension has been removed. Take a look at the
changelog for 0.20.0 for replacements.


Version 0.20.0 *(2022-06-02)*
---------------------------------

**Upcoming behavior change**

In the next release after this the `com.vanniktech.maven.publish` will stop adding Maven Central (Sonatype OSS) as a
publishing target and will not enable GPG signing by default. If you are curretly relying on this behavior the plugin
In the next release after this the `com.vanniktech.maven.publish` will stop adding Maven Central (Sonatype OSS) as a
publishing target and will not enable GPG signing by default. If you are currently relying on this behavior the plugin
will print a warning during configuration phase. To continue publishing to maven central and signing artifacts either
add this to your build files:
```gradle
Expand All @@ -28,7 +75,7 @@ The base plugin is unaffected by these changes because it already has this behav

The old `mavenPublish` extension has been deprecated.

If you were using it to set `sonatypeHost` to `S01` use
If you were using it to set `sonatypeHost` to `S01` use
```gradle
mavenPublishing {
publishToMavenCentral("S01")
Expand Down
Expand Up @@ -10,7 +10,7 @@
<groupId>com.example</groupId>
<artifactId>test-artifact</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
<packaging>aar</packaging>
<name>Gradle Maven Publish Plugin Test Artifact</name>
<description>Testing the Gradle Maven Publish Plugin</description>
<url>https://github.com/vanniktech/gradle-maven-publish-plugin/</url>
Expand Down
Expand Up @@ -10,7 +10,7 @@
<groupId>com.example</groupId>
<artifactId>test-artifact</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
<packaging>aar</packaging>
<name>Gradle Maven Publish Plugin Test Artifact</name>
<description>Testing the Gradle Maven Publish Plugin</description>
<url>https://github.com/vanniktech/gradle-maven-publish-plugin/</url>
Expand Down Expand Up @@ -40,7 +40,6 @@
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>1.6.10</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
</dependencies>
</project>
Expand Up @@ -102,8 +102,7 @@ class MavenPublishPluginIntegrationTest {
val result = executeGradleCommands(TEST_TASK, "--stacktrace")

assertExpectedTasksRanSuccessfully(result)
assertExpectedCommonArtifactsGenerated("aar", qualifier = "debug")
assertExpectedCommonArtifactsGenerated("aar", qualifier = "release")
assertExpectedCommonArtifactsGenerated("aar")
assertPomContentMatches()
}

Expand Down Expand Up @@ -134,8 +133,7 @@ class MavenPublishPluginIntegrationTest {
val result = executeGradleCommands(TEST_TASK, "--stacktrace")

assertExpectedTasksRanSuccessfully(result)
assertExpectedCommonArtifactsGenerated("aar", qualifier = "debug")
assertExpectedCommonArtifactsGenerated("aar", qualifier = "release")
assertExpectedCommonArtifactsGenerated("aar")
assertPomContentMatches()
}

Expand Down
Expand Up @@ -75,7 +75,8 @@ private fun Project.configurePlatform() {
// multiplatform projects that use Android
androidComponents.finalizeDsl {
if (!plugins.hasPlugin("org.jetbrains.kotlin.multiplatform")) {
baseExtension.configure(AndroidMultiVariantLibrary())
val variant = project.findOptionalProperty("ANDROID_VARIANT_TO_PUBLISH") ?: "release"
baseExtension.configure(AndroidSingleVariantLibrary(variant))
}
}
}
Expand Down Expand Up @@ -126,7 +127,7 @@ private fun Project.javaVersion(): JavaVersion {
val extension = project.extensions.findByType(JavaPluginExtension::class.java)
if (extension != null) {
val toolchain = extension.toolchain
val version = toolchain.languageVersion.forUseAtConfigurationTime().get().asInt()
val version = toolchain.languageVersion.get().asInt()
return JavaVersion.toVersion(version)
}
} catch (t: Throwable) {
Expand Down