[space plugin] Allow to run Space Automation from sources
authorNikolay Rykunov <nikolay.rykunov@jetbrains.com>
Thu, 30 Jul 2020 15:17:53 +0000 (18:17 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Fri, 31 Jul 2020 16:51:38 +0000 (16:51 +0000)
GitOrigin-RevId: dbe292ff7469646c4f7c7683c9c342f5ebfe4bc3

.idea/modules.xml
build/dependencies/build.gradle
build/dependencies/setupSpacePlugin.gradle [new file with mode: 0644]
intellij.idea.community.main.space.iml [new file with mode: 0644]
plugins/space/intellij.space.iml
plugins/space/src/main/kotlin/com/intellij/space/plugins/pipelines/services/SpaceScriptDefinitionsProvider.kt

index 84a2ae6d8619a877e6b4b93b792acc04ddd80fc1..4dc1415fbbda32df2b07ea9689a47509564cc3f9 100644 (file)
       <module fileurl="file://$PROJECT_DIR$/build/intellij.idea.community.build.iml" filepath="$PROJECT_DIR$/build/intellij.idea.community.build.iml" />
       <module fileurl="file://$PROJECT_DIR$/community-guitests/intellij.idea.community.guiTests.iml" filepath="$PROJECT_DIR$/community-guitests/intellij.idea.community.guiTests.iml" />
       <module fileurl="file://$PROJECT_DIR$/intellij.idea.community.main.iml" filepath="$PROJECT_DIR$/intellij.idea.community.main.iml" />
+      <module fileurl="file://$PROJECT_DIR$/intellij.idea.community.main.space.iml" filepath="$PROJECT_DIR$/intellij.idea.community.main.space.iml" />
       <module fileurl="file://$PROJECT_DIR$/community-resources/intellij.idea.community.resources.iml" filepath="$PROJECT_DIR$/community-resources/intellij.idea.community.resources.iml" />
       <module fileurl="file://$PROJECT_DIR$/build/launch/intellij.idea.tools.launch.iml" filepath="$PROJECT_DIR$/build/launch/intellij.idea.tools.launch.iml" />
       <module fileurl="file://$PROJECT_DIR$/java/openapi/intellij.java.iml" filepath="$PROJECT_DIR$/java/openapi/intellij.java.iml" />
index f655ca547131bc6fc070ed7dda5cbaccf0a2b5cd..d0812044a8bb5f950adca947e34e649d3ebf4631 100644 (file)
@@ -51,6 +51,7 @@ apply from: 'setupCidr.gradle'
 apply from: 'setupCodeWithMe.gradle'
 apply from: 'setupDelve.gradle'
 apply from: 'setupRpluginDeps.gradle'
+apply from: 'setupSpacePlugin.gradle'
 apply from: 'setupZkm.gradle'
 
 task setupDependencies(dependsOn: ['setupJdks', 'setupJbre', 'setupKotlinPlugin', 'setupThirdPartyPlugins',
diff --git a/build/dependencies/setupSpacePlugin.gradle b/build/dependencies/setupSpacePlugin.gradle
new file mode 100644 (file)
index 0000000..947024f
--- /dev/null
@@ -0,0 +1,19 @@
+// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+import java.util.concurrent.TimeUnit
+
+task setupSpaceAutomationDefinitions {
+  def version = "1.0.51354"
+  def artifact = file("$buildDir/space/space-idea-script-definition.jar")
+  outputs.file(artifact)
+  doLast {
+    download {
+      src "https://cache-redirector.jetbrains.com/jetbrains.bintray.com/space/com/jetbrains/space-idea-script-definition/$version/space-idea-script-definition-${version}.jar"
+      tempAndMove true
+      dest artifact
+      timeout TimeUnit.MINUTES.toMillis(5).toInteger()
+    }
+  }
+}
+
+task setupSpaceAutomation(dependsOn: [setupKotlinPlugin, setupSpaceAutomationDefinitions]) {
+}
\ No newline at end of file
diff --git a/intellij.idea.community.main.space.iml b/intellij.idea.community.main.space.iml
new file mode 100644 (file)
index 0000000..3b59ca6
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module relativePaths="true" type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="intellij.idea.community.main" scope="RUNTIME" />
+    <orderEntry type="library" scope="RUNTIME" name="KotlinPlugin" level="project" />
+  </component>
+</module>
\ No newline at end of file
index dc9934e0954e18d93ba48e046eb842e51f021d86..54b2c40ad68d5386f2f2fc237464c219fa6ccabb 100644 (file)
@@ -87,7 +87,7 @@
         </SOURCES>
       </library>
     </orderEntry>
-    <orderEntry type="module-library">
+    <orderEntry type="module-library" scope="PROVIDED">
       <library name="kotlin-scripting-intellij" type="repository">
         <properties maven-id="org.jetbrains.kotlin:kotlin-scripting-intellij:1.3.72">
           <exclude>
index 9b7b7652feaf0647d6014cad3a171f56d7046fdb..b7bf905cdbca5176ec7b3fc85dcfdf701e83d10f 100644 (file)
@@ -1,7 +1,7 @@
 package com.intellij.space.plugins.pipelines.services
 
 import circlet.pipelines.config.utils.ScriptConstants
-import com.intellij.space.plugins.pipelines.utils.JarFinder
+import com.intellij.openapi.application.PathManager
 import java.io.File
 import kotlin.script.experimental.intellij.ScriptDefinitionsProvider
 
@@ -14,12 +14,8 @@ class SpaceScriptDefinitionsProvider : ScriptDefinitionsProvider {
   }
 
   override fun getDefinitionsClassPath(): Iterable<File> {
-    val defFile = JarFinder.find("pipelines-config-scriptdefinition-compile")
-    if (!defFile.exists()) {
-      throw Exception("File with ProjectScriptDefinition doesn't exist")
-    }
-
-    return listOf(defFile)
+    val jarName = "space-idea-script-definition.jar"
+    return listOf(File("${PathManager.getHomePath()}/community/build/dependencies/build/space/$jarName"))
   }
 
   override fun useDiscovery(): Boolean {