-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor to use convention plugins for common configuration (#117)
Refactor project to use buildSrc plugins for common configuration rather than looping through subprojects.
- Loading branch information
Showing
9 changed files
with
226 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
plugins { | ||
// Support convention plugins written in Kotlin. Convention plugins are | ||
// build scripts in 'src/main' that automatically become available as | ||
// plugins in the main build. | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
// Use the plugin portal to apply community plugins in convention plugins. | ||
gradlePluginPortal() | ||
} | ||
|
||
dependencies { | ||
// Java convention dependencies | ||
implementation("com.github.spotbugs.snom:spotbugs-gradle-plugin:6.0.6") | ||
implementation("com.adarshr:gradle-test-logger-plugin:4.0.0") | ||
|
||
// Plugin convention dependencies | ||
implementation("com.gradle.publish:plugin-publish-plugin:1.2.1") | ||
} |
52 changes: 52 additions & 0 deletions
52
buildSrc/src/main/kotlin/smithy-gradle-plugin.java-conventions.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
|
||
plugins { | ||
`java-library` | ||
checkstyle | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
|
||
dependencies { | ||
implementation("software.amazon.smithy:smithy-model:[1.0, 2.0[") | ||
implementation("software.amazon.smithy:smithy-build:[1.0, 2.0[") | ||
implementation("software.amazon.smithy:smithy-cli:[1.0, 2.0[") | ||
} | ||
|
||
//// ==== Licensing ===== | ||
// Reusable license copySpec | ||
val licenseSpec = copySpec { | ||
from("${project.rootDir}/LICENSE") | ||
from("${project.rootDir}/NOTICE") | ||
} | ||
|
||
// Configure all jars to include license info | ||
tasks.withType<Jar>() { | ||
metaInf.with(licenseSpec) | ||
} | ||
|
||
|
||
|
||
// Suppress warnings in javadocs | ||
tasks.withType<Javadoc> { | ||
(options as StandardJavadocDocletOptions).addStringOption("Xdoclint:-html", "-quiet") | ||
} | ||
|
||
/* | ||
* CheckStyle | ||
* ==================================================== | ||
* | ||
* Apply CheckStyle to source files but not tests. | ||
*/ | ||
tasks["checkstyleTest"].enabled = false | ||
|
||
/* | ||
* Repositories | ||
* ==================================================== | ||
*/ | ||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
} |
Oops, something went wrong.