-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract build logic to convention plugin
- Loading branch information
Showing
5 changed files
with
72 additions
and
86 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
gradlePluginPortal() | ||
} | ||
|
||
dependencies { | ||
implementation("com.gradle.publish:plugin-publish-plugin:1.1.0") | ||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.0-Beta") | ||
implementation("com.netflix.nebula:nebula-publishing-plugin:19.0.0") | ||
} |
Empty file.
56 changes: 56 additions & 0 deletions
56
buildSrc/src/main/kotlin/com.ryandens.plugin-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,56 @@ | ||
import org.gradle.kotlin.dsl.`java-gradle-plugin` | ||
import org.gradle.kotlin.dsl.`maven-publish` | ||
import org.gradle.kotlin.dsl.version | ||
|
||
plugins { | ||
`java-gradle-plugin` | ||
`maven-publish` | ||
id("com.gradle.plugin-publish") | ||
id("org.jetbrains.kotlin.jvm") | ||
id("com.netflix.nebula.maven-apache-license") | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
|
||
pluginBundle { | ||
website = "https://www.ryandens.com" | ||
vcsUrl = "https://github.com/ryandens/javaagent-gradle-plugin" | ||
} | ||
|
||
tasks { | ||
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach { | ||
kotlinOptions.jvmTarget = "1.8" | ||
kotlinOptions.allWarningsAsErrors = true | ||
} | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
|
||
// Add a source set for the functional test suite | ||
val functionalTestSourceSet = sourceSets.create("functionalTest") { | ||
} | ||
|
||
gradlePlugin.testSourceSets(functionalTestSourceSet) | ||
configurations["functionalTestImplementation"].extendsFrom(configurations["testImplementation"]) | ||
|
||
// Add a task to run the functional tests | ||
val functionalTest by tasks.registering(Test::class) { | ||
testClassesDirs = functionalTestSourceSet.output.classesDirs | ||
classpath = functionalTestSourceSet.runtimeClasspath | ||
} | ||
|
||
tasks.check { | ||
// Run the functional tests as part of `check` | ||
dependsOn(functionalTest) | ||
} | ||
|
||
dependencies { | ||
implementation(platform("org.jetbrains.kotlin:kotlin-bom")) | ||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") | ||
} |
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