From ab7af969824c424c39c93843c3b207ad48b2dcb4 Mon Sep 17 00:00:00 2001 From: Hunter Mellema Date: Wed, 12 Apr 2023 09:30:21 -0600 Subject: [PATCH 1/3] Update Gradle Build to include license info in artifact POM --- build.gradle.kts | 47 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 3514c73..cfbebaa 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -17,6 +17,14 @@ import com.github.spotbugs.snom.Effort import com.github.spotbugs.snom.SpotBugsTask import com.adarshr.gradle.testlogger.TestLoggerExtension; +group = "software.amazon.smithy" +version = "0.6.0" +description = "This project integrates Smithy with Gradle. This plugin can build artifacts " + + "from Smithy models, generate JARs that contain Smithy models found in Java " + + "projects, and generate JARs that contain filtered *projections* of Smithy " + + "models." + + plugins { `java-gradle-plugin` `maven-publish` @@ -27,9 +35,6 @@ plugins { id("com.adarshr.test-logger") version "3.2.0" } -group = "software.amazon.smithy" -version = "0.6.0" - dependencies { implementation("software.amazon.smithy:smithy-model:[1.0, 2.0[") implementation("software.amazon.smithy:smithy-build:[1.0, 2.0[") @@ -134,12 +139,30 @@ repositories { publishing { publications { - create("mavenJava") { - from(components["java"]) - - // Ship the source and javadoc jars. - artifact(tasks["sourcesJar"]) - artifact(tasks["javadocJar"]) + create("pluginMaven") { + pom { + description.set(project.description) + url.set("https://github.com/awslabs/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/awslabs/smithy-gradle-plugin.git") + } + } } } } @@ -194,16 +217,12 @@ tasks.withType().configureEach { * Gradle plugins * ==================================================== */ - gradlePlugin { plugins { create("software.amazon.smithy") { id = "software.amazon.smithy" displayName = "Smithy Gradle Plugin" - description = "This project integrates Smithy with Gradle. This plugin can build artifacts " + - "from Smithy models, generate JARs that contain Smithy models found in Java " + - "projects, and generate JARs that contain filtered *projections* of Smithy " + - "models." + description = project.description implementationClass = "software.amazon.smithy.gradle.SmithyPlugin" } } From 0b5eddc042cd223edd0de034b0ff48b3cb0fcbe5 Mon Sep 17 00:00:00 2001 From: Hunter Mellema Date: Wed, 12 Apr 2023 10:07:00 -0600 Subject: [PATCH 2/3] Set version via VERSION file --- VERSION | 1 + build.gradle.kts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 VERSION diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..09a3acf --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.6.0 \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index cfbebaa..b66e240 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -16,14 +16,17 @@ import com.github.spotbugs.snom.Effort import com.github.spotbugs.snom.SpotBugsTask import com.adarshr.gradle.testlogger.TestLoggerExtension; +import java.nio.charset.Charset group = "software.amazon.smithy" -version = "0.6.0" +// Load the version from VERSION File. +version = project.file("VERSION").readText().replace(System.lineSeparator(), "") description = "This project integrates Smithy with Gradle. This plugin can build artifacts " + "from Smithy models, generate JARs that contain Smithy models found in Java " + "projects, and generate JARs that contain filtered *projections* of Smithy " + "models." +println("Smithy version: '${version}'") plugins { `java-gradle-plugin` From 6fb7c046349b9baba0974a6e3494e21a9379a90a Mon Sep 17 00:00:00 2001 From: Hunter Mellema Date: Wed, 12 Apr 2023 10:18:32 -0600 Subject: [PATCH 3/3] Add back in src and javadoc jars --- build.gradle.kts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index b66e240..8860d20 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -143,6 +143,11 @@ repositories { publishing { publications { create("pluginMaven") { + + // Ship the source and javadoc jars. + artifact(tasks["sourcesJar"]) + artifact(tasks["javadocJar"]) + pom { description.set(project.description) url.set("https://github.com/awslabs/smithy-gradle-plugin")