Skip to content

Commit 0cec6b1

Browse files
authored
chore: use publishing logic from build plugin (#924)
1 parent c99ad82 commit 0cec6b1

File tree

15 files changed

+35
-118
lines changed

15 files changed

+35
-118
lines changed

build.gradle.kts

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
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

89
buildscript {
@@ -20,7 +21,7 @@ buildscript {
2021
// only need to include it here, imports in subprojects will work automagically
2122
classpath("aws.sdk.kotlin:build-plugins") {
2223
version {
23-
require("0.2.0")
24+
require("0.2.2")
2425
}
2526
}
2627
}
@@ -29,7 +30,6 @@ buildscript {
2930
plugins {
3031
kotlin("jvm") apply false
3132
id("org.jetbrains.dokka")
32-
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
3333
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.12.1"
3434
}
3535

@@ -99,29 +99,10 @@ tasks.dokkaHtmlMultiModule.configure {
9999
removeChildTasks(excludeFromDocumentation)
100100
}
101101

102-
if (
103-
project.hasProperty("sonatypeUsername") &&
104-
project.hasProperty("sonatypePassword") &&
105-
project.hasProperty("publishGroupName")
106-
) {
107-
apply(plugin = "io.github.gradle-nexus.publish-plugin")
108-
109-
val publishGroupName = project.property("publishGroupName") as String
110-
group = publishGroupName
111-
112-
nexusPublishing {
113-
packageGroup.set(publishGroupName)
114-
repositories {
115-
create("awsNexus") {
116-
nexusUrl.set(uri("https://aws.oss.sonatype.org/service/local/"))
117-
snapshotRepositoryUrl.set(uri("https://aws.oss.sonatype.org/content/repositories/snapshots/"))
118-
username.set(project.property("sonatypeUsername") as String)
119-
password.set(project.property("sonatypePassword") as String)
120-
}
121-
}
122-
}
123-
}
102+
// Publishing
103+
configureNexus()
124104

105+
// Code Style
125106
val lintPaths = listOf(
126107
"**/*.{kt,kts}",
127108
"!**/generated-src/**",
@@ -130,6 +111,7 @@ val lintPaths = listOf(
130111

131112
configureLinting(lintPaths)
132113

114+
// Binary compatibility
133115
apiValidation {
134116
nonPublicMarkers.add("aws.smithy.kotlin.runtime.InternalApi")
135117

codegen/smithy-kotlin-codegen-testutils/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
@@ -86,4 +87,4 @@ publishing {
8687
}
8788
}
8889

89-
apply(from = rootProject.file("gradle/publish.gradle"))
90+
configurePublishing("smithy-kotlin")

codegen/smithy-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("smithy-kotlin")

gradle/publish.gradle

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

runtime/auth/aws-signing-tests/build.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
5-
5+
import aws.sdk.kotlin.gradle.dsl.skipPublishing
66
description = "Common test suite for AWS signing"
77
extra["displayName"] = "Smithy :: Kotlin :: AWS Signing Test Suite"
88
extra["moduleName"] = "aws.smithy.kotlin.runtime.auth.awssigning.tests"
9-
extra["skipPublish"] = true
9+
10+
skipPublishing()
1011

1112
val coroutinesVersion: String by project
1213
val junitVersion: String by project

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
plugins {
78
id("org.jetbrains.dokka")
@@ -23,7 +24,7 @@ subprojects {
2324
plugin("org.jetbrains.dokka")
2425
}
2526

26-
apply(from = rootProject.file("gradle/publish.gradle"))
27+
configurePublishing("smithy-kotlin")
2728

2829
kotlin {
2930
explicitApi()

runtime/protocol/http-client-engines/test-suite/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
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
import java.io.Closeable
67
import java.net.URLClassLoader
78

89
description = "Common HTTP Client Engine Test Suite"
910
extra["moduleName"] = "aws.smithy.kotlin.http.test"
1011

11-
extra["skipPublish"] = true
12+
skipPublishing()
1213

1314
val coroutinesVersion: String by project
1415
val ktorVersion: String by project

tests/benchmarks/aws-signing-benchmarks/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
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
plugins {
67
kotlin("multiplatform")
78
id("org.jetbrains.kotlinx.benchmark")
89
}
910

10-
extra.set("skipPublish", true)
11+
skipPublishing()
1112

1213
val optinAnnotations = listOf("kotlin.RequiresOptIn", "aws.smithy.kotlin.runtime.InternalApi")
1314

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
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
plugins {
67
kotlin("multiplatform")
78
id("org.jetbrains.kotlinx.benchmark")
89
}
910

10-
extra.set("skipPublish", true)
11+
skipPublishing()
1112

1213
val optinAnnotations = listOf("kotlin.RequiresOptIn", "aws.smithy.kotlin.runtime.InternalApi")
1314

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
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
plugins {
67
kotlin("multiplatform")
78
id("org.jetbrains.kotlinx.benchmark")
89
}
910

10-
extra.set("skipPublish", true)
11+
skipPublishing()
1112

1213
val optinAnnotations = listOf("kotlin.RequiresOptIn", "aws.smithy.kotlin.runtime.InternalApi")
1314

0 commit comments

Comments
 (0)