Skip to content

Commit

Permalink
chore: use publishing logic from build plugin (#924)
Browse files Browse the repository at this point in the history
  • Loading branch information
aajtodd authored Aug 16, 2023
1 parent c99ad82 commit 0cec6b1
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 118 deletions.
30 changes: 6 additions & 24 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* 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

buildscript {
Expand All @@ -20,7 +21,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 @@ -29,7 +30,6 @@ buildscript {
plugins {
kotlin("jvm") apply false
id("org.jetbrains.dokka")
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.12.1"
}

Expand Down Expand Up @@ -99,29 +99,10 @@ tasks.dokkaHtmlMultiModule.configure {
removeChildTasks(excludeFromDocumentation)
}

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 {
packageGroup.set(publishGroupName)
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)
}
}
}
}
// Publishing
configureNexus()

// Code Style
val lintPaths = listOf(
"**/*.{kt,kts}",
"!**/generated-src/**",
Expand All @@ -130,6 +111,7 @@ val lintPaths = listOf(

configureLinting(lintPaths)

// Binary compatibility
apiValidation {
nonPublicMarkers.add("aws.smithy.kotlin.runtime.InternalApi")

Expand Down
3 changes: 2 additions & 1 deletion codegen/smithy-kotlin-codegen-testutils/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 @@ -86,4 +87,4 @@ publishing {
}
}

apply(from = rootProject.file("gradle/publish.gradle"))
configurePublishing("smithy-kotlin")
3 changes: 2 additions & 1 deletion codegen/smithy-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("smithy-kotlin")
82 changes: 0 additions & 82 deletions gradle/publish.gradle

This file was deleted.

5 changes: 3 additions & 2 deletions runtime/auth/aws-signing-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

import aws.sdk.kotlin.gradle.dsl.skipPublishing
description = "Common test suite for AWS signing"
extra["displayName"] = "Smithy :: Kotlin :: AWS Signing Test Suite"
extra["moduleName"] = "aws.smithy.kotlin.runtime.auth.awssigning.tests"
extra["skipPublish"] = true

skipPublishing()

val coroutinesVersion: String by project
val junitVersion: String by project
Expand Down
3 changes: 2 additions & 1 deletion 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.*
plugins {
id("org.jetbrains.dokka")
Expand All @@ -23,7 +24,7 @@ subprojects {
plugin("org.jetbrains.dokka")
}

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

kotlin {
explicitApi()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import aws.sdk.kotlin.gradle.dsl.skipPublishing
import java.io.Closeable
import java.net.URLClassLoader

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

extra["skipPublish"] = true
skipPublishing()

val coroutinesVersion: String by project
val ktorVersion: String by project
Expand Down
3 changes: 2 additions & 1 deletion tests/benchmarks/aws-signing-benchmarks/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import aws.sdk.kotlin.gradle.dsl.skipPublishing
plugins {
kotlin("multiplatform")
id("org.jetbrains.kotlinx.benchmark")
}

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

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

Expand Down
3 changes: 2 additions & 1 deletion tests/benchmarks/channel-benchmarks/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import aws.sdk.kotlin.gradle.dsl.skipPublishing
plugins {
kotlin("multiplatform")
id("org.jetbrains.kotlinx.benchmark")
}

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

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

Expand Down
3 changes: 2 additions & 1 deletion tests/benchmarks/http-benchmarks/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import aws.sdk.kotlin.gradle.dsl.skipPublishing
plugins {
kotlin("multiplatform")
id("org.jetbrains.kotlinx.benchmark")
}

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

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

Expand Down
3 changes: 3 additions & 0 deletions tests/benchmarks/serde-benchmarks-codegen/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import aws.sdk.kotlin.gradle.dsl.skipPublishing
plugins {
kotlin("jvm")
}

skipPublishing()

description = "Codegen support for serde-benchmarks project"

dependencies {
Expand Down
3 changes: 2 additions & 1 deletion tests/benchmarks/serde-benchmarks/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import aws.sdk.kotlin.gradle.dsl.skipPublishing
import software.amazon.smithy.gradle.tasks.SmithyBuild
plugins {
kotlin("multiplatform")
id("org.jetbrains.kotlinx.benchmark")
id("software.amazon.smithy")
}

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

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

Expand Down
3 changes: 2 additions & 1 deletion tests/codegen/paginator-tests/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
import software.amazon.smithy.gradle.tasks.SmithyBuild
import software.amazon.smithy.gradle.tasks.Validate as SmithyValidate

Expand All @@ -10,7 +11,7 @@ plugins {
id("software.amazon.smithy")
}

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

val optinAnnotations = listOf("kotlin.RequiresOptIn", "aws.smithy.kotlin.runtime.InternalApi")
kotlin.sourceSets.all {
Expand Down
3 changes: 2 additions & 1 deletion tests/codegen/waiter-tests/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
import software.amazon.smithy.gradle.tasks.SmithyBuild
import software.amazon.smithy.gradle.tasks.Validate as SmithyValidate

Expand All @@ -10,7 +11,7 @@ plugins {
id("software.amazon.smithy")
}

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

val optinAnnotations = listOf("kotlin.RequiresOptIn", "aws.smithy.kotlin.runtime.InternalApi")
kotlin.sourceSets.all {
Expand Down
3 changes: 3 additions & 0 deletions tests/compile/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import aws.sdk.kotlin.gradle.dsl.skipPublishing
plugins {
kotlin("jvm")
}

extra["displayName"] = "Smithy :: Kotlin :: Compile :: Test"
extra["moduleName"] = "software.amazon.smithy.kotlin.codegen"

skipPublishing()

val smithyVersion: String by project
val kotestVersion: String by project
val kotlinVersion: String by project
Expand Down

0 comments on commit 0cec6b1

Please sign in to comment.