Added sconscript

This commit is contained in:
Dan Hirsch 2014-01-11 04:26:47 +01:00
parent cafa9adb1a
commit df196aa346
4 changed files with 45 additions and 2 deletions

View file

@ -60,13 +60,26 @@ matrix:
- compiler: clang - compiler: clang
language: dotnet language: dotnet
env: BINDINGS=dotnet CC=clang 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: before_install:
- sudo apt-get update -qq - sudo apt-get update -qq
- if [ "$BINDINGS" != "none" ]; then sudo apt-get install -qq swig; fi - 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" == "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" == "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 - 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 install: true
before_script: before_script:
- if [ "$BINDINGS" == "php" ]; then phpenv config-add src/bindings/php/hammer.ini; fi - if [ "$BINDINGS" == "php" ]; then phpenv config-add src/bindings/php/hammer.ini; fi

View file

@ -7,7 +7,7 @@ import sys
vars = Variables(None, ARGUMENTS) vars = Variables(None, ARGUMENTS)
vars.Add(PathVariable('DESTDIR', "Root directory to install in (useful for packaging scripts)", None, PathVariable.PathIsDirCreate)) 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(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']}, env = Environment(ENV = {'PATH' : os.environ['PATH']},
variables = vars, variables = vars,

View file

@ -1 +1,2 @@
/Gemfile.lock /Gemfile.lock
.bundle

View 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.