aboutsummaryrefslogtreecommitdiff
path: root/web-gen/src/main/groovy/com/pitchedapps/frost/gradle/WebGenPlugin.groovy
diff options
context:
space:
mode:
Diffstat (limited to 'web-gen/src/main/groovy/com/pitchedapps/frost/gradle/WebGenPlugin.groovy')
-rw-r--r--web-gen/src/main/groovy/com/pitchedapps/frost/gradle/WebGenPlugin.groovy49
1 files changed, 0 insertions, 49 deletions
diff --git a/web-gen/src/main/groovy/com/pitchedapps/frost/gradle/WebGenPlugin.groovy b/web-gen/src/main/groovy/com/pitchedapps/frost/gradle/WebGenPlugin.groovy
deleted file mode 100644
index 90609607..00000000
--- a/web-gen/src/main/groovy/com/pitchedapps/frost/gradle/WebGenPlugin.groovy
+++ /dev/null
@@ -1,49 +0,0 @@
-import com.moowork.gradle.node.NodeExtension
-import com.pitchedapps.frost.gradle.WebGenInstallTask
-import org.gradle.api.Plugin
-import org.gradle.api.Project
-import org.gradle.api.internal.file.FileResolver
-
-import javax.inject.Inject
-
-class WebGenPlugin implements Plugin<Project> {
-
- private static final String NODE_VERSION = "12.4.0"
- private Project project
- private final FileResolver fileResolver
-
- @Inject
- WebGenPlugin(FileResolver fileResolver) {
- this.fileResolver = fileResolver
- }
-
- /**
- * Based on https://github.com/apollographql/apollo-android/blob/master/apollo-gradle-plugin/src/main/groovy/com/apollographql/apollo/gradle/ApolloPlugin.groovy
- * @param target
- */
- @Override
- void apply(Project target) {
- this.project = project
- project.plugins.withId("java-base") {
- applyWebGenPlugin()
- }
- project.gradle.getTaskGraph().whenReady {
- if (!project.plugins.hasPlugin("java-base")) {
- throw new IllegalArgumentException(
- "Frost Web Gen plugin can't be applied without Android or Java or Kotlin plugin.")
- }
- }
- }
-
- private void applyWebGenPlugin() {
- setupNode()
- project.tasks.create(WebGenInstallTask.NAME, WebGenInstallTask.class)
- }
-
- private void setupNode() {
- project.plugins.apply NodePlugin
- NodeExtension nodeConfig = project.extensions.findByName("node") as NodeExtension
- nodeConfig.download = true
- nodeConfig.version = NODE_VERSION
- }
-} \ No newline at end of file