rakelib/support.rb
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 25 May 2016 10:36:18 +0100
changeset 9 34274130f57a
parent 7 b6fe3a90f6e0
child 10 cb3e0e3ca28f
permissions -rw-r--r--
Removed some old, dead code.
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
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
     5
# 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
     6
# 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
     7
#
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
#  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
     9
#
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
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
    11
  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
    12
  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
    13
     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
    14
  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
    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
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
    17
# 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
    18
# 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
    19
# 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
    20
# (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
    21
# 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
    22
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
    23
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24