diff options
author | Allan Wang <me@allanwang.ca> | 2019-07-03 00:06:02 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2019-07-03 00:06:02 -0700 |
commit | 33274faf9bb68eb95cb3e2e095cd0cef84aa6fd7 (patch) | |
tree | 82ffc3467fae807d33abf5ff9f8c61dcb4f87134 /buildSrc/src/main/kotlin/FrostPlugin.kt | |
parent | 93d2d28af68c932e1bdd931fcb4a62943c45e14d (diff) | |
download | frost-33274faf9bb68eb95cb3e2e095cd0cef84aa6fd7.tar.gz frost-33274faf9bb68eb95cb3e2e095cd0cef84aa6fd7.tar.bz2 frost-33274faf9bb68eb95cb3e2e095cd0cef84aa6fd7.zip |
Remove custom extensions and use plugin as is
Diffstat (limited to 'buildSrc/src/main/kotlin/FrostPlugin.kt')
-rw-r--r-- | buildSrc/src/main/kotlin/FrostPlugin.kt | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/buildSrc/src/main/kotlin/FrostPlugin.kt b/buildSrc/src/main/kotlin/FrostPlugin.kt deleted file mode 100644 index 7b5075f8..00000000 --- a/buildSrc/src/main/kotlin/FrostPlugin.kt +++ /dev/null @@ -1,37 +0,0 @@ -import com.moowork.gradle.node.NodeExtension -import com.moowork.gradle.node.NodePlugin -import org.gradle.api.Plugin -import org.gradle.api.Project -import org.gradle.kotlin.dsl.apply -import org.gradle.kotlin.dsl.create - -class FrostPlugin : Plugin<Project> { - - companion object { - private const val NODE_VERSION = "12.4.0" - } - - override fun apply(project: Project) { - println("Applying Frost Plugin") - project.plugins.withId("java-base") { - project.applyWebGenPlugin() - } - project.gradle.taskGraph.whenReady { - if (!project.plugins.hasPlugin("java-base")) { - throw IllegalArgumentException("Frost plugin can't be applied without Android or Java or Kotlin plugin.") - } - } - } - - private fun Project.applyWebGenPlugin() { - setupNode() - tasks.create(WebGenInstallTask.NAME, WebGenInstallTask::class) - } - - private fun Project.setupNode() { - plugins.apply(NodePlugin::class) - val nodeConfig = extensions.findByName("node") as NodeExtension - nodeConfig.download = true - nodeConfig.version = NODE_VERSION - } -}
\ No newline at end of file |