move product specific properties out of build script to allow reusing build script for Android Studio

This commit is contained in:
nik
2015-07-14 11:29:13 +03:00
parent b0c15ec18b
commit 35a345e8c9
10 changed files with 377 additions and 61 deletions
+1
View File
@@ -236,6 +236,7 @@
<module fileurl="file://$PROJECT_DIR$/plugins/ui-designer/ui-designer.iml" filepath="$PROJECT_DIR$/plugins/ui-designer/ui-designer.iml" group="plugins" />
<module fileurl="file://$PROJECT_DIR$/plugins/ui-designer-core/ui-designer-core.iml" filepath="$PROJECT_DIR$/plugins/ui-designer-core/ui-designer-core.iml" group="plugins" />
<module fileurl="file://$PROJECT_DIR$/plugins/ui-designer/jps-plugin/ui-designer-jps-plugin.iml" filepath="$PROJECT_DIR$/plugins/ui-designer/jps-plugin/ui-designer-jps-plugin.iml" group="plugins" />
<module fileurl="file://$PROJECT_DIR$/updater/updater.iml" filepath="$PROJECT_DIR$/updater/updater.iml" group="platform" />
<module fileurl="file://$PROJECT_DIR$/platform/usageView/usageView.iml" filepath="$PROJECT_DIR$/platform/usageView/usageView.iml" group="platform" />
<module fileurl="file://$PROJECT_DIR$/platform/util/util.iml" filepath="$PROJECT_DIR$/platform/util/util.iml" group="platform" />
<module fileurl="file://$PROJECT_DIR$/platform/util-rt/util-rt.iml" filepath="$PROJECT_DIR$/platform/util-rt/util-rt.iml" group="platform" />
+42 -2
View File
@@ -1,7 +1,31 @@
<!--
This build script compiles IntelliJ IDEA. Options include:
-Dout=/path/to/out/dir, defaults to ${basedir}/out
-Dbuild=123, defaults to SNAPSHOT
-Dtestpatterns=com.foo.*, defaults to empty string
-Dproduct=foo, defaults to idea
-->
<project name="IntelliJ IDEA Community Edition" default="all">
<property name="project.home" value="${basedir}"/>
<property name="out.dir" value="${project.home}/out"/>
<property name="tmp.dir" value="${project.home}/out/tmp"/>
<condition property="out.dir" value="${out}" else="${project.home}/out">
<isset property="out" />
</condition>
<condition property="build.number" value="${build}" else="SNAPSHOT">
<isset property="build" />
</condition>
<condition property="test.patterns" value="${testpatterns}"
else="org.jetbrains.android.*;com.android.tools.idea.*;com.google.gct.*;com.intellij.android.*">
<isset property="testpatterns" />
</condition>
<condition property="product.name" value="${product}" else="idea">
<isset property="product" />
</condition>
<property name="tmp.dir" value="${out.dir}/tmp"/>
<target name="cleanup">
<delete dir="${out.dir}" failonerror="false"/>
@@ -18,6 +42,11 @@
<sequential>
<java failonerror="true" jar="${project.home}/lib/ant/lib/ant-launcher.jar" fork="true">
<jvmarg line="-Xmx612m -XX:MaxPermSize=152m"/>
<jvmarg value="-Djna.nosys=true" />
<jvmarg value="-Dout=${out.dir}" />
<jvmarg value="-DbuildNumber=${build.number}" />
<jvmarg value="-Didea.test.patterns=${test.patterns}" />
<jvmarg value="-Dproduct=${product.name}" />
<sysproperty key="java.awt.headless" value="true"/>
<arg line="&quot;-Dgant.script=@{script}&quot;"/>
<arg line="&quot;-Dteamcity.build.tempDir=${tmp.dir}&quot;"/>
@@ -36,5 +65,16 @@
<call_gant script="${project.home}/build/scripts/tests.gant"/>
</target>
<!-- The build task creates an updater.jar in ${out.dir}. This task bundles the updater and its dependencies into a single jar -->
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="${project.home}/build/lib/jarjar-1.0.jar"/>
<target name="fullupdater" depends="build">
<jarjar jarfile="${out.dir}/updater-full.jar">
<zipfileset src="${out.dir}/updater.jar" />
<zipfileset src="lib/log4j.jar" />
<zipfileset src="lib/jna.jar" />
<zipfileset src="lib/jna-utils.jar" />
</jarjar>
</target>
<target name="all" depends="cleanup,build"/>
</project>
+1
View File
@@ -5,6 +5,7 @@
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/scripts" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/groovy" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/jdk" />
<excludeFolder url="file://$MODULE_DIR$/restApiDocGenerator/node_modules" />
</content>
+1
View File
@@ -17,6 +17,7 @@
<fileset dir="${project.home}/build/lib/jps">
<include name="*.jar"/>
</fileset>
<pathelement path="${project.home}/build/groovy"/>
<fileset file="${project.home}/jps/lib/optimizedFileManager.jar"/>
<fileset dir="${project.home}/build/kotlinc/jps" erroronmissingdir="false">
<include name="*.jar"/>
+73
View File
@@ -0,0 +1,73 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @author nik
*/
public abstract class ProductProperties {
String prefix
String code
String appInfoModule
String appInfoModulePath
abstract def String appInfoFile()
/**
* @return build number with produce code (e.g. IC-142.239 for IDEA Community)
*/
abstract def String fullBuildNumber()
abstract def String systemSelector()
String exe_selector = null
String exe_launcher_properties
String exe64_launcher_properties
String platformPrefix = null
String bundleIdentifier
abstract def String macAppRoot()
abstract def String winAppRoot()
abstract def String linuxAppRoot()
abstract def String archiveName()
String ideJvmArgs = null
boolean maySkipAndroidPlugin
String relativeAndroidHome
String relativeAndroidToolsBaseHome
boolean includeYourkitAgentInEAP = false
boolean includeBatchLauncher = true
boolean buildUpdater = false
List<String> excludedPlugins = []
List<String> extraMacBins = []
List<String> extraLinuxBins = []
def customLayout(targetDirectory) {}
def customWinLayout(targetDirectory) {}
def customLinLayout(targetDirectory) {}
def customMacLayout(targetDirectory) {}
String icon128
String ico
String icns
}
+24
View File
@@ -0,0 +1,24 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @author nik
*/
def ctx = context(scope: scriptScope(), filetypes: ["gant"])
contributor([ctx], {
property name: "productProperties", type: "ProductProperties"
})
+77 -32
View File
@@ -16,6 +16,7 @@
import com.intellij.openapi.util.text.StringUtil
import org.apache.tools.ant.BuildException
import org.jetbrains.jps.gant.LayoutInfo
import static org.jetbrains.jps.idea.IdeaProjectLoader.guessHome
@@ -24,6 +25,11 @@ includeTargets << new File("${guessHome(this)}/build/scripts/utils.gant")
requireProperty("out", "$home/out")
// "out" has to be canonical, otherwise the ant build fails
// with mysterious errors
out = new File(out).getCanonicalPath()
setProperty("out", out)
class Paths {
final sandbox
final distWin
@@ -52,14 +58,23 @@ class Paths {
def paths = new Paths(out)
setProperty("paths", paths)
loadProductProperties(home, snapshot)
setProperty("maySkipAndroidPlugin", true)
def loadProductProperties(String home, String buildNumber) {
requireProperty("product", "idea")
def productPropertiesPath = "$home/build/scripts/" + p("product") + "_properties.gant"
if (!new File(productPropertiesPath).exists()) {
throw new BuildException("No product specific properties file found at: " + productPropertiesPath)
}
setProperty("productProperties", includeFile(productPropertiesPath).getProperties(home, buildNumber))
}
target(compile: "Compile project") {
loadProject()
projectBuilder.stage("Cleaning up sandbox folder")
forceDelete(paths.sandbox)
loadProject()
[paths.sandbox, paths.distWin, paths.distAll, paths.distUnix, paths.distMac, paths.artifacts, paths.artifacts_core, paths.artifacts_jps].each {
ant.mkdir(dir: it)
}
@@ -72,7 +87,7 @@ target(compile: "Compile project") {
}
private String appInfoFile() {
return "${projectBuilder.moduleOutput(findModule("community-resources"))}/idea/IdeaApplicationInfo.xml"
return productProperties.appInfoFile()
}
target('default': 'The default target') {
@@ -85,12 +100,20 @@ target('default': 'The default target') {
indexSearchableOptions()
layoutAll([buildNumber: "IC-$snapshot",
system_selector: "IdeaIC${p("component.version.major")}",
layoutAll([buildNumber: productProperties.fullBuildNumber(),
system_selector: productProperties.systemSelector(),
platform_prefix: productProperties.platformPrefix,
ide_jvm_args: productProperties.ideJvmArgs,
tools_jar: true],
home, null, paths, true)
String macZip = "$paths.artifacts/ideaIC-${snapshot}.mac.zip"
String archiveName = productProperties.archiveName()
String macZip = "$paths.artifacts/${archiveName}.mac.zip"
notifyArtifactBuilt(macZip)
if (productProperties.buildUpdater) {
// Generate updater.jar from the updater module (patch updater)
layoutUpdater(out)
}
}
target('build-dist-jars' : 'Target to build jars from locally compiled classes') {
@@ -101,11 +124,14 @@ target('build-dist-jars' : 'Target to build jars from locally compiled classes')
indexSearchableOptions()
layoutAll([buildNumber: "IC-$snapshot",
system_selector: "IdeaIC${p("component.version.major")}",
layoutAll([buildNumber: productProperties.fullBuildNumber(),
system_selector: productProperties.systemSelector(),
platform_prefix: productProperties.platformPrefix,
ide_jvm_args: productProperties.ideJvmArgs,
tools_jar: true],
home, null, paths)
String macZip = "$paths.artifacts/ideaIC-${snapshot}.mac.zip"
String macZipPrefix = productProperties.prefix + productProperties.fullBuildNumber()
String macZip = "$paths.artifacts/${macZipPrefix}.mac.zip"
notifyArtifactBuilt(macZip)
}
@@ -158,21 +184,24 @@ def layoutAll(Map args, String home, String out, Paths _paths = null, buildJps =
layoutWin(args, home, paths)
layoutMac(args, home, paths)
layoutUnix(args, home, paths)
def macAppRoot = productProperties.macAppRoot()
def winAppRoot = productProperties.winAppRoot()
def linuxAppRoot = productProperties.linuxAppRoot()
def archiveName = productProperties.archiveName()
List pathsDist = new File("${paths.sandbox}/bundled.win.jdk/jre").exists() ? [paths.distAll, paths.distWin, "${paths.sandbox}/bundled.win.jdk"] : [paths.distAll, paths.distWin]
buildWinZip("$paths.artifacts/idea${args.buildNumber}.win.zip", pathsDist)
buildWinZip("$paths.artifacts/${archiveName}.win.zip", pathsDist, winAppRoot)
buildCrossPlatformZip("$paths.artifacts/idea${args.buildNumber}.zip", "${paths.sandbox}/sandbox-ce", [paths.distAll],
paths.distWin, paths.distUnix, paths.distMac)
def macAppRoot = isEap() ?
"IntelliJ IDEA ${p("component.version.major")} CE EAP.app/Contents" :
"IntelliJ IDEA ${p("component.version.major")} CE.app/Contents"
String macZip = "$paths.artifacts/${archiveName}.mac.zip"
buildMacZip(macAppRoot, macZip, [paths.distAll], paths.distMac, productProperties.extraMacBins)
String macZip = "$paths.artifacts/idea${args.buildNumber}.mac.zip"
buildMacZip(macAppRoot, macZip, [paths.distAll], paths.distMac)
buildTarGz("idea-${args.buildNumber}", "$paths.artifacts/idea${args.buildNumber}.tar", [paths.distAll, paths.distUnix])
buildTarGz(linuxAppRoot, "$paths.artifacts/${archiveName}.tar", [paths.distAll, paths.distUnix], productProperties.extraLinuxBins)
if (p("jdk.bundled.linux") != "false") {
buildTarGz("idea-${args.buildNumber}", "$paths.artifacts/idea${args.buildNumber}-jdk-bundled.tar", [paths.distAll, paths.distUnix, "${paths.sandbox}/bundled.linux.jdk"], ["jre/jre/bin/*"])
buildTarGz(linuxAppRoot, "$paths.artifacts/${archiveName}-jdk-bundled.tar", [paths.distAll, paths.distUnix, "${paths.sandbox}/bundled.linux.jdk"], ["jre/jre/bin/*"] + productProperties.extraLinuxBins)
}
return info
}
@@ -186,22 +215,32 @@ private layoutWin(Map args, String home, Paths paths) {
}
}
ant.copy(file: "$home/platform/icons/src/idea_CE.ico", tofile: "$target/bin/idea.ico")
def name = productProperties.prefix
def ico = productProperties.ico
winScripts(target, home, "idea.bat", args)
winVMOptions(target, null, "idea.exe", "idea64.exe")
List resourcePaths = ["$home/community-resources/src", "$home/platform/icons/src"]
buildWinLauncher(home, "$home/bin/WinLauncher/WinLauncher.exe", "$target/bin/idea.exe", appInfoFile(),
"$home/build/conf/ideaCE-launcher.properties", args.ce_exe_selector, resourcePaths)
buildWinLauncher(home, "$home/bin/WinLauncher/WinLauncher64.exe", "$target/bin/idea64.exe", appInfoFile(),
"$home/build/conf/ideaCE64-launcher.properties", args.ce_exe_selector, resourcePaths)
ant.copy(file: ico, tofile: "$target/bin/${name}.ico")
if (productProperties.includeBatchLauncher) {
winScripts(target, home, "${name}.bat", args)
}
winVMOptions(target, productProperties.includeYourkitAgentInEAP ? args.system_selector : null, "${name}.exe", "${name}64.exe")
def appInfoModulePath = productProperties.appInfoModulePath
List resourcePaths = ["$home/${appInfoModulePath}/src", "$home/platform/icons/src"]
buildWinLauncher(home, "$home/bin/WinLauncher/WinLauncher.exe", "$target/bin/${name}.exe", appInfoFile(),
productProperties.exe_launcher_properties, productProperties.exe_selector, resourcePaths)
buildWinLauncher(home, "$home/bin/WinLauncher/WinLauncher64.exe", "$target/bin/${name}64.exe", appInfoFile(),
productProperties.exe64_launcher_properties, productProperties.exe_selector, resourcePaths)
productProperties.customWinLayout(target)
}
private layoutMac(Map _args, String home, Paths paths) {
String target = paths.distMac
def prefix = productProperties.prefix
Map args = new HashMap(_args)
args.bundleIdentifier = "com.jetbrains.intellij.ce"
args.bundleIdentifier = productProperties.bundleIdentifier
args.doc_types = """
<dict>
<key>CFBundleTypeExtensions</key>
@@ -209,7 +248,7 @@ private layoutMac(Map _args, String home, Paths paths) {
<string>ipr</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>idea.icns</string>
<string>${prefix}.icns</string>
<key>CFBundleTypeName</key>
<string>IntelliJ IDEA Project File</string>
<key>CFBundleTypeRole</key>
@@ -219,8 +258,10 @@ private layoutMac(Map _args, String home, Paths paths) {
args."idea.properties.path" = "${paths.distAll}/bin/idea.properties"
args.urlSchemes = ["idea"]
args.mac_no_yjp = true
args.executable = "idea"
args.executable = prefix
args.icns = productProperties.icns
layoutMacApp(target, home, args)
productProperties.customMacLayout(target)
}
private layoutUnix(Map args, String home, Paths paths) {
@@ -232,9 +273,13 @@ private layoutUnix(Map args, String home, Paths paths) {
}
}
ant.copy(file: "$home/platform/icons/src/icon_CE_128.png", tofile: "$target/bin/idea.png")
def name = productProperties.prefix
def icon128 = productProperties.icon128
unixScripts(target, home, "idea.sh", args)
unixVMOptions(target, "idea")
ant.copy(file: icon128, tofile: "$target/bin/${name}.png")
unixScripts(target, home, "${name}.sh", args)
unixVMOptions(target, "${name}")
unixReadme(target, home, args)
productProperties.customLinLayout(target)
}
+55
View File
@@ -0,0 +1,55 @@
/*
* Copyright (C) 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
def getProperties(String home, String buildNumber) {
return new ProductProperties() {
{
prefix = "idea"
code = "IC"
appInfoModule = "community-resources"
appInfoModulePath = "community-resources"
exe_launcher_properties = "$home/build/conf/ideaCE-launcher.properties"
exe64_launcher_properties = "$home/build/conf/ideaCE64-launcher.properties"
bundleIdentifier = "com.jetbrains.intellij.ce"
maySkipAndroidPlugin = true
relativeAndroidHome = "android"
relativeAndroidToolsBaseHome = "android/tools-base"
icon128 = "$home/platform/icons/src/icon_CE_128.png"
ico = "$home/platform/icons/src/idea_CE.ico"
}
def String appInfoFile() {
"${projectBuilder.moduleOutput(findModule("community-resources"))}/idea/IdeaApplicationInfo.xml"
}
def String fullBuildNumber() { "IC-$buildNumber" }
def String systemSelector() { "IdeaIC${p("component.version.major")}" }
def String macAppRoot() {
isEap() ? "IntelliJ IDEA ${p("component.version.major")} CE EAP.app/Contents"
: "IntelliJ IDEA ${p("component.version.major")} CE.app/Contents"
}
def String winAppRoot() { "" }
def String linuxAppRoot() { "idea-IC-$buildNumber" }
def String archiveName() { "ideaIC-$buildNumber" }
}
}
+79 -13
View File
@@ -27,7 +27,38 @@ target('default': "Developers update") {
}
String appInfoFileName() {
return "idea/IdeaApplicationInfo.xml"
return isDefined("productProperties") ? productProperties.appInfoFile() : "idea/IdeaApplicationInfo.xml"
}
boolean maySkipAndroidPlugin() {
return isDefined("productProperties") && productProperties.maySkipAndroidPlugin
}
String appInfoModule() {
return isDefined("productProperties") ? productProperties.appInfoModule : "community-resources"
}
String productCode() {
return isDefined("productProperties") ? productProperties.code : "IC"
}
void customLayout(String targetDirectory) {
if (isDefined("productProperties")) {
productProperties.customLayout(targetDirectory)
}
}
String relativeAndroidHome() {
return isDefined("productProperties") ? productProperties.relativeAndroidHome : "android"
}
String relativeAndroidToolsBaseHome() {
return isDefined("productProperties") ? productProperties.relativeAndroidToolsBaseHome : relativeAndroidHome() + "/tools-base"
}
List<String> getExcludedPlugins() {
return isDefined("productProperties") ? productProperties.excludedPlugins : []
}
String patchAppDescriptor(String targetDirectory) {
@@ -36,12 +67,13 @@ String patchAppDescriptor(String targetDirectory) {
ant.delete(dir: patchedDirectory)
layout(patchedDirectory) {
module("community-resources") {
module(appInfoModule()) {
include(name: appInfoFileName())
}
}
ant.replace(file: "$patchedDirectory/${appInfoFileName()}", token: "__BUILD_NUMBER__", value: "IC-$snapshot")
def code = productCode()
ant.replace(file: "$patchedDirectory/${appInfoFileName()}", token: "__BUILD_NUMBER__", value: "${code}-$snapshot")
ant.replace(file: "$patchedDirectory/${appInfoFileName()}", token: "__BUILD_DATE__", value: new Date().format("yyyyMMddHHmm"))
return patchedDirectory
@@ -159,9 +191,22 @@ def layoutFull(String home, String targetDirectory, String patchedDescriptorDir
module("colorSchemes")
module("resources")
module("platform-resources")
module("community-resources") {
if (patchedDescriptorDir != null) {
exclude(name: appInfoFileName())
def appInfoModule = appInfoModule()
def appInfoInCommunity = "community-resources".equals(appInfoModule)
if (appInfoInCommunity) {
module("community-resources") {
if (patchedDescriptorDir != null) {
exclude(name: appInfoFileName())
}
}
} else {
module("community-resources")
module(appInfoModule) {
if (patchedDescriptorDir != null) {
exclude(name: appInfoFileName())
}
}
}
if (patchedDescriptorDir != null) {
@@ -230,7 +275,7 @@ def layoutFull(String home, String targetDirectory, String patchedDescriptorDir
}
}
layoutCommunityPlugins(home)
layoutCommunityPlugins(home, maySkipAndroidPlugin())
dir("plugins") {
dir("javaFX") {
@@ -268,18 +313,29 @@ def layoutFull(String home, String targetDirectory, String patchedDescriptorDir
}
}
// product specific custom layout
customLayout(targetDirectory)
printUnusedModules(info.usedModules)
reorder(home, targetDirectory)
return info
}
public def layoutCommunityPlugins(String home) {
if (!isDefined("maySkipAndroidPlugin") || new File("$home/android").exists()) {
layoutAndroid("$home/android")
public def layoutCommunityPlugins(String home, boolean maySkipAndroidPlugin = false) {
def androidHome = relativeAndroidHome()
def androidToolsBaseHome = relativeAndroidToolsBaseHome()
if (new File("$home/$androidHome").exists()) {
layoutAndroid("$home/$androidHome", "$home/$androidToolsBaseHome")
}
else {
projectBuilder.warning("Android plugin sources aren't found at $home/android. Android plugin is excluded from layout.")
def message = "Android plugin sources aren't found at ${androidHome}"
if (maySkipAndroidPlugin) {
projectBuilder.warning("$message. Android plugin is excluded from layout.")
}
else {
projectBuilder.error(message)
}
}
dir("plugins") {
@@ -635,6 +691,11 @@ def layoutPlugin(String pluginName, String moduleName, String jarName, Closure c
if (!pluginFilter.contains(moduleName) && !pluginFilter.contains(pluginName)) return
}
def excludedPlugins = getExcludedPlugins()
if (excludedPlugins.contains(moduleName) || excludedPlugins.contains(pluginName)) {
return
}
dir(pluginName) {
dir("lib") {
jar("${jarName}.jar") {
@@ -652,6 +713,11 @@ def pluginDir(String dirName, Closure initializer) {
if (!pluginFilter.contains(dirName)) return
}
def excludedPlugins = getExcludedPlugins()
if (excludedPlugins.contains(dirName)) {
return
}
dir(dirName) {
initializer()
}
@@ -712,7 +778,7 @@ def reorder(String home, String targetDirectory) {
}
}
def layoutAndroid(String androidHome) {
def layoutAndroid(String androidHome, String androidToolsBaseHome) {
dir("plugins") {
layoutPlugin("android") {
fileset(dir: "${androidHome}/android/lib") {
@@ -768,7 +834,7 @@ def layoutAndroid(String androidHome) {
jar("android-jps-plugin.jar") { module("android-jps-plugin") }
}
dir("templates") {
fileset(dir: "$androidHome/tools-base/templates")
fileset(dir: "$androidToolsBaseHome/templates")
}
}
}
+24 -14
View File
@@ -14,8 +14,6 @@
* limitations under the License.
*/
import com.intellij.openapi.util.SystemInfo
import com.intellij.openapi.util.io.FileUtil
import org.jetbrains.jps.gant.JpsGantTool
@@ -80,14 +78,14 @@ binding.setVariable("vmOptions", { "$common_vmoptions".trim() })
binding.setVariable("vmOptions32", { "$mem32 ${vmOptions()}".trim() })
binding.setVariable("vmOptions64", { "$mem64 ${vmOptions()}".trim() })
binding.setVariable("yjpOptions", { String systemSelector, String platformSuffix = "" ->
"-agentlib:yjpagent$platformSuffix=probe_disable=*,disablealloc,disabletracing,onlylocal,disableexceptiontelemetry,delay=10000,sessionname=$systemSelector".trim()
binding.setVariable("yjpOptions", { String sessionName, String platformSuffix = "" ->
"-agentlib:yjpagent$platformSuffix=probe_disable=*,disablealloc,disabletracing,onlylocal,disableexceptiontelemetry,delay=10000,sessionname=$sessionName".trim()
})
binding.setVariable("vmOptions32yjp", { String systemSelector ->
"${vmOptions32()} ${yjpOptions(systemSelector)}".trim()
binding.setVariable("vmOptions32yjp", { String sessionName ->
"${vmOptions32()} ${yjpOptions(sessionName)}".trim()
})
binding.setVariable("vmOptions64yjp", { String systemSelector ->
"${vmOptions64()} ${yjpOptions(systemSelector, "64")}".trim()
binding.setVariable("vmOptions64yjp", { String sessionName ->
"${vmOptions64()} ${yjpOptions(sessionName, "64")}".trim()
})
binding.setVariable("isDefined", {String key ->
@@ -329,7 +327,8 @@ binding.setVariable("copyAndPatchFiles", { Closure files, String target, Map arg
binding.setVariable("wireBuildDate", { String buildNumber, String appInfoFile ->
ant.tstamp()
patchFiles([appInfoFile], ["BUILD_NUMBER": buildNumber, "BUILD_DATE": DSTAMP])
patchFiles([appInfoFile], ["BUILD_NUMBER": buildNumber, "BUILD_DATE": DSTAMP,
"PACKAGE_CODE": buildNumber.substring(0, buildNumber.indexOf('-'))])
})
binding.setVariable("commonJvmArgsForTests", {
@@ -521,6 +520,9 @@ binding.setVariable("layoutMacApp", { String path, String ch, Map args ->
replacefilter(token: "@@product_state@@", value: EAP)
replacefilter(token: "@@bundle_identifier@@", value: args.bundleIdentifier)
replacefilter(token: "@@year@@", value: "$todayYear")
replacefilter(token: "@@company_name@@", value: p("component.company.name"))
replacefilter(token: "@@min_year@@", value: "2000")
replacefilter(token: "@@max_year@@", value: "$todayYear")
replacefilter(token: "@@version@@", value: version)
replacefilter(token: "@@vmoptions@@", value: vmOptions)
replacefilter(token: "@@idea_properties@@", value: coreProperties)
@@ -622,14 +624,14 @@ binding.setVariable("unixScripts", { String target, String home, String name, Ma
ant.fixcrlf(srcdir: "$target/bin", includes: "*.sh", eol: "unix")
})
binding.setVariable("winVMOptions", { String target, String system_selector, String name, String name64 = null ->
binding.setVariable("winVMOptions", { String target, String yjpSessionName, String name, String name64 = null ->
if (name != null) {
def options = isEap() && system_selector != null ? vmOptions32yjp(system_selector) : vmOptions32()
def options = isEap() && yjpSessionName != null ? vmOptions32yjp(yjpSessionName) : vmOptions32()
ant.echo(file: "$target/bin/${name}.vmoptions", message: options.replace(' ', '\n'))
}
if (name64 != null) {
def options = isEap() && system_selector != null ? vmOptions64yjp(system_selector) : vmOptions64()
def options = isEap() && yjpSessionName != null ? vmOptions64yjp(yjpSessionName) : vmOptions64()
ant.echo(file: "$target/bin/${name64}.vmoptions", message: options.replace(' ', '\n'))
}
@@ -875,14 +877,14 @@ binding.setVariable("getPathToBundledJDK", { File jdkDir, String prefix, String
return JdkFileName.replace('\\', '/')
})
binding.setVariable("buildWinZip", { String zipPath, List paths ->
binding.setVariable("buildWinZip", { String zipPath, List paths, String zipPrefix = "" ->
projectBuilder.stage(".win.zip")
fixIdeaPropertiesEol(paths, "dos")
ant.zip(zipfile: zipPath) {
paths.each {
fileset(dir: it)
zipfileset(dir: it, prefix: zipPrefix)
}
}
@@ -1103,6 +1105,14 @@ binding.setVariable("buildWinLauncher", { String ch, String inputPath, String ou
}
})
binding.setVariable("layoutUpdater", { String target, String jarName = "updater.jar" ->
layout(target) {
jar(jarName) {
module("updater")
}
}
})
binding.setVariable("collectUsedJars", { List modules, List approvedJars, List forbiddenJars, List modulesToBuild ->
def usedJars = new HashSet();