Browse Source

Build: Remove xpack specific run task (#30487)

With the opening of xpack, we still retained a run task within
:x-pack:plugin. However, the root level run task also runs with the
default distribution. This change removes the extra run task inside
xpack in favor of using the root level task, and moves the
license/configuration code for run into the main run configuration.
Ryan Ernst 7 years ago
parent
commit
bd24caccaf
2 changed files with 16 additions and 18 deletions
  1. 16 0
      distribution/build.gradle
  2. 0 18
      x-pack/plugin/build.gradle

+ 16 - 0
distribution/build.gradle

@@ -312,6 +312,22 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
 
 task run(type: RunTask) {
   distribution = System.getProperty('run.distribution', 'zip')
+  if (distribution == 'zip') {
+    String licenseType = System.getProperty("license_type", "basic")
+    if (licenseType == 'trial') {
+      setting 'xpack.ml.enabled', 'true'
+      setting 'xpack.graph.enabled', 'true'
+      setting 'xpack.watcher.enabled', 'true'
+      setting 'xpack.license.self_generated.type', 'trial'
+    } else if (licenseType != 'basic') {
+      throw new IllegalArgumentException("Unsupported self-generated license type: [" + licenseType + "[basic] or [trial].")
+    }
+    setting 'xpack.security.enabled', 'true'
+    setting 'xpack.monitoring.enabled', 'true'
+    setting 'xpack.sql.enabled', 'true'
+    setting 'xpack.rollup.enabled', 'true'
+    keystoreSetting 'bootstrap.password', 'password'
+  }
 }
 
 /**

+ 0 - 18
x-pack/plugin/build.gradle

@@ -158,21 +158,3 @@ integTestCluster {
       return tmpFile.exists()
   }
 }
-
-run {
-  def licenseType = System.getProperty("license_type", "basic")
-  if (licenseType == 'trial') {
-    setting 'xpack.ml.enabled', 'true'
-    setting 'xpack.graph.enabled', 'true'
-    setting 'xpack.watcher.enabled', 'true'
-    setting 'xpack.license.self_generated.type', 'trial'
-  } else if (licenseType != 'basic') {
-    throw new IllegalArgumentException("Unsupported self-generated license type: [" + licenseType + "]. Must be " +
-    "[basic] or [trial].")
-  }
-  setting 'xpack.security.enabled', 'true'
-  setting 'xpack.monitoring.enabled', 'true'
-  setting 'xpack.sql.enabled', 'true'
-  setting 'xpack.rollup.enabled', 'true'
-  keystoreSetting 'bootstrap.password', 'password'
-}