mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 11:53:49 +07:00
bundle scala plugin to idea edu
This commit is contained in:
2
.idea/runConfigurations/PyCharm_Edu.xml
generated
2
.idea/runConfigurations/PyCharm_Edu.xml
generated
@@ -14,7 +14,7 @@
|
||||
<option name="VM_PARAMETERS" value="-ea -Xmx192m -Didea.is.internal=true -Didea.platform.prefix=PyCharmEdu -Didea.config.path=../config/pycharmEdu -Didea.system.path=../system/pycharmEdu" />
|
||||
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/bin" />
|
||||
<method>
|
||||
<option name="Gradle.BeforeRunTask" enabled="true" tasks="deployEduPlugin" externalProjectPath="$PROJECT_DIR$/edu/dependencies" vmOptions="-Didea.config.path=../../config/pycharmEdu" scriptParameters="" />
|
||||
<option name="Gradle.BeforeRunTask" enabled="true" tasks="deployEduToolsPlugin" externalProjectPath="$PROJECT_DIR$/edu/dependencies" vmOptions="-Didea.config.path=../../config/pycharmEdu" scriptParameters="" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
||||
@@ -39,26 +39,46 @@ repositories {
|
||||
|
||||
configurations {
|
||||
eduPlugin
|
||||
scalaPlugin
|
||||
}
|
||||
|
||||
def eduPluginId = "com.jetbrains.edu"
|
||||
def eduPluginName = "EduTools"
|
||||
def EduToolsPluginId = "com.jetbrains.edu"
|
||||
def EduToolsPluginName = "EduTools"
|
||||
|
||||
def ScalaPluginId = "org.intellij.scala"
|
||||
def ScalaPluginName = "Scala"
|
||||
|
||||
dependencies {
|
||||
eduPlugin "com.jetbrains.plugins:$eduPluginId:$eduPluginVersion@zip"
|
||||
eduPlugin "com.jetbrains.plugins:$EduToolsPluginId:$EduToolsPluginVersion@zip"
|
||||
scalaPlugin "com.jetbrains.plugins:$ScalaPluginId:$ScalaPluginVersion@zip"
|
||||
}
|
||||
|
||||
task setupEduPlugin(dependsOn: configurations.eduPlugin, type: Sync) {
|
||||
task setupEduToolsPlugin(dependsOn: configurations.eduPlugin, type: Sync) {
|
||||
from fileTree(configurations.eduPlugin.singleFile)
|
||||
into "${project.buildDir}/edu/"
|
||||
into "${project.buildDir}/$EduToolsPluginName/"
|
||||
rename { String fileName ->
|
||||
fileName.replace(eduPluginId, eduPluginName) }
|
||||
fileName.replace(EduToolsPluginId, EduToolsPluginName) }
|
||||
}
|
||||
|
||||
task deployEduPlugin(dependsOn: setupEduPlugin, type: Sync) {
|
||||
from zipTree("${project.buildDir}/edu/$eduPluginName-${eduPluginVersion}.zip")
|
||||
task deployEduToolsPlugin(dependsOn: setupEduToolsPlugin, type: Sync) {
|
||||
from zipTree("${project.buildDir}/$EduToolsPluginName/$EduToolsPluginName-${EduToolsPluginVersion}.zip")
|
||||
into "${System.getProperty("idea.config.path")}/plugins/"
|
||||
preserve {
|
||||
exclude "$eduPluginName/**"
|
||||
exclude "$EduToolsPluginName/**"
|
||||
}
|
||||
}
|
||||
|
||||
task setupScalaPlugin(dependsOn: configurations.scalaPlugin, type: Sync) {
|
||||
from fileTree(configurations.scalaPlugin.singleFile)
|
||||
into "${project.buildDir}/$ScalaPluginName/"
|
||||
rename { String fileName ->
|
||||
fileName.replace(ScalaPluginId, ScalaPluginName) }
|
||||
}
|
||||
|
||||
task deployScalaPlugin(dependsOn: setupScalaPlugin, type: Sync) {
|
||||
from zipTree("${project.buildDir}/$ScalaPluginName/$ScalaPluginName-${ScalaPluginVersion}.zip")
|
||||
into "${System.getProperty("idea.config.path")}/plugins/"
|
||||
preserve {
|
||||
exclude "$ScalaPluginName/**"
|
||||
}
|
||||
}
|
||||
@@ -1 +1,2 @@
|
||||
eduPluginVersion=1.7-2018.1-119
|
||||
EduToolsPluginVersion=1.7-2018.1-119
|
||||
ScalaPluginVersion=2018.2.6
|
||||
|
||||
@@ -20,17 +20,18 @@ import com.intellij.util.SystemProperties
|
||||
import com.intellij.util.io.ZipUtil
|
||||
|
||||
class EduUtils {
|
||||
static void copyEduToolsPlugin(String dependenciesPath, BuildContext buildContext, String targetDirectory) {
|
||||
static void copyPlugin(String pluginName, String dependenciesPath, BuildContext buildContext, String targetDirectory) {
|
||||
def dependenciesProjectDir = new File(dependenciesPath)
|
||||
new GradleRunner(dependenciesProjectDir, buildContext.messages, SystemProperties.getJavaHome()).run("Downloading EduTools plugin...", "setupEduPlugin")
|
||||
new GradleRunner(dependenciesProjectDir, buildContext.messages, SystemProperties.getJavaHome()).run(
|
||||
"Downloading $pluginName plugin...", "setup${pluginName}Plugin")
|
||||
Properties properties = new Properties()
|
||||
new File(dependenciesProjectDir, "gradle.properties").withInputStream {
|
||||
properties.load(it)
|
||||
}
|
||||
|
||||
def pluginZip = new File("${dependenciesProjectDir.absolutePath}/build/edu/EduTools-${properties.getProperty("eduPluginVersion")}.zip")
|
||||
def pluginZip = new File("${dependenciesProjectDir.absolutePath}/build/$pluginName/$pluginName-${properties.getProperty("${pluginName}PluginVersion")}.zip")
|
||||
if (!pluginZip.exists()) {
|
||||
throw new IllegalStateException("EduTools bundled plugin is not found. Plugin path:${pluginZip.canonicalPath}")
|
||||
throw new IllegalStateException("$pluginName bundled plugin is not found. Plugin path:${pluginZip.canonicalPath}")
|
||||
}
|
||||
ZipUtil.extract(pluginZip, new File("$targetDirectory/plugins/"), new FilenameFilter() {
|
||||
@Override
|
||||
|
||||
@@ -32,7 +32,8 @@ class IdeaEduProperties extends IdeaCommunityProperties {
|
||||
void copyAdditionalFiles(BuildContext buildContext, String targetDirectory) {
|
||||
super.copyAdditionalFiles(buildContext, targetDirectory)
|
||||
|
||||
EduUtils.copyEduToolsPlugin(dependenciesPath, buildContext, targetDirectory)
|
||||
EduUtils.copyPlugin("EduTools", dependenciesPath, buildContext, targetDirectory)
|
||||
EduUtils.copyPlugin("Scala", dependenciesPath, buildContext, targetDirectory)
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,7 +37,7 @@ class PyCharmEduProperties extends PyCharmPropertiesBase {
|
||||
fileset(file: "$context.paths.communityHome/NOTICE.txt")
|
||||
}
|
||||
|
||||
EduUtils.copyEduToolsPlugin(dependenciesPath, context, targetDirectory)
|
||||
EduUtils.copyPlugin("EduTools", dependenciesPath, context, targetDirectory)
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user