python-ide-community -> python-community-ide
[idea/community.git] / python / educational-python / build / groovy / org / jetbrains / intellij / build / pycharm / edu / PyCharmEduProperties.groovy
1 package org.jetbrains.intellij.build.pycharm.edu
2
3 import org.jetbrains.intellij.build.*
4 import org.jetbrains.intellij.build.pycharm.PyCharmMacDistributionCustomizer
5 import org.jetbrains.intellij.build.pycharm.PyCharmPropertiesBase
6 import org.jetbrains.intellij.build.pycharm.PyCharmWindowsDistributionCustomizer
7
8 /**
9  * @author nik
10  */
11 class PyCharmEduProperties extends PyCharmPropertiesBase {
12   private final String pythonCommunityPath
13
14   PyCharmEduProperties(String home) {
15     pythonCommunityPath = new File(home, "community/python").exists() ? "$home/community/python" : "$home/python"
16     productCode = "PE"
17     platformPrefix = "PyCharmEdu"
18     applicationInfoModule = "educational-python"
19     brandingResourcePaths = ["$pythonCommunityPath/educational-python/resources"]
20
21     productLayout.mainModules = ["main_pycharm_edu"]
22     productLayout.platformApiModules = CommunityRepositoryModules.PLATFORM_API_MODULES + ["dom-openapi"]
23     productLayout.platformImplementationModules = CommunityRepositoryModules.PLATFORM_IMPLEMENTATION_MODULES + [
24       "dom-impl", "python-community", "python-community-ide-resources",
25       "python-community-ide", "python-community-configure", "educational-python", "python-openapi", "python-psi-api", "platform-main"
26     ]
27     productLayout.bundledPluginModules = new File("$pythonCommunityPath/educational-python/build/plugin-list.txt").readLines()
28   }
29
30   @Override
31   void copyAdditionalFiles(BuildContext context, String targetDirectory) {
32     super.copyAdditionalFiles(context, targetDirectory)
33     context.ant.copy(todir: "$targetDirectory/license") {
34       fileset(file: "$context.paths.communityHome/LICENSE.txt")
35       fileset(file: "$context.paths.communityHome/NOTICE.txt")
36     }
37   }
38
39   @Override
40   String getSystemSelector(ApplicationInfoProperties applicationInfo) {
41     "PyCharmEdu${applicationInfo.majorVersion}0"
42   }
43
44   @Override
45   String getBaseArtifactName(ApplicationInfoProperties applicationInfo, String buildNumber) {
46     "pycharmEDU-$buildNumber"
47   }
48
49   @Override
50   WindowsDistributionCustomizer createWindowsCustomizer(String projectHome) {
51     return new PyCharmWindowsDistributionCustomizer() {
52       {
53         installerImagesPath = "$pythonCommunityPath/educational-python/build/resources"
54         customNsiConfigurationFiles = [
55           "$pythonCommunityPath/educational-python/build/desktop.ini",
56           "$pythonCommunityPath/educational-python/build/customInstallActions.nsi"
57         ]
58       }
59
60       @Override
61       String getFullNameIncludingEdition(ApplicationInfoProperties applicationInfo) {
62         "PyCharm Edu"
63       }
64
65       @Override
66       void copyAdditionalFiles(BuildContext context, String targetDirectory) {
67         super.copyAdditionalFiles(context, targetDirectory)
68         context.ant.copy(file: "$context.paths.projectHome/help/pycharm-eduhelp.jar", todir: "$targetDirectory/help",
69                          failonerror: false, quiet: true)
70       }
71     }
72   }
73
74   @Override
75   LinuxDistributionCustomizer createLinuxCustomizer(String projectHome) {
76     return new LinuxDistributionCustomizer() {
77       {
78         iconPngPath = "$pythonCommunityPath/resources/PyCharmCore128.png"
79       }
80
81       @Override
82       String getRootDirectoryName(ApplicationInfoProperties applicationInfo, String buildNumber) {
83         "pycharm-edu-${applicationInfo.isEAP ? buildNumber : applicationInfo.fullVersion}"
84       }
85
86       @Override
87       void copyAdditionalFiles(BuildContext context, String targetDirectory) {
88         context.ant.copy(file: "$context.paths.projectHome/help/pycharm-eduhelp.jar", todir: "$targetDirectory/help",
89                          failonerror: false, quiet: true)
90       }
91     }
92   }
93
94   @Override
95   MacDistributionCustomizer createMacCustomizer(String projectHome) {
96     return new PyCharmMacDistributionCustomizer() {
97       {
98         icnsPath = "$pythonCommunityPath/educational-python/resources/PyCharmEdu.icns"
99         bundleIdentifier = "com.jetbrains.pycharm"
100         helpId = "PE"
101         dmgImagePath = "$pythonCommunityPath/educational-python/build/DMG_background.png"
102       }
103     }
104   }
105
106   @Override
107   String getOutputDirectoryName(ApplicationInfoProperties applicationInfo) {
108     "pycharm-edu"
109   }
110 }