forked from emina/kodkod
-
Notifications
You must be signed in to change notification settings - Fork 1
/
wscript
81 lines (64 loc) · 2.57 KB
/
wscript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#! /usr/bin/env python
# encoding: utf-8
import os.path
def options(opt):
opt.load('java')
opt.recurse('jni')
def configure(conf):
conf.load('java')
conf.recurse('jni')
def build(bld):
bld.recurse('jni')
bld(rule = 'wget http://download.forge.ow2.org/sat4j/${TGT}',
target = 'sat4j-core-v20130525.zip')
bld(rule = 'unzip ${SRC} -x *src.jar',
source = 'sat4j-core-v20130525.zip',
target = 'org.sat4j.core.jar')
bld.add_group()
bld(features = 'javac jar',
name = 'kodkod',
srcdir = 'src',
outdir = 'kodkod',
compat = '1.8',
classpath = ['.', 'org.sat4j.core.jar'],
manifest = 'src/MANIFEST',
basedir = 'kodkod',
destfile = 'kodkod.jar')
bld(features = 'javac jar',
name = 'examples',
use = 'kodkod',
srcdir = 'examples',
outdir = 'examples',
compat = '1.8',
classpath = ['.', 'kodkod.jar'],
manifest = 'examples/MANIFEST',
basedir = 'examples',
destfile = 'examples.jar')
bld.install_files('${LIBDIR}', ['kodkod.jar', 'examples.jar'])
def distclean(ctx):
from waflib import Scripting
Scripting.distclean(ctx)
ctx.recurse('jni')
from waflib.Build import BuildContext
class TestContext(BuildContext):
cmd = 'test'
fun = 'test'
def test(bld):
"""compiles and runs tests"""
bld(rule = 'wget -O junit.jar "http://search.maven.org/remotecontent?filepath=junit/junit/4.12/junit-4.12.jar"',
target = 'junit.jar')
bld(rule = 'wget -O hamcrest-core.jar "http://search.maven.org/remotecontent?filepath=org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"',
target = 'hamcrest-core.jar')
bld.add_group()
cp = ['.', 'kodkod.jar', 'examples.jar', 'org.sat4j.core.jar', 'junit.jar', 'hamcrest-core.jar']
bld(features = 'javac',
name = 'test',
srcdir = 'test',
classpath = cp,
use = ['kodkod', 'examples'])
bld.add_group()
bld(rule = 'java -cp {classpath} -Djava.library.path={libpath} {junit} {test}'.format(classpath = ':'.join(cp),
libpath = bld.env.LIBDIR,
junit = 'org.junit.runner.JUnitCore',
test = 'kodkod.test.AllTests'),
always = True)