From 8bb207d4d1104dfcff46f131e85fd204f7c133c3 Mon Sep 17 00:00:00 2001 From: nik Date: Wed, 28 Jul 2010 10:32:17 +0400 Subject: [PATCH] publish artifacts as soon as they build --- build/scripts/dist.gant | 12 +++++++++--- build/scripts/utils.gant | 8 ++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/build/scripts/dist.gant b/build/scripts/dist.gant index 07e8849d3af9..2921df30192a 100644 --- a/build/scripts/dist.gant +++ b/build/scripts/dist.gant @@ -136,10 +136,12 @@ private def layoutWin(Map args, String home, Paths paths) { patchPropertiesFile(paths.distWin) ant.echo(file: "$paths.distWin/bin/idea.exe.vmoptions", message: args.vmoptions.replace(' ', '\n')) - ant.zip(zipfile: "$paths.artifacts/idea${args.buildNumber}.win.zip") { + def winZipPath = "$paths.artifacts/idea${args.buildNumber}.win.zip" + ant.zip(zipfile: winZipPath) { fileset(dir: paths.distAll) fileset(dir: paths.distWin) } + notifyArtifactBuilt(winZipPath) } private def layoutMac(Map args, String home, Paths paths) { @@ -170,7 +172,8 @@ private def layoutMac(Map args, String home, Paths paths) { def root = isEap() ? "${version}-${args.buildNumber}.app" : "IntelliJ IDEA ${version} CE.app" - ant.zip(zipfile: "$paths.artifacts/idea${args.buildNumber}.mac.zip") { + def macZipPath = "$paths.artifacts/idea${args.buildNumber}.mac.zip" + ant.zip(zipfile: macZipPath) { [paths.distAll, paths.distMac].each { tarfileset(dir: it, prefix: root) { exclude(name: "bin/*.sh") @@ -183,6 +186,7 @@ private def layoutMac(Map args, String home, Paths paths) { include(name: "Contents/MacOS/idea") } } + notifyArtifactBuilt(macZipPath) } def layoutLinux(Map args, String home, Paths paths) { @@ -216,7 +220,9 @@ def layoutLinux(Map args, String home, Paths paths) { } } - ant.gzip(src: tarPath, zipfile: "${tarPath}.gz") + def gzPath = "${tarPath}.gz" + ant.gzip(src: tarPath, zipfile: gzPath) ant.delete(file: tarPath) + notifyArtifactBuilt(gzPath) } diff --git a/build/scripts/utils.gant b/build/scripts/utils.gant index 8be15353d412..5f46552722dc 100644 --- a/build/scripts/utils.gant +++ b/build/scripts/utils.gant @@ -88,3 +88,11 @@ binding.setVariable("loadProject", { requireProperty("home", guessHome()) project.builder.buildInfoPrinter = new org.jetbrains.jps.teamcity.TeamcityBuildInfoPrinter() + +binding.setVariable("notifyArtifactBuilt", { String artifactPath -> + if (!artifactPath.startsWith(home)) { + project.error("Artifact path $artifactPath should start with $home") + } + def relativePath = artifactPath.substring(home.length()) + project.info("##teamcity[publishArtifacts '$relativePath']") +}) \ No newline at end of file