EDU-1146 bundle EduTools plugin into PyCharm Edu

This commit is contained in:
Liana.Bakradze
2017-11-07 18:52:24 +03:00
parent fb6847bf9e
commit 519e095880
4 changed files with 31 additions and 0 deletions
@@ -34,6 +34,14 @@ class PyCharmEduProperties extends PyCharmPropertiesBase {
fileset(file: "$context.paths.communityHome/LICENSE.txt")
fileset(file: "$context.paths.communityHome/NOTICE.txt")
}
def files = new File("$pythonCommunityPath/educational-python/resources/").listFiles(new FilenameFilter() {
@Override
boolean accept(File dir, String name) {
return name.matches("EduTools-[0-9.]+-[0-9.]+-[0-9.]+.zip")
}
})
context.ant.unzip(src: files[0], dest: "$targetDirectory/plugins/")
}
@Override
@@ -4,6 +4,7 @@
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/groovy" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
@@ -12,5 +13,6 @@
<orderEntry type="module" module-name="build" />
<orderEntry type="module" module-name="buildScripts" />
<orderEntry type="module" module-name="python-community-build" />
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
</component>
</module>
@@ -0,0 +1,21 @@
import com.intellij.openapi.util.io.FileUtil
import com.intellij.util.io.ZipUtil
import java.io.File
import java.io.FileFilter
/**
* Deploys Educational plugin into config/plugins directory.
* Plugins directory is specified in "idea.plugins.path" system property.
*/
fun main(args: Array<String>) {
var rootPath = File("").absolutePath
val outputDir = File(rootPath, FileUtil.toSystemDependentName(System.getProperty("idea.plugins.path")))
val communityPath = FileUtil.join(rootPath, "community")
if (File(communityPath).exists()) {
rootPath = communityPath
}
val resourcesPath = FileUtil.join(rootPath, "python", "educational-python", "resources")
val files = File(resourcesPath).listFiles(
FileFilter { pathname -> pathname.name.matches(Regex("EduTools-[0-9.]+-[0-9.]+-[0-9.]+.zip")) })
ZipUtil.extract(files[0], outputDir, null)
}