Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Gradle Build to include license info in artifact POM #76

Merged
merged 3 commits into from
Apr 12, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.6.0
50 changes: 36 additions & 14 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +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"
// 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`
Expand All @@ -27,9 +38,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[")
Expand Down Expand Up @@ -134,12 +142,30 @@ repositories {

publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])

// Ship the source and javadoc jars.
artifact(tasks["sourcesJar"])
artifact(tasks["javadocJar"])
create<MavenPublication>("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")
}
}
}
}
}
Expand Down Expand Up @@ -194,16 +220,12 @@ tasks.withType<SpotBugsTask>().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"
}
}
Expand Down