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.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
abb35e8d97a7 Add `bin` directory to PATH so build scripts may use scripts located there
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
     1
require 'rakelib/extensions.rb'
abb35e8d97a7 Add `bin` directory to PATH so build scripts may use scripts located there
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
     2
require 'rakelib/rbspec.rb'
abb35e8d97a7 Add `bin` directory to PATH so build scripts may use scripts located there
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
     3
require 'rakelib/vcs.rb'
abb35e8d97a7 Add `bin` directory to PATH so build scripts may use scripts located there
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
     4
require 'rakelib/smalltalk-utils.rb'
abb35e8d97a7 Add `bin` directory to PATH so build scripts may use scripts located there
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
     5
2
d5cd0cfb84d5 Use regexp matching to parse NAME=VALUE pairs given as command line arguments
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 0
diff changeset
     6
# Following hack is required to allow passing variable
d5cd0cfb84d5 Use regexp matching to parse NAME=VALUE pairs given as command line arguments
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 0
diff changeset
     7
# values in `make` style, i.e., to allow for
d5cd0cfb84d5 Use regexp matching to parse NAME=VALUE pairs given as command line arguments
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 0
diff changeset
     8
#
d5cd0cfb84d5 Use regexp matching to parse NAME=VALUE pairs given as command line arguments
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 0
diff changeset
     9
#  rake PROJECT=stx:jv-branch compile
d5cd0cfb84d5 Use regexp matching to parse NAME=VALUE pairs given as command line arguments
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 0
diff changeset
    10
#
d5cd0cfb84d5 Use regexp matching to parse NAME=VALUE pairs given as command line arguments
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 0
diff changeset
    11
ARGV.each do | arg |
d5cd0cfb84d5 Use regexp matching to parse NAME=VALUE pairs given as command line arguments
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 0
diff changeset
    12
  name_and_value = /^([A-Za-z_]+)\w*=(.*)/.match(arg)
d5cd0cfb84d5 Use regexp matching to parse NAME=VALUE pairs given as command line arguments
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 0
diff changeset
    13
  if name_and_value
d5cd0cfb84d5 Use regexp matching to parse NAME=VALUE pairs given as command line arguments
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 0
diff changeset
    14
     self.class.const_set(name_and_value[1], name_and_value[2])  
d5cd0cfb84d5 Use regexp matching to parse NAME=VALUE pairs given as command line arguments
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 0
diff changeset
    15
  end
d5cd0cfb84d5 Use regexp matching to parse NAME=VALUE pairs given as command line arguments
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 0
diff changeset
    16
end
d5cd0cfb84d5 Use regexp matching to parse NAME=VALUE pairs given as command line arguments
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 0
diff changeset
    17
6
abb35e8d97a7 Add `bin` directory to PATH so build scripts may use scripts located there
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    18
# Update PATH for build so build scripts may access 
abb35e8d97a7 Add `bin` directory to PATH so build scripts may use scripts located there
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    19
# scripts in `bin` directory. This is required especially
abb35e8d97a7 Add `bin` directory to PATH so build scripts may use scripts located there
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    20
# on Windows as Windows do not ship with some basic tools
abb35e8d97a7 Add `bin` directory to PATH so build scripts may use scripts located there
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    21
# (e.g. zip) by default. As a courtesy to the user, provide
abb35e8d97a7 Add `bin` directory to PATH so build scripts may use scripts located there
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    22
# our own
abb35e8d97a7 Add `bin` directory to PATH so build scripts may use scripts located there
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    23
ENV['PATH'] = "#{ENV['PATH']}#{File::PATH_SEPARATOR}#{File.expand_path('bin')}"
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25