Skip to content

Commit 331a5dd

Browse files
authored
chore: use publishing logic from build plugin (#1020)
1 parent 8103c82 commit 331a5dd

File tree

6 files changed

+13
-120
lines changed

6 files changed

+13
-120
lines changed

aws-runtime/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
5+
import aws.sdk.kotlin.gradle.dsl.configurePublishing
56
import aws.sdk.kotlin.gradle.kmp.*
67

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

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

3435
kotlin {
3536
explicitApi()

build.gradle.kts

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55
import aws.sdk.kotlin.gradle.dsl.configureLinting
6+
import aws.sdk.kotlin.gradle.dsl.configureNexus
67
import aws.sdk.kotlin.gradle.util.typedProp
78
import java.net.URL
8-
import java.time.Duration
99

1010
buildscript {
1111
dependencies {
@@ -14,7 +14,7 @@ buildscript {
1414
// only need to include it here, imports in subprojects will work automagically
1515
classpath("aws.sdk.kotlin:build-plugins") {
1616
version {
17-
require("0.2.0")
17+
require("0.2.2")
1818
}
1919
}
2020
}
@@ -23,7 +23,6 @@ buildscript {
2323
plugins {
2424
kotlin("jvm") version "1.8.22" apply false
2525
id("org.jetbrains.dokka")
26-
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
2726
}
2827

2928
// configures (KMP) subprojects with our own KMP conventions and some default dependencies
@@ -118,33 +117,10 @@ project.afterEvaluate {
118117
}
119118
}
120119

121-
if (
122-
project.hasProperty("sonatypeUsername") &&
123-
project.hasProperty("sonatypePassword") &&
124-
project.hasProperty("publishGroupName")
125-
) {
126-
apply(plugin = "io.github.gradle-nexus.publish-plugin")
127-
128-
val publishGroupName = project.property("publishGroupName") as String
129-
group = publishGroupName
130-
131-
nexusPublishing {
132-
repositories {
133-
create("awsNexus") {
134-
nexusUrl.set(uri("https://aws.oss.sonatype.org/service/local/"))
135-
snapshotRepositoryUrl.set(uri("https://aws.oss.sonatype.org/content/repositories/snapshots/"))
136-
username.set(project.property("sonatypeUsername") as String)
137-
password.set(project.property("sonatypePassword") as String)
138-
}
139-
}
140-
141-
transitionCheckOptions {
142-
maxRetries.set(180)
143-
delayBetween.set(Duration.ofSeconds(10))
144-
}
145-
}
146-
}
120+
// Publishing
121+
configureNexus()
147122

123+
// Code Style
148124
val lintPaths = listOf(
149125
"**/*.{kt,kts}",
150126
"!**/generated-src/**",

codegen/smithy-aws-kotlin-codegen/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
5+
import aws.sdk.kotlin.gradle.dsl.configurePublishing
56
plugins {
67
kotlin("jvm")
78
jacoco
@@ -118,4 +119,4 @@ publishing {
118119
}
119120
}
120121

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

gradle/publish.gradle

Lines changed: 0 additions & 87 deletions
This file was deleted.

services/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
5+
import aws.sdk.kotlin.gradle.dsl.configurePublishing
56
import aws.sdk.kotlin.gradle.kmp.*
67
import java.time.LocalDateTime
78

@@ -120,5 +121,5 @@ subprojects {
120121
}
121122
}
122123

123-
apply(from = rootProject.file("gradle/publish.gradle"))
124+
configurePublishing("aws-sdk-kotlin")
124125
}

tests/benchmarks/service-benchmarks/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
5+
import aws.sdk.kotlin.gradle.dsl.skipPublishing
56
buildscript {
67
repositories {
78
mavenCentral()
@@ -23,7 +24,7 @@ application {
2324
mainClass.set("aws.sdk.kotlin.benchmarks.service.BenchmarkHarnessKt")
2425
}
2526

26-
extra.set("skipPublish", true)
27+
skipPublishing()
2728

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

0 commit comments

Comments
 (0)