Skip to content

Commit

Permalink
fix deprecation warnings (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielittner authored Feb 11, 2021
1 parent 1d4e8c9 commit 37e66fd
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/main/kotlin/com/vanniktech/maven/publish/legacy/Targets.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,26 @@ import org.gradle.api.Project
@Suppress("ComplexMethod")
internal fun Project.configureTargets(extension: MavenPublishPluginExtension) {
if (findOptionalProperty("RELEASE_REPOSITORY_URL") != null) {
logger.warn("Modifying the default repository by setting the RELEASE_REPOSITORY_URL property" +
logger.warn("Modifying the default repository by setting the RELEASE_REPOSITORY_URL property " +
"is deprecated. Use the default Gradle APIs to configure additional targets/repositories " +
"https://docs.gradle.org/current/userguide/publishing_maven.html#publishing_maven:repositories")
}
if (findOptionalProperty("SNAPSHOT_REPOSITORY_URL") != null) {
logger.warn("Modifying the default repository by setting the SNAPSHOT_REPOSITORY_URL env var" +
logger.warn("Modifying the default repository by setting the SNAPSHOT_REPOSITORY_URL env var " +
"is deprecated. Use the default Gradle APIs to configure additional targets/repositories " +
"https://docs.gradle.org/current/userguide/publishing_maven.html#publishing_maven:repositories")
}
if (System.getenv("RELEASE_REPOSITORY_URL") != null) {
logger.warn("Modifying the default repository by setting the RELEASE_REPOSITORY_URL property" +
logger.warn("Modifying the default repository by setting the RELEASE_REPOSITORY_URL property " +
"is deprecated. Use the default Gradle APIs to configure additional targets/repositories " +
"https://docs.gradle.org/current/userguide/publishing_maven.html#publishing_maven:repositories")
}
if (System.getenv("SNAPSHOT_REPOSITORY_URL") != null) {
logger.warn("Modifying the default repository by setting the SNAPSHOT_REPOSITORY_URL env var" +
logger.warn("Modifying the default repository by setting the SNAPSHOT_REPOSITORY_URL env var " +
"is deprecated. Use the default Gradle APIs to configure additional targets/repositories " +
"https://docs.gradle.org/current/userguide/publishing_maven.html#publishing_maven:repositories")
}

if (findOptionalProperty("SONATYPE_NEXUS_USERNAME") != null) {
logger.warn("The property SONATYPE_NEXUS_USERNAME is deprecated. Use mavenCentralRepositoryUsername instead.")
}
Expand All @@ -39,10 +40,10 @@ internal fun Project.configureTargets(extension: MavenPublishPluginExtension) {
"mavenCentralRepositoryUsername or the env var ORG_GRADLE_PROJECT_mavenCentralRepositoryUsername instead.")
}
if (findOptionalProperty("SONATYPE_NEXUS_PASSWORD") != null) {
logger.warn("The property SONATYPE_NEXUS_USERNAME is deprecated. Use mavenCentralRepositoryPassword instead.")
logger.warn("The property SONATYPE_NEXUS_PASSWORD is deprecated. Use mavenCentralRepositoryPassword instead.")
}
if (System.getenv("SONATYPE_NEXUS_PASSWORD") != null) {
logger.warn("The env var SONATYPE_NEXUS_USERNAME is deprecated. Use the Gradle property " +
logger.warn("The env var SONATYPE_NEXUS_PASSWORD is deprecated. Use the Gradle property " +
"mavenCentralRepositoryPassword or the env var ORG_GRADLE_PROJECT_mavenCentralRepositoryPassword instead.")
}

Expand All @@ -56,9 +57,9 @@ internal fun Project.configureTargets(extension: MavenPublishPluginExtension) {
logger.warn("Modifying the default ${it.name} target is deprecated. Use " +
"the default Gradle APIs to configure it as an additional target/repository " +
"https://docs.gradle.org/current/userguide/publishing_maven.html#publishing_maven:repositories")
} else {
} else if (it.name != DEFAULT_TARGET && it.name != LOCAL_TARGET) {
logger.warn("Adding additional targets through this API is deprecated. Use " +
"the default Gradle APIs to add additional targets/repositories" +
"the default Gradle APIs to add additional targets/repositories " +
"https://docs.gradle.org/current/userguide/publishing_maven.html#publishing_maven:repositories")
}

Expand Down

0 comments on commit 37e66fd

Please sign in to comment.