Created
July 26, 2017 07:21
-
-
Save dmikurube/caa7ca400382d5e5bfde292455e26bf5 to your computer and use it in GitHub Desktop.
Gradle plugin embedded in build.gradle
This file contains hidden or 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
apply plugin: EmbeddedPlugin | |
embeddedPluginConfig { | |
name = "Someone" | |
} | |
class EmbeddedPlugin implements Plugin<Project> { | |
void apply(Project project) { | |
project.extensions.create('embeddedPluginConfig', EmbeddedPluginExtension) | |
project.afterEvaluate { | |
project.task("printName") { | |
println "Hello, " + project.embeddedPluginConfig.name + "!" | |
} | |
} | |
} | |
} | |
class EmbeddedPluginExtension { | |
String name | |
} |
Author
dmikurube
commented
Jul 26, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment