rakelib/support.rb
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 24 May 2016 10:33:45 +0100
changeset 6 abb35e8d97a7
parent 2 d5cd0cfb84d5
child 7 b6fe3a90f6e0
permissions -rw-r--r--
Add `bin` directory to PATH so build scripts may use scripts located there This is required especially on Windows as Windows do not ship with some basic tools (e.g. zip) by default. As a courtesy to the user, provide and our own.

require 'rakelib/extensions.rb'
require 'rakelib/rbspec.rb'
require 'rakelib/vcs.rb'
require 'rakelib/smalltalk-utils.rb'

# Following hack is required to allow passing variable
# values in `make` style, i.e., to allow for
#
#  rake PROJECT=stx:jv-branch compile
#
ARGV.each do | arg |
  name_and_value = /^([A-Za-z_]+)\w*=(.*)/.match(arg)
  if name_and_value
     self.class.const_set(name_and_value[1], name_and_value[2])  
  end
end

# Update PATH for build so build scripts may access 
# scripts in `bin` directory. This is required especially
# on Windows as Windows do not ship with some basic tools
# (e.g. zip) by default. As a courtesy to the user, provide
# our own
ENV['PATH'] = "#{ENV['PATH']}#{File::PATH_SEPARATOR}#{File.expand_path('bin')}"