diff options
Diffstat (limited to 'build/scripts/dist.gant')
-rw-r--r-- | build/scripts/dist.gant | 101 |
1 files changed, 74 insertions, 27 deletions
diff --git a/build/scripts/dist.gant b/build/scripts/dist.gant index a79fb54395d0..a31b66f5a654 100644 --- a/build/scripts/dist.gant +++ b/build/scripts/dist.gant @@ -19,6 +19,12 @@ import static org.jetbrains.jps.idea.IdeaProjectLoader.guessHome includeTargets << new File("${guessHome(this)}/build/scripts/utils.gant") requireProperty("out", "$home/out") +requireProperty("buildNumber", "SNAPSHOT") + +// "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 @@ -62,7 +68,7 @@ target(compile: "Compile project") { } private String appInfoFile() { - return "${projectBuilder.moduleOutput(findModule("community-resources"))}/idea/IdeaApplicationInfo.xml" + return "${projectBuilder.moduleOutput(findModule("adt-branding"))}/idea/AndroidStudioApplicationInfo.xml" } target('default': 'The default target') { @@ -73,10 +79,17 @@ target('default': 'The default target') { zipSources(home, paths.artifacts) - layoutAll([buildNumber: "IC-$snapshot", - system_selector: "IdeaIC${p("component.version.major")}", + layoutAll([buildNumber: "AI-$snapshot".replaceAll("SNAPSHOT", p("buildNumber")), + system_selector: "AndroidStudioPreview", + platform_prefix: "AndroidStudio", + icns: "${projectBuilder.moduleOutput(findModule("adt-branding"))}/artwork/AndroidStudio.icns", + ide_jvm_args: "-Didea.platform.prefix=AndroidStudio", tools_jar: true], home, null, paths, true) + + // Generate updater.jar from the updater module (patch updater) + projectBuilder.stage("Generating updater in $out") + layoutUpdater(out) } target('build-dist-jars' : 'Target to build jars from locally compiled classes') { @@ -84,7 +97,7 @@ target('build-dist-jars' : 'Target to build jars from locally compiled classes') // load ApplicationInfo.xml properties ant.xmlproperty(file: appInfoFile(), collapseAttributes: "true") - layoutAll([buildNumber: "IC-$snapshot", + layoutAll([buildNumber: "AI-$snapshot".replaceAll("SNAPSHOT", p("buildNumber")), system_selector: "IdeaIC${p("component.version.major")}", tools_jar: true], home, null, paths) @@ -93,6 +106,8 @@ target('build-dist-jars' : 'Target to build jars from locally compiled classes') def layoutAll(Map args, String home, String out, Paths _paths = null, buildJps = false) { Paths paths = _paths != null ? _paths : new Paths(out) + args.companyName = p("component.company.name") + wireBuildDate(args.buildNumber, appInfoFile()) ant.echo(message: args.buildNumber, file: "$paths.distAll/build.txt") @@ -123,44 +138,63 @@ def layoutAll(Map args, String home, String out, Paths _paths = null, buildJps = layoutMac(args, home, paths) layoutUnix(args, home, paths) - buildWinZip("$paths.artifacts/idea${args.buildNumber}.win.zip", [paths.distAll, paths.distWin]) + def winAppRoot = "android-studio" + def macAppRoot = "Android Studio.app" + def linTarRoot = "android-studio" - def macAppRoot = isEap() ? - "IntelliJ IDEA ${p("component.version.major")} CE EAP.app/Contents" : - "IntelliJ IDEA ${p("component.version.major")} CE.app/Contents" + androidBuildNumber = p("buildNumber") + //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/idea${args.buildNumber}.mac.zip" - buildMacZip(macAppRoot, macZip, [paths.distAll], paths.distMac) - notifyArtifactBuilt(macZip) + def winZip = "$paths.artifacts/android-studio-${androidBuildNumber}.win.zip" + def macZip = "$paths.artifacts/android-studio-${androidBuildNumber}.mac.zip" + def linTar = "$paths.artifacts/android-studio-${androidBuildNumber}.tar" - buildTarGz("idea-${args.buildNumber}", "$paths.artifacts/idea${args.buildNumber}.tar", [paths.distAll, paths.distUnix]) + buildWinZip(winAppRoot, winZip, [paths.distAll, paths.distWin]) + buildTarGz(linTarRoot, linTar, [paths.distAll, paths.distUnix]) + buildMacZip(macAppRoot, macZip, [paths.distAll], paths.distMac) } -private layoutWin(Map args, String home, Paths paths) { +private layoutWin(Map _args, String home, Paths paths) { String target = paths.distWin + Map args = new HashMap(_args) + args.product_uc = "ANDROID_STUDIO" + args.vm_options = "studio.exe" + layout(target) { dir("bin") { fileset(dir: "$home/bin/win") } } - ant.copy(file: "$home/platform/icons/src/idea_CE.ico", tofile: "$target/bin/idea.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: "$home/../adt/idea/adt-branding/src/artwork/androidstudio.ico", tofile: "$target/bin/idea.ico") + + // The 0.1.1 win launcher. + ant.copy( file: "$home/../adt/idea/native/WinLauncher/out/Release-Win32/studio.exe", + tofile: "$target/bin/studio.exe") + ant.copy( file: "$home/../adt/idea/native/WinLauncher/out/Release-Win32/studio.exe.manifest", + tofile: "$target/bin/studio.exe.manifest") + ant.copy( file: "$home/../adt/idea/native/WinLauncher/out/Release-x64/studio64.exe", + tofile: "$target/bin/studio64.exe") + ant.copy( file: "$home/../adt/idea/native/WinLauncher/out/Release-x64/studio64.exe.manifest", + tofile: "$target/bin/studio64.exe.manifest") + // Manual updater script + ant.copy( file: "$home/../adt/idea/native/update_studio.bat", + tofile: "$target/bin/update_studio.bat") + + winScripts(target, home, "studio.bat", args) + winVMOptions(target, args, "studio.exe", "studio64.exe") } private layoutMac(Map _args, String home, Paths paths) { String target = paths.distMac Map args = new HashMap(_args) - args.bundleIdentifier = "com.jetbrains.intellij.ce" + args.bundleIdentifier = "com.google.android.studio" + args.executable = "studio" + args.help_id = "AI" args.doc_types = """ <dict> <key>CFBundleTypeExtensions</key> @@ -178,21 +212,34 @@ 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 + + // Manual updater script + ant.copy(file: "$home/../adt/idea/native/update_studio.sh", tofile: "$target/bin/update_studio.sh") + layoutMacApp(target, home, args) } -private layoutUnix(Map args, String home, Paths paths) { +private layoutUnix(Map _args, String home, Paths paths) { String target = paths.distUnix + Map args = new HashMap(_args) + args.product_uc = "STUDIO" + args.vm_options = "studio" + args.script_name = "studio.sh" + layout(target) { dir("bin") { fileset(dir: "$home/bin/linux") } } - ant.copy(file: "$home/platform/icons/src/icon_CE_128.png", tofile: "$target/bin/idea.png") + ant.copy(file: "$home/../adt/idea/adt-branding/src/artwork/icon_AS_128.png", tofile: "$target/bin/idea.png") + ant.copy(file: "$home/../adt/idea/adt-branding/src/artwork/androidstudio.ico", tofile: "$target/bin/androidstudio.ico") + + // Manual updater script + ant.copy(file: "$home/../adt/idea/native/update_studio.sh", tofile: "$target/bin/update_studio.sh") - unixScripts(target, home, "idea.sh", args) - unixVMOptions(target, "idea") + unixScripts(target, home, args.script_name, args) + unixVMOptions(target, "studio") unixReadme(target, home, args) } |