From 35a345e8c9947536669e3f1494f7b136e8860281 Mon Sep 17 00:00:00 2001 From: nik Date: Tue, 14 Jul 2015 11:28:42 +0300 Subject: [PATCH] move product specific properties out of build script to allow reusing build script for Android Studio --- .idea/modules.xml | 1 + build.xml | 44 ++++++++++- build/build.iml | 1 + build/gant.xml | 1 + build/groovy/ProductProperties.groovy | 73 +++++++++++++++++ build/scripts/buildScripts.gdsl | 24 ++++++ build/scripts/dist.gant | 109 ++++++++++++++++++-------- build/scripts/idea_properties.gant | 55 +++++++++++++ build/scripts/layouts.gant | 92 +++++++++++++++++++--- build/scripts/utils.gant | 38 +++++---- 10 files changed, 377 insertions(+), 61 deletions(-) create mode 100644 build/groovy/ProductProperties.groovy create mode 100644 build/scripts/buildScripts.gdsl create mode 100644 build/scripts/idea_properties.gant diff --git a/.idea/modules.xml b/.idea/modules.xml index a2da314e8ff2..f44ef2057e15 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -236,6 +236,7 @@ + diff --git a/build.xml b/build.xml index d4cd47e2fe3a..ab62c1eb1932 100644 --- a/build.xml +++ b/build.xml @@ -1,7 +1,31 @@ + - - + + + + + + + + + + + + + + + + + + @@ -18,6 +42,11 @@ + + + + + @@ -36,5 +65,16 @@ + + + + + + + + + + + diff --git a/build/build.iml b/build/build.iml index 6b8f9e05f014..cf1c56ee4aad 100644 --- a/build/build.iml +++ b/build/build.iml @@ -5,6 +5,7 @@ + diff --git a/build/gant.xml b/build/gant.xml index 8a7460997353..945df2558386 100644 --- a/build/gant.xml +++ b/build/gant.xml @@ -17,6 +17,7 @@ + diff --git a/build/groovy/ProductProperties.groovy b/build/groovy/ProductProperties.groovy new file mode 100644 index 000000000000..837061832536 --- /dev/null +++ b/build/groovy/ProductProperties.groovy @@ -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 excludedPlugins = [] + List extraMacBins = [] + List extraLinuxBins = [] + + def customLayout(targetDirectory) {} + + def customWinLayout(targetDirectory) {} + + def customLinLayout(targetDirectory) {} + + def customMacLayout(targetDirectory) {} + + String icon128 + String ico + String icns +} diff --git a/build/scripts/buildScripts.gdsl b/build/scripts/buildScripts.gdsl new file mode 100644 index 000000000000..a8d3dbf57a2f --- /dev/null +++ b/build/scripts/buildScripts.gdsl @@ -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" +}) diff --git a/build/scripts/dist.gant b/build/scripts/dist.gant index dfe40cd92382..549e21090bda 100644 --- a/build/scripts/dist.gant +++ b/build/scripts/dist.gant @@ -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 = """ CFBundleTypeExtensions @@ -209,7 +248,7 @@ private layoutMac(Map _args, String home, Paths paths) { ipr CFBundleTypeIconFile - idea.icns + ${prefix}.icns CFBundleTypeName IntelliJ IDEA Project File CFBundleTypeRole @@ -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) } diff --git a/build/scripts/idea_properties.gant b/build/scripts/idea_properties.gant new file mode 100644 index 000000000000..76d3760f9474 --- /dev/null +++ b/build/scripts/idea_properties.gant @@ -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" } + } +} \ No newline at end of file diff --git a/build/scripts/layouts.gant b/build/scripts/layouts.gant index 0017ae51f8b0..29e97324a827 100644 --- a/build/scripts/layouts.gant +++ b/build/scripts/layouts.gant @@ -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 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") } } } diff --git a/build/scripts/utils.gant b/build/scripts/utils.gant index 474b7c2a7e92..98059b162b4b 100644 --- a/build/scripts/utils.gant +++ b/build/scripts/utils.gant @@ -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();