1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-13 03:55:22 +02:00

making the ruby version identical to the perl version

This commit is contained in:
David Dykstal 2006-06-27 02:18:56 +00:00
parent 48487d25a8
commit 4293d74b9d

View file

@ -1,66 +1,66 @@
#!/usr/bin/ruby #!/usr/bin/ruby
# Build script for Remote System Explorer # Build script for Remote System Explorer
# Author: Dave Dykstal, Kushal Munir # Author: Dave Dykstal, Kushal Munir
# Prerequisites: # Prerequisites:
# written in ruby # written in ruby
# java and cvs have to be in the path # java and cvs have to be in the path
require "ftools" require "ftools"
def ask(question, default) def ask(question, default)
message = "#{question} (default is #{default}): " message = "#{question} (default is #{default}): "
STDERR.print message STDERR.print message
answer = readline().strip answer = readline().strip
answer = answer.empty? ? default : answer answer = answer.empty? ? default : answer
return answer return answer
end end
# "eclipse" is the location of the basic PDE and plugins to compile against # "eclipse" is the location of the basic PDE and plugins to compile against
# This should include the org.eclipse.pde.build project # This should include the org.eclipse.pde.build project
eclipse = "../eclipse" eclipse = "../eclipse"
# "builder" is the location of the custom build scripts customTargets.xml and build.properties # "builder" is the location of the custom build scripts customTargets.xml and build.properties
# (i.e. the contents of org.eclipse.rse.build) # (i.e. the contents of org.eclipse.rse.build)
builder = "." builder = "."
# "working" is where the build is actually done, does not need to exist # "working" is where the build is actually done, does not need to exist
working = "../build" working = "../working"
# make these absolute paths # make these absolute paths
eclipse = File.expand_path(eclipse) eclipse = File.expand_path(eclipse)
builder = File.expand_path(builder) builder = File.expand_path(builder)
working = File.expand_path(working) working = File.expand_path(working)
# Find the base build scripts: genericTargets.xml and build.xml # Find the base build scripts: genericTargets.xml and build.xml
candidates = Dir["#{eclipse}/plugins/org.eclipse.pde.build*"] candidates = Dir["#{eclipse}/plugins/org.eclipse.pde.build*"]
if (candidates.size == 0) then if (candidates.size == 0) then
raise("PDE Build was not found.") raise("PDE Build was not found.")
end end
if (candidates.size > 1) then if (candidates.size > 1) then
raise("Too many versions of PDE Build were found.") raise("Too many versions of PDE Build were found.")
end end
baseBuilder = candidates[0] baseBuilder = candidates[0]
buildDirectory = "#{working}/build" buildDirectory = "#{working}/build"
packageDirectory = "#{working}/package" packageDirectory = "#{working}/package"
publishDirectory = "#{working}/publish" publishDirectory = "#{working}/publish"
tag = ask("Enter tag to fetch from CVS", "HEAD") tag = ask("Enter tag to fetch from CVS", "HEAD")
buildType = ask("Enter build type (P=Personal, N=Nightly, I=Integration, S=Stable)", "P") buildType = ask("Enter build type (P=Personal, N=Nightly, I=Integration, S=Stable)", "P")
buildId = ask("Enter the build id", buildType + Time.now.strftime("%Y%m%d-%H%M")) buildId = ask("Enter the build id", buildType + Time.now.strftime("%Y%m%d%H%M"))
command = "java -cp #{eclipse}/startup.jar org.eclipse.core.launcher.Main " command = "java -cp #{eclipse}/startup.jar org.eclipse.core.launcher.Main "
command += "-application org.eclipse.ant.core.antRunner " command += "-application org.eclipse.ant.core.antRunner "
command += "-buildfile #{baseBuilder}/scripts/build.xml " command += "-buildfile #{baseBuilder}/scripts/build.xml "
command += "-DbuildDirectory=#{buildDirectory} " command += "-DbuildDirectory=#{buildDirectory} "
command += "-DpackageDirectory=#{packageDirectory} " command += "-DpackageDirectory=#{packageDirectory} "
command += "-DpublishDirectory=#{publishDirectory} " command += "-DpublishDirectory=#{publishDirectory} "
command += "-Dbuilder=#{builder} " command += "-Dbuilder=#{builder} "
command += "-DbaseLocation=#{eclipse} " command += "-DbaseLocation=#{eclipse} "
command += "-DbuildType=#{buildType} " command += "-DbuildType=#{buildType} "
command += "-DbuildId=#{buildId} " command += "-DbuildId=#{buildId} "
command += "-DmapVersionTag=#{tag} " command += "-DmapVersionTag=#{tag} "
puts(command) puts(command)
system(command) system(command)