summaryrefslogtreecommitdiff
path: root/python/edu/build/pycharm_edu_build.gant
diff options
context:
space:
mode:
Diffstat (limited to 'python/edu/build/pycharm_edu_build.gant')
-rw-r--r--python/edu/build/pycharm_edu_build.gant74
1 files changed, 45 insertions, 29 deletions
diff --git a/python/edu/build/pycharm_edu_build.gant b/python/edu/build/pycharm_edu_build.gant
index 8c857c159874..2ef0bed607a7 100644
--- a/python/edu/build/pycharm_edu_build.gant
+++ b/python/edu/build/pycharm_edu_build.gant
@@ -13,26 +13,22 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import org.jetbrains.jps.LayoutInfo
-
-import static org.jetbrains.jps.idea.IdeaProjectLoader.guessHome
-setProperty("home", guessHome(this as Script))
+import org.jetbrains.jps.LayoutInfo
-includeTargets << new File("${guessHome(this as Script)}/build/scripts/utils.gant")
-// signMacZip locates in ultimate_utils.gant
- includeTargets << new File("${guessHome(this)}/ultimate/build/scripts/ultimate_utils.gant")
-includeTargets << new File("${guessHome(this)}/build/scripts/libLicenses.gant")
+setProperty("home", getHome())
+includeTargets << new File("$home/community/build/scripts/utils.gant")
+includeTargets << new File("$home/community/build/scripts/libLicenses.gant")
+includeTargets << new File("$home/build/scripts/ultimate_utils.gant")
requireProperty("buildNumber", requireProperty("build.number", snapshot))
-
-setProperty("ch", "$home")
+setProperty("buildName", "PE-$buildNumber")
+setProperty("ch", "$home/community")
setProperty("pythonCommunityHome", "$ch/python")
setProperty("pythonEduHome", "$ch/python/edu")
// load ApplicationInfo.xml properties
ant.xmlproperty(file: "$pythonEduHome/resources/idea/PyCharmEduApplicationInfo.xml", collapseAttributes: "true")
-
setProperty("system_selector", "PyCharm${p("component.version.major")}0")
setProperty("dryRun", false)
setProperty("jdk16", guessJdk())
@@ -40,6 +36,12 @@ setProperty("jdk16", guessJdk())
//modules to compile
setProperty("pluginFilter", new File("$pythonEduHome/build/plugin-list.txt").readLines())
+private String getHome(){
+ // current file is supposed to be at build/scripts/*.gant path
+ String uri = this["gant.file"]
+ return new File(new URI(uri).getSchemeSpecificPart()).getParentFile().getParentFile().getParentFile().getParentFile().getParentFile()
+}
+
private List<String> pycharmPlatformApiModules() {
return [platformApiModules, "dom-openapi"].flatten()
}
@@ -93,6 +95,10 @@ target('default': "Build artifacts") {
loadProject()
+ List resourcePaths = ["$ch/community-resources/src",
+ "$ch/platform/icons/src",
+ "$pythonEduHome/resources"]
+
projectBuilder.stage("Cleaning up sandbox folder")
projectBuilder.targetFolder = "${paths.sandbox}/classes"
@@ -126,6 +132,8 @@ target('default': "Build artifacts") {
exclude(name: "intentionDescriptions")
exclude(name: "tips/**/*")
exclude(name: "tips")
+ exclude(name: "courses")
+ exclude(name: "courses/*")
}
zipSources(home, paths.artifacts)
@@ -135,13 +143,9 @@ target('default': "Build artifacts") {
layoutEducational("${paths.sandbox}/classes/production", usedJars)
- //buildNSIS([paths.distAll, paths.distWin],
- // "${pythonEduHome}/build/strings.nsi", "${pythonEduHome}/build/paths.nsi",
- // "pycharm", false, true, ".py", system_selector)
-
- def extraArgs = ["build.code": "pycharmEDU-${buildNumber}", "build.number": "PE-$buildNumber", "artifacts.path": "${paths.artifacts}"]
- signMacZip("pycharm", extraArgs)
- buildDmg("pycharm", "${pythonEduHome}/build/DMG_background.png", extraArgs)
+ def extraArgs = ["build.code": "pycharm${buildName}", "build.number": "PE-$buildNumber", "artifacts.path": "${paths.artifacts}"]
+ signMacZip("pycharm", extraArgs + ["sitFileName": "pycharm${buildName}-jdk-bundled", "jdk_archive_name": "jdk_mac_redist_for_${buildNumber}.tar"])
+ buildDmg("pycharm", "${pythonEduHome}/build/DMG_background.png", extraArgs + ["sitFileName": "pycharm${buildName}-jdk-bundled", "jdk_archive_name": "jdk_mac_redist_for_${buildNumber}.tar"])
}
@@ -152,7 +156,7 @@ public layoutEducational(String classesPath, Set usedJars) {
usedJars = collectUsedJars(modules(), approvedJars(), ["/ant/"], null)
}
- def appInfo = appInfoFile(classesPath)
+ def appInfo = appInfoFile()
def paths = new Paths(home)
buildSearchableOptions("${projectBuilder.moduleOutput(findModule("platform-resources"))}/search", [], {
projectBuilder.moduleRuntimeClasspath(findModule("main_pycharm_edu"), false).each {
@@ -181,30 +185,42 @@ public layoutEducational(String classesPath, Set usedJars) {
def launcher = "${paths.distWin}/bin/pycharm.exe"
List resourcePaths = ["$ch/community-resources/src",
"$ch/platform/icons/src",
+ "$pythonCommunityHome/resources",
"$pythonEduHome/resources"]
- buildWinLauncher("$ch", "$ch/bin/WinLauncher/WinLauncher.exe", launcher,
+ buildWinLauncher(ch, "$ch/bin/WinLauncher/WinLauncher.exe", launcher,
appInfo, "$pythonEduHome/build/pycharm_edu_launcher.properties", system_selector, resourcePaths)
+ //signExe(launcher)
+ executeExternalAnt(["dirName": "${paths.distWin}/bin", "fileName": "pycharm.exe"], "$home/build/signBuild.xml")
- buildWinZip("${paths.artifacts}/pycharmPE-${buildNumber}.zip", [paths.distAll, paths.distWin])
+ buildWinZip("${paths.artifacts}/pycharm${buildName}.zip", [paths.distAll, paths.distWin])
- String tarRoot = isEap() ? "pycharm-edu-$buildNumber" : "pycharm-edu-${p("component.version.major")}.${p("component.version.minor")}"
- buildTarGz(tarRoot, "$paths.artifacts/pycharmPE-${buildNumber}.tar", [paths.distAll, paths.distUnix])
+ buildNSIS([paths.distAll, paths.distWin],
+ "$pythonEduHome/build/strings.nsi", "$pythonEduHome/build/paths.nsi",
+ "pycharmPE-", false, true, ".py", system_selector)
- String macAppRoot = isEap() ? "PyCharm EDU ${p("component.version.major")}.${p("component.version.minor")} EAP.app/Contents" : "PyCharm EDU.app/Contents"
- buildMacZip(macAppRoot, "${paths.artifacts}/pycharmEDU-${buildNumber}.sit", [paths.distAll], paths.distMac)
+ String tarRoot = isEap() ? "pycharm-pe-$buildNumber" : "pycharm-pe-${p("component.version.major")}.${p("component.version.minor")}"
+ buildTarGz(tarRoot, "$paths.artifacts/pycharm${buildName}.tar", [paths.distAll, paths.distUnix])
+
+ String macAppRoot = isEap() ? "PyCharm PE ${p("component.version.major")}.${p("component.version.minor")} EAP.app/Contents" : "PyCharm PE.app/Contents"
+ buildMacZip(macAppRoot, "${paths.artifacts}/pycharm${buildName}.sit", [paths.distAll], paths.distMac)
+ ant.copy(file: "${paths.artifacts}/pycharm${buildName}.sit", tofile: "${paths.artifacts}/pycharm${buildName}-jdk-bundled.sit")
+ ant.delete(file: "${paths.artifacts}/pycharm${buildName}.sit")
}
private layoutPlugins(layouts) {
dir("plugins") {
- layouts.layoutPlugin("rest")
- layouts.layoutPlugin("python-rest")
+ layouts.layoutPlugin("learn-python") {
+ dir("courses") {
+ fileset(dir: "$pythonEduHome/learn-python/resources/courses")
+ }
+ }
}
layouts.layoutCommunityPlugins(ch)
}
-private String appInfoFile(String classesPath) {
- return "$classesPath/python-educational/idea/PyCharmEduApplicationInfo.xml"
+private String appInfoFile() {
+ return "$pythonEduHome/resources/idea/PyCharmEduApplicationInfo.xml"
}
private layoutFull(Map args, String target, Set usedJars) {