require “rexml/document”
…
OUTPUT_PATH = “output”
SVN_LOG_PATH = “#{OUTPUT_PATH}/svn_log.xml”
ARTIFACTS_PATH = “#{OUTPUT_PATH}/artifacts”
SVN_URL = “http://.../svn/Source/trunk/”
VERSION_MAJOR_MINOR_BUILD = “0.1.0”
namespace :build do
task :all => [:init, :compile]
…
“Perform the required initial tasks.”
task :init do
puts “performorming Initializatiom…”
puts “Creating folders…”
Dir.mkdir(OUTPUT_PATH)
Dir.mkdir(ARTIFACTS_PARTH)
puts “Getting SVN revision number and saving to
#{SVN_LOG_PATH}…”
sh “svn log --xml --revision HEAD #{SVN_URL} >
“#{SVN_LOG_PATH}””
log = REXML::Document.new File.new(SVN_LOG_PATH)
logEntry = log.root.elements[“logentry”]
$svn_revision = logEntry.attributes[“revision”]
$svn_message = logEntry.elements[“msg”].text
VERSION = “#{VERSION_MAJOR_MINOR_BUILD}.#{$svn_revision}”
puts “Revision #{$svn_revision} found with message:
#{$svn_message}”
end
end
Hi,
So? If you want to know why this error occurs: This is because of the
“…”, which Ruby of course doesn’t recognize. Or did you expect Ruby to
fill in the blanks?