From 1d51ba2a810d4d12965e35c667a8d157888e008d Mon Sep 17 00:00:00 2001 From: Hunter Mellema Date: Wed, 10 Jan 2024 10:19:48 -0700 Subject: [PATCH 1/5] Stop root level repository from generating publishing artifacts --- build.gradle.kts | 26 +++++++------------ .../scans-for-cli-version/build.gradle.kts | 1 - 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index cdbe02d..8cb8e51 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -19,12 +19,10 @@ import com.adarshr.gradle.testlogger.TestLoggerExtension plugins { `java-library` - `maven-publish` - checkstyle jacoco id("com.github.spotbugs") version "5.0.14" - id("com.gradle.plugin-publish") version "1.2.0" id("com.adarshr.test-logger") version "3.2.0" + id("com.gradle.plugin-publish") version "1.2.1" apply false } // The root project doesn't produce a JAR. @@ -69,7 +67,6 @@ subprojects { } apply(plugin = "com.adarshr.test-logger") - configure { showExceptions = true showStackTraces = true @@ -87,12 +84,6 @@ subprojects { logLevel = LogLevel.LIFECYCLE } - // Reusable license copySpec - val licenseSpec = copySpec { - from("${project.rootDir}/LICENSE") - from("${project.rootDir}/NOTICE") - } - dependencies { implementation("software.amazon.smithy:smithy-model:[1.0, 2.0[") implementation("software.amazon.smithy:smithy-build:[1.0, 2.0[") @@ -105,6 +96,12 @@ subprojects { testImplementation(project(":integ-test-utils")) } + // Reusable license copySpec + val licenseSpec = copySpec { + from("${project.rootDir}/LICENSE") + from("${project.rootDir}/NOTICE") + } + if (subproject.name != "integ-test-utils") { // Set up tasks that build source and javadoc jars. tasks.register("sourcesJar") { @@ -156,8 +153,7 @@ subprojects { * Publish to Maven central. */ apply(plugin = "maven-publish") - - publishing { + configure { publications { create("pluginMaven") { pom { @@ -196,7 +192,8 @@ subprojects { * Common plugin settings * ==================================================== */ - gradlePlugin { + apply(plugin = "com.gradle.plugin-publish") + configure { website.set("https://smithy.io") vcsUrl.set("https://github.com/smithy-lang/smithy-gradle-plugin") } @@ -208,7 +205,6 @@ subprojects { * Apply CheckStyle to source files but not tests. */ apply(plugin = "checkstyle") - tasks["checkstyleTest"].enabled = false tasks["checkstyleIt"].enabled = false @@ -219,10 +215,8 @@ subprojects { * Create code coverage reports after running tests. */ apply(plugin = "jacoco") - // Always run the jacoco test report after testing. tasks["test"].finalizedBy(tasks["jacocoTestReport"]) - // Configure jacoco to generate an HTML report. tasks.jacocoTestReport { reports { diff --git a/examples/base-plugin/scans-for-cli-version/build.gradle.kts b/examples/base-plugin/scans-for-cli-version/build.gradle.kts index df9ed82..8e72981 100644 --- a/examples/base-plugin/scans-for-cli-version/build.gradle.kts +++ b/examples/base-plugin/scans-for-cli-version/build.gradle.kts @@ -2,7 +2,6 @@ // found by scanning buildScript dependencies. plugins { - id("java-library") id("software.amazon.smithy.gradle.smithy-base").version("0.9.0") } From 7940f4f4f7fb282eaef506a4cf5fa75e7036e9d6 Mon Sep 17 00:00:00 2001 From: Hunter Mellema Date: Wed, 10 Jan 2024 11:03:44 -0700 Subject: [PATCH 2/5] Undo changes to cli resolution example --- examples/base-plugin/scans-for-cli-version/build.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/base-plugin/scans-for-cli-version/build.gradle.kts b/examples/base-plugin/scans-for-cli-version/build.gradle.kts index 8e72981..df9ed82 100644 --- a/examples/base-plugin/scans-for-cli-version/build.gradle.kts +++ b/examples/base-plugin/scans-for-cli-version/build.gradle.kts @@ -2,6 +2,7 @@ // found by scanning buildScript dependencies. plugins { + id("java-library") id("software.amazon.smithy.gradle.smithy-base").version("0.9.0") } From 145dd942885b3ac6fd902ba9514e226a1834f79a Mon Sep 17 00:00:00 2001 From: Hunter Mellema Date: Wed, 10 Jan 2024 13:21:11 -0700 Subject: [PATCH 3/5] Update build to use jreleaser and remove unused tasks --- build.gradle.kts | 134 ++++++++++-------- settings.gradle.kts | 4 +- .../build.gradle.kts | 10 +- .../ConflictingOutputDirectoriesTest.java | 0 .../ForbidDependencyResolutionTest.java | 0 .../gradle/IncludesInSourceSetTest.java | 0 .../gradle/OutputDirectoryConfigTest.java | 0 .../smithy/gradle/OutputDirectoryTest.java | 0 .../OutputDirectoryWithProjectionTest.java | 0 .../smithy/gradle/ScansForCliVersionTest.java | 0 .../smithy/gradle/SmithyBuildTaskTest.java | 0 .../amazon/smithy/gradle/SyntaxErrorTest.java | 0 .../smithy/gradle/SmithyBasePlugin.java | 0 .../amazon/smithy/gradle/SmithyExtension.java | 0 .../smithy/gradle/SmithyGradleVersion.java | 0 .../gradle/SmithySourceDirectorySet.java | 0 .../amazon/smithy/gradle/SmithyUtils.java | 0 .../internal/CliDependencyResolver.java | 0 .../DefaultSmithySourceDirectorySet.java | 0 .../gradle/tasks/AbstractSmithyCliTask.java | 0 .../smithy/gradle/tasks/BaseSmithyTask.java | 0 .../smithy/gradle/tasks/SmithyBuildTask.java | 0 .../smithy/gradle/tasks/SmithyFormatTask.java | 0 .../software/amazon/smithy/gradle/empty | 0 .../amazon/smithy/gradle/version.properties | 0 .../smithy/gradle/SmithyExtensionTest.java | 0 .../gradle/SmithyGradleVersionTest.java | 0 .../gradle/tasks/SmithyBuildTaskTest.java | 0 .../gradle/tasks/SmithyFormatTaskTest.java | 0 .../build.gradle.kts | 10 +- .../amazon/smithy/gradle/AddsTagsTest.java | 0 .../smithy/gradle/BuildDependenciesTest.java | 0 .../amazon/smithy/gradle/CustomTraitTest.java | 0 .../amazon/smithy/gradle/DisableJarTest.java | 0 .../smithy/gradle/InvalidProjectionTest.java | 0 .../smithy/gradle/KotlinJvmProjectTest.java | 0 .../gradle/MissingRuntimeDependencyTest.java | 0 .../smithy/gradle/MultiProjectTest.java | 0 .../smithy/gradle/MultipleJarsTest.java | 0 .../smithy/gradle/MultipleSourcesTest.java | 0 .../amazon/smithy/gradle/NoModelsTest.java | 0 .../amazon/smithy/gradle/ProjectionTest.java | 0 .../smithy/gradle/ProjectsWithTagsTest.java | 0 .../smithy/gradle/ScalaProjectTest.java | 0 .../smithy/gradle/SourceProjectionTest.java | 0 .../amazon/smithy/gradle/SmithyJarPlugin.java | 0 .../actions/SmithyManifestUpdateAction.java | 0 .../gradle/tasks/SmithyJarStagingTask.java | 0 .../gradle/tasks/SmithyValidateTask.java | 0 .../tasks/SmithyJarStagingTaskTest.java | 0 .../gradle/tasks/SmithyValidateTaskTest.java | 0 51 files changed, 86 insertions(+), 72 deletions(-) rename {smithy-base-plugin => smithy-base}/build.gradle.kts (84%) rename {smithy-base-plugin => smithy-base}/src/it/java/software/amazon/smithy/gradle/ConflictingOutputDirectoriesTest.java (100%) rename {smithy-base-plugin => smithy-base}/src/it/java/software/amazon/smithy/gradle/ForbidDependencyResolutionTest.java (100%) rename {smithy-base-plugin => smithy-base}/src/it/java/software/amazon/smithy/gradle/IncludesInSourceSetTest.java (100%) rename {smithy-base-plugin => smithy-base}/src/it/java/software/amazon/smithy/gradle/OutputDirectoryConfigTest.java (100%) rename {smithy-base-plugin => smithy-base}/src/it/java/software/amazon/smithy/gradle/OutputDirectoryTest.java (100%) rename {smithy-base-plugin => smithy-base}/src/it/java/software/amazon/smithy/gradle/OutputDirectoryWithProjectionTest.java (100%) rename {smithy-base-plugin => smithy-base}/src/it/java/software/amazon/smithy/gradle/ScansForCliVersionTest.java (100%) rename {smithy-base-plugin => smithy-base}/src/it/java/software/amazon/smithy/gradle/SmithyBuildTaskTest.java (100%) rename {smithy-base-plugin => smithy-base}/src/it/java/software/amazon/smithy/gradle/SyntaxErrorTest.java (100%) rename {smithy-base-plugin => smithy-base}/src/main/java/software/amazon/smithy/gradle/SmithyBasePlugin.java (100%) rename {smithy-base-plugin => smithy-base}/src/main/java/software/amazon/smithy/gradle/SmithyExtension.java (100%) rename {smithy-base-plugin => smithy-base}/src/main/java/software/amazon/smithy/gradle/SmithyGradleVersion.java (100%) rename {smithy-base-plugin => smithy-base}/src/main/java/software/amazon/smithy/gradle/SmithySourceDirectorySet.java (100%) rename {smithy-base-plugin => smithy-base}/src/main/java/software/amazon/smithy/gradle/SmithyUtils.java (100%) rename {smithy-base-plugin => smithy-base}/src/main/java/software/amazon/smithy/gradle/internal/CliDependencyResolver.java (100%) rename {smithy-base-plugin => smithy-base}/src/main/java/software/amazon/smithy/gradle/internal/DefaultSmithySourceDirectorySet.java (100%) rename {smithy-base-plugin => smithy-base}/src/main/java/software/amazon/smithy/gradle/tasks/AbstractSmithyCliTask.java (100%) rename {smithy-base-plugin => smithy-base}/src/main/java/software/amazon/smithy/gradle/tasks/BaseSmithyTask.java (100%) rename {smithy-base-plugin => smithy-base}/src/main/java/software/amazon/smithy/gradle/tasks/SmithyBuildTask.java (100%) rename {smithy-base-plugin => smithy-base}/src/main/java/software/amazon/smithy/gradle/tasks/SmithyFormatTask.java (100%) rename {smithy-base-plugin => smithy-base}/src/main/resources/software/amazon/smithy/gradle/empty (100%) rename {smithy-base-plugin => smithy-base}/src/main/resources/software/amazon/smithy/gradle/version.properties (100%) rename {smithy-base-plugin => smithy-base}/src/test/java/software/amazon/smithy/gradle/SmithyExtensionTest.java (100%) rename {smithy-base-plugin => smithy-base}/src/test/java/software/amazon/smithy/gradle/SmithyGradleVersionTest.java (100%) rename {smithy-base-plugin => smithy-base}/src/test/java/software/amazon/smithy/gradle/tasks/SmithyBuildTaskTest.java (100%) rename {smithy-base-plugin => smithy-base}/src/test/java/software/amazon/smithy/gradle/tasks/SmithyFormatTaskTest.java (100%) rename {smithy-jar-plugin => smithy-jar}/build.gradle.kts (75%) rename {smithy-jar-plugin => smithy-jar}/src/it/java/software/amazon/smithy/gradle/AddsTagsTest.java (100%) rename {smithy-jar-plugin => smithy-jar}/src/it/java/software/amazon/smithy/gradle/BuildDependenciesTest.java (100%) rename {smithy-jar-plugin => smithy-jar}/src/it/java/software/amazon/smithy/gradle/CustomTraitTest.java (100%) rename {smithy-jar-plugin => smithy-jar}/src/it/java/software/amazon/smithy/gradle/DisableJarTest.java (100%) rename {smithy-jar-plugin => smithy-jar}/src/it/java/software/amazon/smithy/gradle/InvalidProjectionTest.java (100%) rename {smithy-jar-plugin => smithy-jar}/src/it/java/software/amazon/smithy/gradle/KotlinJvmProjectTest.java (100%) rename {smithy-jar-plugin => smithy-jar}/src/it/java/software/amazon/smithy/gradle/MissingRuntimeDependencyTest.java (100%) rename {smithy-jar-plugin => smithy-jar}/src/it/java/software/amazon/smithy/gradle/MultiProjectTest.java (100%) rename {smithy-jar-plugin => smithy-jar}/src/it/java/software/amazon/smithy/gradle/MultipleJarsTest.java (100%) rename {smithy-jar-plugin => smithy-jar}/src/it/java/software/amazon/smithy/gradle/MultipleSourcesTest.java (100%) rename {smithy-jar-plugin => smithy-jar}/src/it/java/software/amazon/smithy/gradle/NoModelsTest.java (100%) rename {smithy-jar-plugin => smithy-jar}/src/it/java/software/amazon/smithy/gradle/ProjectionTest.java (100%) rename {smithy-jar-plugin => smithy-jar}/src/it/java/software/amazon/smithy/gradle/ProjectsWithTagsTest.java (100%) rename {smithy-jar-plugin => smithy-jar}/src/it/java/software/amazon/smithy/gradle/ScalaProjectTest.java (100%) rename {smithy-jar-plugin => smithy-jar}/src/it/java/software/amazon/smithy/gradle/SourceProjectionTest.java (100%) rename {smithy-jar-plugin => smithy-jar}/src/main/java/software/amazon/smithy/gradle/SmithyJarPlugin.java (100%) rename {smithy-jar-plugin => smithy-jar}/src/main/java/software/amazon/smithy/gradle/actions/SmithyManifestUpdateAction.java (100%) rename {smithy-jar-plugin => smithy-jar}/src/main/java/software/amazon/smithy/gradle/tasks/SmithyJarStagingTask.java (100%) rename {smithy-jar-plugin => smithy-jar}/src/main/java/software/amazon/smithy/gradle/tasks/SmithyValidateTask.java (100%) rename {smithy-jar-plugin => smithy-jar}/src/test/java/software/amazon/smithy/gradle/tasks/SmithyJarStagingTaskTest.java (100%) rename {smithy-jar-plugin => smithy-jar}/src/test/java/software/amazon/smithy/gradle/tasks/SmithyValidateTaskTest.java (100%) diff --git a/build.gradle.kts b/build.gradle.kts index 8cb8e51..205e633 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -16,6 +16,7 @@ import com.github.spotbugs.snom.Effort import com.github.spotbugs.snom.SpotBugsTask import com.adarshr.gradle.testlogger.TestLoggerExtension +import org.jreleaser.model.Active plugins { `java-library` @@ -23,6 +24,7 @@ plugins { id("com.github.spotbugs") version "5.0.14" id("com.adarshr.test-logger") version "3.2.0" id("com.gradle.plugin-publish") version "1.2.1" apply false + id("org.jreleaser") version "1.9.0" } // The root project doesn't produce a JAR. @@ -30,11 +32,14 @@ tasks["jar"].enabled = false val pluginVersion = project.file("VERSION").readText().replace(System.lineSeparator(), "") allprojects { - group = "software.amazon.smithy" + group = "software.amazon.smithy.gradle" version = pluginVersion } println("Smithy Gradle version: '${pluginVersion}'") +// JReleaser publishes artifacts from a local staging repository, rather than maven local. +// https://jreleaser.org/guide/latest/examples/maven/staging-artifacts.html#_gradle +val stagingDirectory = "$buildDir/staging" subprojects { val subproject = this @@ -103,27 +108,15 @@ subprojects { } if (subproject.name != "integ-test-utils") { - // Set up tasks that build source and javadoc jars. - tasks.register("sourcesJar") { + // Configure all jars to include license info + tasks.withType() { metaInf.with(licenseSpec) - from(sourceSets.main.get().allJava) - archiveClassifier.set("sources") - } - - tasks.register("javadocJar") { - metaInf.with(licenseSpec) - from(tasks.javadoc) - archiveClassifier.set("javadoc") - } - - // Configure jars to include license related info - tasks.jar { - metaInf.with(licenseSpec) - manifest { - attributes["Automatic-Module-Name"] = "software.amazon.smithy.gradle" - } } + /* + * Configure integration tests + * ==================================================== + */ sourceSets { create("it") { compileClasspath += sourceSets["main"].output + configurations["testRuntimeClasspath"] @@ -146,48 +139,6 @@ subprojects { tasks["build"].finalizedBy(tasks["integTest"]) } - /* - * Maven - * ==================================================== - * - * Publish to Maven central. - */ - apply(plugin = "maven-publish") - configure { - publications { - create("pluginMaven") { - pom { - description.set(subproject.description) - url.set("https://github.com/smithy-lang/smithy-gradle-plugin") - licenses { - license { - name.set("Apache License 2.0") - url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") - distribution.set("repo") - } - } - developers { - developer { - id.set("smithy") - name.set("Smithy") - organization.set("Amazon Web Services") - organizationUrl.set("https://aws.amazon.com") - roles.add("developer") - } - } - scm { - url.set("https://github.com/smithy-lang/smithy-gradle-plugin.git") - } - } - } - } - - repositories { - mavenLocal() - mavenCentral() - } - } - /* * Common plugin settings * ==================================================== @@ -198,6 +149,21 @@ subprojects { vcsUrl.set("https://github.com/smithy-lang/smithy-gradle-plugin") } + /* + * Staging repository + * ==================================================== + * + * Configure publication to staging repo for jreleaser + */ + configure { + repositories { + maven { + name = "stagingRepository" + url = uri(stagingDirectory) + } + } + } + /* * CheckStyle * ==================================================== @@ -255,4 +221,50 @@ subprojects { } +/* + * Jreleaser (https://jreleaser.org) config. + */ +jreleaser { + dryrun = false + + // Used for creating a tagged release, uploading files and generating changelog. + // In the future we can set this up to push release tags to GitHub, but for now it's + // set up to do nothing. + // https://jreleaser.org/guide/latest/reference/release/index.html + release { + generic { + enabled = true + skipRelease = true + } + } + + // Used to announce a release to configured announcers. + // https://jreleaser.org/guide/latest/reference/announce/index.html + announce { + active = Active.NEVER + } + + // Signing configuration. + // https://jreleaser.org/guide/latest/reference/signing.html + signing { + active = Active.ALWAYS + armored = true + } + // Configuration for deploying to Maven Central. + // https://jreleaser.org/guide/latest/examples/maven/maven-central.html#_gradle + deploy { + maven { + nexus2 { + create("maven-central") { + active.set(Active.ALWAYS) + url.set("https://s01.oss.sonatype.org/service/local") + snapshotUrl.set("https://s01.oss.sonatype.org/content/repositories/snapshots/") + closeRepository.set(false) + releaseRepository.set(false) + stagingRepositories.add(stagingDirectory) + } + } + } + } +} diff --git a/settings.gradle.kts b/settings.gradle.kts index 7f9eb7f..35e344b 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,5 +1,5 @@ rootProject.name = "smithy-gradle" -include("smithy-base-plugin") -include("smithy-jar-plugin") +include("smithy-base") +include("smithy-jar") include("integ-test-utils") diff --git a/smithy-base-plugin/build.gradle.kts b/smithy-base/build.gradle.kts similarity index 84% rename from smithy-base-plugin/build.gradle.kts rename to smithy-base/build.gradle.kts index 7c94f81..3435efc 100644 --- a/smithy-base-plugin/build.gradle.kts +++ b/smithy-base/build.gradle.kts @@ -1,14 +1,16 @@ import org.apache.tools.ant.filters.ReplaceTokens -description = "This plugin sets up the basic capabilities necessary for building Smithy models." + - "Applying this plugin will create the basic source sets and configurations needed for smithy" + + + +description = "This plugin sets up the basic capabilities necessary for building Smithy models. " + + "Applying this plugin will create the basic source sets and configurations needed for Smithy " + "projects. It will also create a smithy build task that will build and validate all the " + - "smithy models in the project." + "Smithy models in the project." gradlePlugin { plugins { create("smithy-base-plugin") { - id = "software.amazon.smithy.gradle.smithy-base" + id = "${group}.smithy-base" displayName = "Smithy Gradle Base Plugin" description = project.description implementationClass = "software.amazon.smithy.gradle.SmithyBasePlugin" diff --git a/smithy-base-plugin/src/it/java/software/amazon/smithy/gradle/ConflictingOutputDirectoriesTest.java b/smithy-base/src/it/java/software/amazon/smithy/gradle/ConflictingOutputDirectoriesTest.java similarity index 100% rename from smithy-base-plugin/src/it/java/software/amazon/smithy/gradle/ConflictingOutputDirectoriesTest.java rename to smithy-base/src/it/java/software/amazon/smithy/gradle/ConflictingOutputDirectoriesTest.java diff --git a/smithy-base-plugin/src/it/java/software/amazon/smithy/gradle/ForbidDependencyResolutionTest.java b/smithy-base/src/it/java/software/amazon/smithy/gradle/ForbidDependencyResolutionTest.java similarity index 100% rename from smithy-base-plugin/src/it/java/software/amazon/smithy/gradle/ForbidDependencyResolutionTest.java rename to smithy-base/src/it/java/software/amazon/smithy/gradle/ForbidDependencyResolutionTest.java diff --git a/smithy-base-plugin/src/it/java/software/amazon/smithy/gradle/IncludesInSourceSetTest.java b/smithy-base/src/it/java/software/amazon/smithy/gradle/IncludesInSourceSetTest.java similarity index 100% rename from smithy-base-plugin/src/it/java/software/amazon/smithy/gradle/IncludesInSourceSetTest.java rename to smithy-base/src/it/java/software/amazon/smithy/gradle/IncludesInSourceSetTest.java diff --git a/smithy-base-plugin/src/it/java/software/amazon/smithy/gradle/OutputDirectoryConfigTest.java b/smithy-base/src/it/java/software/amazon/smithy/gradle/OutputDirectoryConfigTest.java similarity index 100% rename from smithy-base-plugin/src/it/java/software/amazon/smithy/gradle/OutputDirectoryConfigTest.java rename to smithy-base/src/it/java/software/amazon/smithy/gradle/OutputDirectoryConfigTest.java diff --git a/smithy-base-plugin/src/it/java/software/amazon/smithy/gradle/OutputDirectoryTest.java b/smithy-base/src/it/java/software/amazon/smithy/gradle/OutputDirectoryTest.java similarity index 100% rename from smithy-base-plugin/src/it/java/software/amazon/smithy/gradle/OutputDirectoryTest.java rename to smithy-base/src/it/java/software/amazon/smithy/gradle/OutputDirectoryTest.java diff --git a/smithy-base-plugin/src/it/java/software/amazon/smithy/gradle/OutputDirectoryWithProjectionTest.java b/smithy-base/src/it/java/software/amazon/smithy/gradle/OutputDirectoryWithProjectionTest.java similarity index 100% rename from smithy-base-plugin/src/it/java/software/amazon/smithy/gradle/OutputDirectoryWithProjectionTest.java rename to smithy-base/src/it/java/software/amazon/smithy/gradle/OutputDirectoryWithProjectionTest.java diff --git a/smithy-base-plugin/src/it/java/software/amazon/smithy/gradle/ScansForCliVersionTest.java b/smithy-base/src/it/java/software/amazon/smithy/gradle/ScansForCliVersionTest.java similarity index 100% rename from smithy-base-plugin/src/it/java/software/amazon/smithy/gradle/ScansForCliVersionTest.java rename to smithy-base/src/it/java/software/amazon/smithy/gradle/ScansForCliVersionTest.java diff --git a/smithy-base-plugin/src/it/java/software/amazon/smithy/gradle/SmithyBuildTaskTest.java b/smithy-base/src/it/java/software/amazon/smithy/gradle/SmithyBuildTaskTest.java similarity index 100% rename from smithy-base-plugin/src/it/java/software/amazon/smithy/gradle/SmithyBuildTaskTest.java rename to smithy-base/src/it/java/software/amazon/smithy/gradle/SmithyBuildTaskTest.java diff --git a/smithy-base-plugin/src/it/java/software/amazon/smithy/gradle/SyntaxErrorTest.java b/smithy-base/src/it/java/software/amazon/smithy/gradle/SyntaxErrorTest.java similarity index 100% rename from smithy-base-plugin/src/it/java/software/amazon/smithy/gradle/SyntaxErrorTest.java rename to smithy-base/src/it/java/software/amazon/smithy/gradle/SyntaxErrorTest.java diff --git a/smithy-base-plugin/src/main/java/software/amazon/smithy/gradle/SmithyBasePlugin.java b/smithy-base/src/main/java/software/amazon/smithy/gradle/SmithyBasePlugin.java similarity index 100% rename from smithy-base-plugin/src/main/java/software/amazon/smithy/gradle/SmithyBasePlugin.java rename to smithy-base/src/main/java/software/amazon/smithy/gradle/SmithyBasePlugin.java diff --git a/smithy-base-plugin/src/main/java/software/amazon/smithy/gradle/SmithyExtension.java b/smithy-base/src/main/java/software/amazon/smithy/gradle/SmithyExtension.java similarity index 100% rename from smithy-base-plugin/src/main/java/software/amazon/smithy/gradle/SmithyExtension.java rename to smithy-base/src/main/java/software/amazon/smithy/gradle/SmithyExtension.java diff --git a/smithy-base-plugin/src/main/java/software/amazon/smithy/gradle/SmithyGradleVersion.java b/smithy-base/src/main/java/software/amazon/smithy/gradle/SmithyGradleVersion.java similarity index 100% rename from smithy-base-plugin/src/main/java/software/amazon/smithy/gradle/SmithyGradleVersion.java rename to smithy-base/src/main/java/software/amazon/smithy/gradle/SmithyGradleVersion.java diff --git a/smithy-base-plugin/src/main/java/software/amazon/smithy/gradle/SmithySourceDirectorySet.java b/smithy-base/src/main/java/software/amazon/smithy/gradle/SmithySourceDirectorySet.java similarity index 100% rename from smithy-base-plugin/src/main/java/software/amazon/smithy/gradle/SmithySourceDirectorySet.java rename to smithy-base/src/main/java/software/amazon/smithy/gradle/SmithySourceDirectorySet.java diff --git a/smithy-base-plugin/src/main/java/software/amazon/smithy/gradle/SmithyUtils.java b/smithy-base/src/main/java/software/amazon/smithy/gradle/SmithyUtils.java similarity index 100% rename from smithy-base-plugin/src/main/java/software/amazon/smithy/gradle/SmithyUtils.java rename to smithy-base/src/main/java/software/amazon/smithy/gradle/SmithyUtils.java diff --git a/smithy-base-plugin/src/main/java/software/amazon/smithy/gradle/internal/CliDependencyResolver.java b/smithy-base/src/main/java/software/amazon/smithy/gradle/internal/CliDependencyResolver.java similarity index 100% rename from smithy-base-plugin/src/main/java/software/amazon/smithy/gradle/internal/CliDependencyResolver.java rename to smithy-base/src/main/java/software/amazon/smithy/gradle/internal/CliDependencyResolver.java diff --git a/smithy-base-plugin/src/main/java/software/amazon/smithy/gradle/internal/DefaultSmithySourceDirectorySet.java b/smithy-base/src/main/java/software/amazon/smithy/gradle/internal/DefaultSmithySourceDirectorySet.java similarity index 100% rename from smithy-base-plugin/src/main/java/software/amazon/smithy/gradle/internal/DefaultSmithySourceDirectorySet.java rename to smithy-base/src/main/java/software/amazon/smithy/gradle/internal/DefaultSmithySourceDirectorySet.java diff --git a/smithy-base-plugin/src/main/java/software/amazon/smithy/gradle/tasks/AbstractSmithyCliTask.java b/smithy-base/src/main/java/software/amazon/smithy/gradle/tasks/AbstractSmithyCliTask.java similarity index 100% rename from smithy-base-plugin/src/main/java/software/amazon/smithy/gradle/tasks/AbstractSmithyCliTask.java rename to smithy-base/src/main/java/software/amazon/smithy/gradle/tasks/AbstractSmithyCliTask.java diff --git a/smithy-base-plugin/src/main/java/software/amazon/smithy/gradle/tasks/BaseSmithyTask.java b/smithy-base/src/main/java/software/amazon/smithy/gradle/tasks/BaseSmithyTask.java similarity index 100% rename from smithy-base-plugin/src/main/java/software/amazon/smithy/gradle/tasks/BaseSmithyTask.java rename to smithy-base/src/main/java/software/amazon/smithy/gradle/tasks/BaseSmithyTask.java diff --git a/smithy-base-plugin/src/main/java/software/amazon/smithy/gradle/tasks/SmithyBuildTask.java b/smithy-base/src/main/java/software/amazon/smithy/gradle/tasks/SmithyBuildTask.java similarity index 100% rename from smithy-base-plugin/src/main/java/software/amazon/smithy/gradle/tasks/SmithyBuildTask.java rename to smithy-base/src/main/java/software/amazon/smithy/gradle/tasks/SmithyBuildTask.java diff --git a/smithy-base-plugin/src/main/java/software/amazon/smithy/gradle/tasks/SmithyFormatTask.java b/smithy-base/src/main/java/software/amazon/smithy/gradle/tasks/SmithyFormatTask.java similarity index 100% rename from smithy-base-plugin/src/main/java/software/amazon/smithy/gradle/tasks/SmithyFormatTask.java rename to smithy-base/src/main/java/software/amazon/smithy/gradle/tasks/SmithyFormatTask.java diff --git a/smithy-base-plugin/src/main/resources/software/amazon/smithy/gradle/empty b/smithy-base/src/main/resources/software/amazon/smithy/gradle/empty similarity index 100% rename from smithy-base-plugin/src/main/resources/software/amazon/smithy/gradle/empty rename to smithy-base/src/main/resources/software/amazon/smithy/gradle/empty diff --git a/smithy-base-plugin/src/main/resources/software/amazon/smithy/gradle/version.properties b/smithy-base/src/main/resources/software/amazon/smithy/gradle/version.properties similarity index 100% rename from smithy-base-plugin/src/main/resources/software/amazon/smithy/gradle/version.properties rename to smithy-base/src/main/resources/software/amazon/smithy/gradle/version.properties diff --git a/smithy-base-plugin/src/test/java/software/amazon/smithy/gradle/SmithyExtensionTest.java b/smithy-base/src/test/java/software/amazon/smithy/gradle/SmithyExtensionTest.java similarity index 100% rename from smithy-base-plugin/src/test/java/software/amazon/smithy/gradle/SmithyExtensionTest.java rename to smithy-base/src/test/java/software/amazon/smithy/gradle/SmithyExtensionTest.java diff --git a/smithy-base-plugin/src/test/java/software/amazon/smithy/gradle/SmithyGradleVersionTest.java b/smithy-base/src/test/java/software/amazon/smithy/gradle/SmithyGradleVersionTest.java similarity index 100% rename from smithy-base-plugin/src/test/java/software/amazon/smithy/gradle/SmithyGradleVersionTest.java rename to smithy-base/src/test/java/software/amazon/smithy/gradle/SmithyGradleVersionTest.java diff --git a/smithy-base-plugin/src/test/java/software/amazon/smithy/gradle/tasks/SmithyBuildTaskTest.java b/smithy-base/src/test/java/software/amazon/smithy/gradle/tasks/SmithyBuildTaskTest.java similarity index 100% rename from smithy-base-plugin/src/test/java/software/amazon/smithy/gradle/tasks/SmithyBuildTaskTest.java rename to smithy-base/src/test/java/software/amazon/smithy/gradle/tasks/SmithyBuildTaskTest.java diff --git a/smithy-base-plugin/src/test/java/software/amazon/smithy/gradle/tasks/SmithyFormatTaskTest.java b/smithy-base/src/test/java/software/amazon/smithy/gradle/tasks/SmithyFormatTaskTest.java similarity index 100% rename from smithy-base-plugin/src/test/java/software/amazon/smithy/gradle/tasks/SmithyFormatTaskTest.java rename to smithy-base/src/test/java/software/amazon/smithy/gradle/tasks/SmithyFormatTaskTest.java diff --git a/smithy-jar-plugin/build.gradle.kts b/smithy-jar/build.gradle.kts similarity index 75% rename from smithy-jar-plugin/build.gradle.kts rename to smithy-jar/build.gradle.kts index 94d9cea..81787dc 100644 --- a/smithy-jar-plugin/build.gradle.kts +++ b/smithy-jar/build.gradle.kts @@ -1,12 +1,12 @@ -description = "Adds built Smithy files to an existing jar task such as that created" + - "by the Java or Kotlin plugins. The smithy-jar plugin also adds build metadata" + - "and tags to the JAR's MANIFEST. The smithy-jar plugin applies the smithy-base" + +description = "Adds built Smithy files to an existing jar task such as that created " + + "by the Java or Kotlin plugins. The smithy-jar plugin also adds build metadata " + + "and tags to the JAR's MANIFEST. The smithy-jar plugin applies the smithy-base " + "plugin when it is applied." gradlePlugin { plugins { create("smithy-jar-plugin") { - id = "software.amazon.smithy.gradle.smithy-jar" + id = "${group}.smithy-jar" displayName = "Smithy Gradle Jar Packaging Plugin" description = project.description implementationClass = "software.amazon.smithy.gradle.SmithyJarPlugin" @@ -16,5 +16,5 @@ gradlePlugin { } dependencies { - implementation(project(":smithy-base-plugin")) + implementation(project(":smithy-base")) } \ No newline at end of file diff --git a/smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/AddsTagsTest.java b/smithy-jar/src/it/java/software/amazon/smithy/gradle/AddsTagsTest.java similarity index 100% rename from smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/AddsTagsTest.java rename to smithy-jar/src/it/java/software/amazon/smithy/gradle/AddsTagsTest.java diff --git a/smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/BuildDependenciesTest.java b/smithy-jar/src/it/java/software/amazon/smithy/gradle/BuildDependenciesTest.java similarity index 100% rename from smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/BuildDependenciesTest.java rename to smithy-jar/src/it/java/software/amazon/smithy/gradle/BuildDependenciesTest.java diff --git a/smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/CustomTraitTest.java b/smithy-jar/src/it/java/software/amazon/smithy/gradle/CustomTraitTest.java similarity index 100% rename from smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/CustomTraitTest.java rename to smithy-jar/src/it/java/software/amazon/smithy/gradle/CustomTraitTest.java diff --git a/smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/DisableJarTest.java b/smithy-jar/src/it/java/software/amazon/smithy/gradle/DisableJarTest.java similarity index 100% rename from smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/DisableJarTest.java rename to smithy-jar/src/it/java/software/amazon/smithy/gradle/DisableJarTest.java diff --git a/smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/InvalidProjectionTest.java b/smithy-jar/src/it/java/software/amazon/smithy/gradle/InvalidProjectionTest.java similarity index 100% rename from smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/InvalidProjectionTest.java rename to smithy-jar/src/it/java/software/amazon/smithy/gradle/InvalidProjectionTest.java diff --git a/smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/KotlinJvmProjectTest.java b/smithy-jar/src/it/java/software/amazon/smithy/gradle/KotlinJvmProjectTest.java similarity index 100% rename from smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/KotlinJvmProjectTest.java rename to smithy-jar/src/it/java/software/amazon/smithy/gradle/KotlinJvmProjectTest.java diff --git a/smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/MissingRuntimeDependencyTest.java b/smithy-jar/src/it/java/software/amazon/smithy/gradle/MissingRuntimeDependencyTest.java similarity index 100% rename from smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/MissingRuntimeDependencyTest.java rename to smithy-jar/src/it/java/software/amazon/smithy/gradle/MissingRuntimeDependencyTest.java diff --git a/smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/MultiProjectTest.java b/smithy-jar/src/it/java/software/amazon/smithy/gradle/MultiProjectTest.java similarity index 100% rename from smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/MultiProjectTest.java rename to smithy-jar/src/it/java/software/amazon/smithy/gradle/MultiProjectTest.java diff --git a/smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/MultipleJarsTest.java b/smithy-jar/src/it/java/software/amazon/smithy/gradle/MultipleJarsTest.java similarity index 100% rename from smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/MultipleJarsTest.java rename to smithy-jar/src/it/java/software/amazon/smithy/gradle/MultipleJarsTest.java diff --git a/smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/MultipleSourcesTest.java b/smithy-jar/src/it/java/software/amazon/smithy/gradle/MultipleSourcesTest.java similarity index 100% rename from smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/MultipleSourcesTest.java rename to smithy-jar/src/it/java/software/amazon/smithy/gradle/MultipleSourcesTest.java diff --git a/smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/NoModelsTest.java b/smithy-jar/src/it/java/software/amazon/smithy/gradle/NoModelsTest.java similarity index 100% rename from smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/NoModelsTest.java rename to smithy-jar/src/it/java/software/amazon/smithy/gradle/NoModelsTest.java diff --git a/smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/ProjectionTest.java b/smithy-jar/src/it/java/software/amazon/smithy/gradle/ProjectionTest.java similarity index 100% rename from smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/ProjectionTest.java rename to smithy-jar/src/it/java/software/amazon/smithy/gradle/ProjectionTest.java diff --git a/smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/ProjectsWithTagsTest.java b/smithy-jar/src/it/java/software/amazon/smithy/gradle/ProjectsWithTagsTest.java similarity index 100% rename from smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/ProjectsWithTagsTest.java rename to smithy-jar/src/it/java/software/amazon/smithy/gradle/ProjectsWithTagsTest.java diff --git a/smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/ScalaProjectTest.java b/smithy-jar/src/it/java/software/amazon/smithy/gradle/ScalaProjectTest.java similarity index 100% rename from smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/ScalaProjectTest.java rename to smithy-jar/src/it/java/software/amazon/smithy/gradle/ScalaProjectTest.java diff --git a/smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/SourceProjectionTest.java b/smithy-jar/src/it/java/software/amazon/smithy/gradle/SourceProjectionTest.java similarity index 100% rename from smithy-jar-plugin/src/it/java/software/amazon/smithy/gradle/SourceProjectionTest.java rename to smithy-jar/src/it/java/software/amazon/smithy/gradle/SourceProjectionTest.java diff --git a/smithy-jar-plugin/src/main/java/software/amazon/smithy/gradle/SmithyJarPlugin.java b/smithy-jar/src/main/java/software/amazon/smithy/gradle/SmithyJarPlugin.java similarity index 100% rename from smithy-jar-plugin/src/main/java/software/amazon/smithy/gradle/SmithyJarPlugin.java rename to smithy-jar/src/main/java/software/amazon/smithy/gradle/SmithyJarPlugin.java diff --git a/smithy-jar-plugin/src/main/java/software/amazon/smithy/gradle/actions/SmithyManifestUpdateAction.java b/smithy-jar/src/main/java/software/amazon/smithy/gradle/actions/SmithyManifestUpdateAction.java similarity index 100% rename from smithy-jar-plugin/src/main/java/software/amazon/smithy/gradle/actions/SmithyManifestUpdateAction.java rename to smithy-jar/src/main/java/software/amazon/smithy/gradle/actions/SmithyManifestUpdateAction.java diff --git a/smithy-jar-plugin/src/main/java/software/amazon/smithy/gradle/tasks/SmithyJarStagingTask.java b/smithy-jar/src/main/java/software/amazon/smithy/gradle/tasks/SmithyJarStagingTask.java similarity index 100% rename from smithy-jar-plugin/src/main/java/software/amazon/smithy/gradle/tasks/SmithyJarStagingTask.java rename to smithy-jar/src/main/java/software/amazon/smithy/gradle/tasks/SmithyJarStagingTask.java diff --git a/smithy-jar-plugin/src/main/java/software/amazon/smithy/gradle/tasks/SmithyValidateTask.java b/smithy-jar/src/main/java/software/amazon/smithy/gradle/tasks/SmithyValidateTask.java similarity index 100% rename from smithy-jar-plugin/src/main/java/software/amazon/smithy/gradle/tasks/SmithyValidateTask.java rename to smithy-jar/src/main/java/software/amazon/smithy/gradle/tasks/SmithyValidateTask.java diff --git a/smithy-jar-plugin/src/test/java/software/amazon/smithy/gradle/tasks/SmithyJarStagingTaskTest.java b/smithy-jar/src/test/java/software/amazon/smithy/gradle/tasks/SmithyJarStagingTaskTest.java similarity index 100% rename from smithy-jar-plugin/src/test/java/software/amazon/smithy/gradle/tasks/SmithyJarStagingTaskTest.java rename to smithy-jar/src/test/java/software/amazon/smithy/gradle/tasks/SmithyJarStagingTaskTest.java diff --git a/smithy-jar-plugin/src/test/java/software/amazon/smithy/gradle/tasks/SmithyValidateTaskTest.java b/smithy-jar/src/test/java/software/amazon/smithy/gradle/tasks/SmithyValidateTaskTest.java similarity index 100% rename from smithy-jar-plugin/src/test/java/software/amazon/smithy/gradle/tasks/SmithyValidateTaskTest.java rename to smithy-jar/src/test/java/software/amazon/smithy/gradle/tasks/SmithyValidateTaskTest.java From 63942457ff7957510a636f9f0c65b2b692ba3887 Mon Sep 17 00:00:00 2001 From: Hunter Mellema Date: Thu, 11 Jan 2024 07:39:15 -0700 Subject: [PATCH 4/5] Add repositories to main build script to fix configuration caching --- build.gradle.kts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index 205e633..504d3d4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -268,3 +268,8 @@ jreleaser { } } } + +repositories { + mavenLocal() + mavenCentral() +} From 67770a03fa0870935cc852bd630afda08ee45254 Mon Sep 17 00:00:00 2001 From: Hunter Mellema Date: Thu, 11 Jan 2024 09:08:13 -0700 Subject: [PATCH 5/5] Update nexus urls --- build.gradle.kts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 504d3d4..7aeae3c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -257,9 +257,9 @@ jreleaser { maven { nexus2 { create("maven-central") { - active.set(Active.ALWAYS) - url.set("https://s01.oss.sonatype.org/service/local") - snapshotUrl.set("https://s01.oss.sonatype.org/content/repositories/snapshots/") + active = Active.ALWAYS + url = "https://aws.oss.sonatype.org/service/local" + snapshotUrl = "https://aws.oss.sonatype.org/content/repositories/snapshots" closeRepository.set(false) releaseRepository.set(false) stagingRepositories.add(stagingDirectory)