Added sconscript
This commit is contained in:
parent
cafa9adb1a
commit
df196aa346
4 changed files with 45 additions and 2 deletions
15
.travis.yml
15
.travis.yml
|
|
@ -60,13 +60,26 @@ matrix:
|
|||
- compiler: clang
|
||||
language: dotnet
|
||||
env: BINDINGS=dotnet CC=clang
|
||||
- compiler: gcc
|
||||
language: ruby
|
||||
rvm:
|
||||
- ruby-1.9.3-p484
|
||||
- ruby-2.0.0-p353
|
||||
- ruby-2.1.0
|
||||
env: BINDINGS=ruby
|
||||
- compiler: clang
|
||||
language: ruby
|
||||
rvm:
|
||||
- ruby-1.9.3-p484
|
||||
- ruby-2.0.0-p353
|
||||
- ruby-2.1.0
|
||||
env: BINDINGS=ruby CC=clang
|
||||
before_install:
|
||||
- sudo apt-get update -qq
|
||||
- if [ "$BINDINGS" != "none" ]; then sudo apt-get install -qq swig; fi
|
||||
- if [ "$BINDINGS" == "perl" ]; then sudo add-apt-repository ppa:dns/irc -y; sudo apt-get update -qq; sudo apt-get install -qq swig=2.0.8-1irc1~12.04; fi
|
||||
- if [ "$BINDINGS" == "python" ]; then sudo apt-get install -qq python-dev; fi
|
||||
- if [ "$BINDINGS" == "dotnet" ]; then sudo add-apt-repository ppa:directhex/monoxide -y; sudo apt-get update -qq; sudo apt-get install -qq mono-devel mono-mcs nunit nunit-console; mozroots --import --sync; fi
|
||||
|
||||
install: true
|
||||
before_script:
|
||||
- if [ "$BINDINGS" == "php" ]; then phpenv config-add src/bindings/php/hammer.ini; fi
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import sys
|
|||
vars = Variables(None, ARGUMENTS)
|
||||
vars.Add(PathVariable('DESTDIR', "Root directory to install in (useful for packaging scripts)", None, PathVariable.PathIsDirCreate))
|
||||
vars.Add(PathVariable('prefix', "Where to install in the FHS", "/usr/local", PathVariable.PathAccept))
|
||||
vars.Add(ListVariable('bindings', 'Language bindings to build', 'none', ['dotnet', 'perl', 'php', 'python']))
|
||||
vars.Add(ListVariable('bindings', 'Language bindings to build', 'none', ['dotnet', 'perl', 'php', 'python', 'ruby']))
|
||||
|
||||
env = Environment(ENV = {'PATH' : os.environ['PATH']},
|
||||
variables = vars,
|
||||
|
|
|
|||
1
src/bindings/ruby/.gitignore
vendored
1
src/bindings/ruby/.gitignore
vendored
|
|
@ -1 +1,2 @@
|
|||
/Gemfile.lock
|
||||
.bundle
|
||||
|
|
|
|||
29
src/bindings/ruby/SConscript
Normal file
29
src/bindings/ruby/SConscript
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# -*- python -*-
|
||||
import os.path
|
||||
Import("env libhammer_shared testruns targets")
|
||||
|
||||
rubysources = [
|
||||
Glob("test/*.rb"),
|
||||
Glob("lib/hammer.rb"),
|
||||
Glob("lib/*/*.rb"),
|
||||
"hammer-parser.gemspec",
|
||||
"Rakefile",
|
||||
"Gemfile",
|
||||
"Gemfile.lock",
|
||||
"README.md",
|
||||
]
|
||||
|
||||
rubyenv = env.Clone()
|
||||
rubyenv['ENV']['LD_LIBRARY_PATH'] = os.path.dirname(str(libhammer_shared[0]))
|
||||
rubyenv['RBDIR'] = os.path.dirname(str(rubyenv.File("Gemfile").path))
|
||||
|
||||
setup = rubyenv.Command(Dir(".bundle"), rubysources, "cd $RBDIR && bundle install")
|
||||
AlwaysBuild(setup)
|
||||
|
||||
rubytestexec = rubyenv.Command(None, [setup] + rubysources, "cd $RBDIR && bundle exec rake test")
|
||||
|
||||
rubytest = Alias("testruby", [rubytestexec], rubytestexec)
|
||||
AlwaysBuild(rubytestexec)
|
||||
testruns.append(rubytest)
|
||||
|
||||
# No need for an install target; everybody just uses gems for that.
|
||||
Loading…
Add table
Add a link
Reference in a new issue