Skip to content

Commit

Permalink
chore: use publishing logic from build plugin (#1020)
Browse files Browse the repository at this point in the history
  • Loading branch information
aajtodd authored Aug 16, 2023
1 parent 8103c82 commit 331a5dd
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 120 deletions.
3 changes: 2 additions & 1 deletion aws-runtime/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import aws.sdk.kotlin.gradle.dsl.configurePublishing
import aws.sdk.kotlin.gradle.kmp.*

description = "AWS client runtime support for generated service clients"
Expand Down Expand Up @@ -29,7 +30,7 @@ subprojects {
plugin("org.jetbrains.dokka")
}

apply(from = rootProject.file("gradle/publish.gradle"))
configurePublishing("aws-sdk-kotlin")

kotlin {
explicitApi()
Expand Down
34 changes: 5 additions & 29 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* SPDX-License-Identifier: Apache-2.0
*/
import aws.sdk.kotlin.gradle.dsl.configureLinting
import aws.sdk.kotlin.gradle.dsl.configureNexus
import aws.sdk.kotlin.gradle.util.typedProp
import java.net.URL
import java.time.Duration

buildscript {
dependencies {
Expand All @@ -14,7 +14,7 @@ buildscript {
// only need to include it here, imports in subprojects will work automagically
classpath("aws.sdk.kotlin:build-plugins") {
version {
require("0.2.0")
require("0.2.2")
}
}
}
Expand All @@ -23,7 +23,6 @@ buildscript {
plugins {
kotlin("jvm") version "1.8.22" apply false
id("org.jetbrains.dokka")
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}

// configures (KMP) subprojects with our own KMP conventions and some default dependencies
Expand Down Expand Up @@ -118,33 +117,10 @@ project.afterEvaluate {
}
}

if (
project.hasProperty("sonatypeUsername") &&
project.hasProperty("sonatypePassword") &&
project.hasProperty("publishGroupName")
) {
apply(plugin = "io.github.gradle-nexus.publish-plugin")

val publishGroupName = project.property("publishGroupName") as String
group = publishGroupName

nexusPublishing {
repositories {
create("awsNexus") {
nexusUrl.set(uri("https://aws.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://aws.oss.sonatype.org/content/repositories/snapshots/"))
username.set(project.property("sonatypeUsername") as String)
password.set(project.property("sonatypePassword") as String)
}
}

transitionCheckOptions {
maxRetries.set(180)
delayBetween.set(Duration.ofSeconds(10))
}
}
}
// Publishing
configureNexus()

// Code Style
val lintPaths = listOf(
"**/*.{kt,kts}",
"!**/generated-src/**",
Expand Down
3 changes: 2 additions & 1 deletion codegen/smithy-aws-kotlin-codegen/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import aws.sdk.kotlin.gradle.dsl.configurePublishing
plugins {
kotlin("jvm")
jacoco
Expand Down Expand Up @@ -118,4 +119,4 @@ publishing {
}
}

apply(from = rootProject.file("gradle/publish.gradle"))
configurePublishing("aws-sdk-kotlin")
87 changes: 0 additions & 87 deletions gradle/publish.gradle

This file was deleted.

3 changes: 2 additions & 1 deletion services/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import aws.sdk.kotlin.gradle.dsl.configurePublishing
import aws.sdk.kotlin.gradle.kmp.*
import java.time.LocalDateTime

Expand Down Expand Up @@ -120,5 +121,5 @@ subprojects {
}
}

apply(from = rootProject.file("gradle/publish.gradle"))
configurePublishing("aws-sdk-kotlin")
}
3 changes: 2 additions & 1 deletion tests/benchmarks/service-benchmarks/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import aws.sdk.kotlin.gradle.dsl.skipPublishing
buildscript {
repositories {
mavenCentral()
Expand All @@ -23,7 +24,7 @@ application {
mainClass.set("aws.sdk.kotlin.benchmarks.service.BenchmarkHarnessKt")
}

extra.set("skipPublish", true)
skipPublishing()

val requiredServices = setOf(
// Top 7 services called by Kotlin SDK customers as of 7/25/2023, in descending order of call volume
Expand Down

0 comments on commit 331a5dd

Please sign in to comment.