From bfade85578866ce1167584d14ba83953135448ac Mon Sep 17 00:00:00 2001 From: David Dykstal Date: Tue, 6 Jun 2006 22:31:37 +0000 Subject: [PATCH] Add perl versions of scripts. --- releng/org.eclipse.rse.build/build.pl | 71 ++++++++++++++++++++ releng/org.eclipse.rse.build/fetchBuilder.pl | 20 ++++++ 2 files changed, 91 insertions(+) create mode 100644 releng/org.eclipse.rse.build/build.pl create mode 100755 releng/org.eclipse.rse.build/fetchBuilder.pl diff --git a/releng/org.eclipse.rse.build/build.pl b/releng/org.eclipse.rse.build/build.pl new file mode 100644 index 00000000000..830974712e4 --- /dev/null +++ b/releng/org.eclipse.rse.build/build.pl @@ -0,0 +1,71 @@ +#!/usr/bin/perl + +# Build script for Remote System Explorer +# Authors: Dave Dykstal, Kushal Munir +# java and cvs have to be in the path + +use warnings; +use File::Spec; + +sub ask($$) { + my ($question, $default, $message, $ans); + ($question, $default) = @_; + $message = "${question} (default is ${default}): "; + print STDERR $message; + $ans = ; + chomp $ans; + $ans = $ans ? $ans : $default; + return $ans; +} + +# $eclipse is the location of the basic PDE and plugins to compile against +# This should include the org.eclipse.pde.build project +$eclipse = "../eclipse"; + +# $builder is the location of the custom build scripts customTargets.xml and build.properties +# (i.e. the contents of org.eclipse.rse.build) +$builder = "."; + +# $working is where the build is actually done, does not need to exist +$working = "../working"; + +$plugins = File::Spec->catdir($eclipse, "plugins"); +$baseBuilderGlob = File::Spec->catdir($plugins, "org.eclipse.pde.build*"); + +# Find the base build scripts: genericTargets.xml and build.xml +@candidates = glob($baseBuilderGlob); +$n = @candidates; +if ($n == 0) { + die("PDE Build was not found."); +} +if ($n > 1) { + die("Too many versions of PDE Build were found."); +} +$baseBuilder = $candidates[0]; + +$buildDirectory = "$working/build"; +$packageDirectory = "$working/package"; +$publishDirectory = "$working/publish"; + +$tag = ask("Enter tag to fetch from CVS", "HEAD"); +$buildType = ask("Enter build type (P=Personal, N=Nightly, I=Integration)", "P"); +($sec, $minute, $hour, $mday, $mon, $year) = gmtime(); +$timeStamp = sprintf("%4.4d%2.2d%2.2d%2.2d%2.2d", $year + 1900, ($mon + 1), ($mday + 1), $hour, $minute, $sec); +$buildId = $buildType . $timeStamp; +$buildId = ask("Enter the build id", $buildType . $timeStamp); + +$incantation = "java -cp ${eclipse}/startup.jar org.eclipse.core.launcher.Main "; +$incantation .= "-application org.eclipse.ant.core.antRunner "; +$incantation .= "-buildfile ${baseBuilder}/scripts/build.xml "; +$incantation .= "-DbuildDirectory=${buildDirectory} "; +$incantation .= "-DpackageDirectory=${packageDirectory} "; +$incantation .= "-DpublishDirectory=${publishDirectory} "; +$incantation .= "-Dbuilder=${builder} "; +$incantation .= "-DbaseLocation=${eclipse} "; +$incantation .= "-DbuildType=${buildType} "; +$incantation .= "-DbuildId=${buildId} "; +$incantation .= "-DmapVersionTag=${tag} "; + +print($incantation); + +#system($incantation); \ No newline at end of file diff --git a/releng/org.eclipse.rse.build/fetchBuilder.pl b/releng/org.eclipse.rse.build/fetchBuilder.pl new file mode 100755 index 00000000000..2bd48d0351c --- /dev/null +++ b/releng/org.eclipse.rse.build/fetchBuilder.pl @@ -0,0 +1,20 @@ +#!/usr/bin/perl +use warnings; + +print STDERR "Which tag do you want to fetch? (default is HEAD): "; +$answer = ; +chomp($answer); +$tag = $answer ? $answer : "HEAD"; + +$incantation = "cvs "; +$incantation .= "-d :pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp "; +$incantation .= "checkout "; +$incantation .= "-r ${tag} "; +$incantation .= "-d builder "; +$incantation .= "org.eclipse.tm.rse/releng/org.eclipse.rse.build "; + +print($incantation); +#system($incantation); + +print("\n"); +print("Builder has been fetched and is in the builder subdirectory\n");