-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
71 additions
and
95 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 |
---|---|---|
@@ -1,69 +1,47 @@ | ||
/* | ||
* This file was generated by the Gradle 'init' task. | ||
* | ||
* This generated file contains a sample Gradle plugin project to get you started. | ||
* For more details on writing Custom Plugins, please refer to https://docs.gradle.org/8.7/userguide/custom_plugins.html in the Gradle documentation. | ||
* This generated file contains a sample Java application project to get you started. | ||
* For more details on building Java & JVM projects, please refer to https://docs.gradle.org/8.7/userguide/building_java_projects.html in the Gradle documentation. | ||
*/ | ||
|
||
plugins { | ||
// Apply the Java Gradle plugin development plugin to add support for developing Gradle plugins | ||
id 'java-gradle-plugin' | ||
// Apply the application plugin to add support for building a CLI application in Java. | ||
id 'application' | ||
} | ||
|
||
repositories { | ||
// Use Maven Central for resolving dependencies. | ||
mavenCentral() | ||
|
||
// Local libs | ||
// Local NATT libs | ||
flatDir { | ||
dirs 'libs' | ||
} | ||
} | ||
|
||
dependencies { | ||
// Use JUnit Jupiter for testing. | ||
testImplementation libs.junit.jupiter | ||
|
||
// NATT SPI | ||
implementation name: 'natt-spi-1.0.0' | ||
|
||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher' | ||
} | ||
|
||
gradlePlugin { | ||
// Define the plugin | ||
plugins { | ||
greeting { | ||
id = 'natt.plugin' | ||
implementationClass = 'natt.plugin.PluginMain' | ||
} | ||
} | ||
} | ||
|
||
// Add a source set for the functional test suite | ||
sourceSets { | ||
functionalTest { | ||
// Apply a specific Java toolchain to ease working on different environments. | ||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(17) | ||
} | ||
} | ||
|
||
configurations.functionalTestImplementation.extendsFrom(configurations.testImplementation) | ||
configurations.functionalTestRuntimeOnly.extendsFrom(configurations.testRuntimeOnly) | ||
|
||
// Add a task to run the functional tests | ||
tasks.register('functionalTest', Test) { | ||
testClassesDirs = sourceSets.functionalTest.output.classesDirs | ||
classpath = sourceSets.functionalTest.runtimeClasspath | ||
useJUnitPlatform() | ||
application { | ||
// Define the main class for the application. | ||
mainClass = 'natt.plugin.PluginMain' | ||
} | ||
|
||
gradlePlugin.testSourceSets.add(sourceSets.functionalTest) | ||
|
||
tasks.named('check') { | ||
// Run the functional tests as part of `check` | ||
dependsOn(tasks.functionalTest) | ||
} | ||
|
||
tasks.named('test') { | ||
// Use JUnit Jupiter for unit tests. | ||
useJUnitPlatform() | ||
} | ||
jar { | ||
manifest { | ||
attributes( | ||
'Main-Class': 'natt.plugin.PluginMain', | ||
'Implementation-Version': version | ||
) | ||
} | ||
} |
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
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