-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce a "base" module plugin (#217)
Some modules may not want to add the standard dependencies, because they are not runtime modules. A typical example is that AOT module which doesn't use annotation processing and will never be found on a user classpath.
- Loading branch information
Showing
3 changed files
with
37 additions
and
10 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
32 changes: 32 additions & 0 deletions
32
src/main/groovy/io/micronaut/build/MicronautBaseModulePlugin.groovy
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,32 @@ | ||
package io.micronaut.build | ||
|
||
import groovy.transform.CompileStatic | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.api.artifacts.Dependency | ||
import org.gradle.api.artifacts.ExternalModuleDependency | ||
import org.gradle.api.tasks.testing.Test | ||
|
||
/** | ||
* Configures a project as a typical Micronaut module project: | ||
* - with dependency updates plugin | ||
* - published on a Maven repository | ||
* - with JUnit platform testing | ||
*/ | ||
@CompileStatic | ||
class MicronautBaseModulePlugin implements Plugin<Project> { | ||
@Override | ||
void apply(Project project) { | ||
project.pluginManager.apply(MicronautBuildCommonPlugin) | ||
project.pluginManager.apply(MicronautDependencyUpdatesPlugin) | ||
project.pluginManager.apply(MicronautPublishingPlugin) | ||
configureJUnit(project) | ||
} | ||
|
||
private static void configureJUnit(Project project) { | ||
project.tasks.withType(Test).configureEach { Test test -> | ||
test.useJUnitPlatform() | ||
} | ||
} | ||
|
||
} |
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