forked from emina/kodkod
-
Notifications
You must be signed in to change notification settings - Fork 6
/
wscript
96 lines (78 loc) · 3.5 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#! /usr/bin/env python
# encoding: utf-8
import os.path
def options(opt):
opt.load('java')
opt.recurse('jni')
opt.add_option('--lib', action='store_false', default=True)
def configure(conf):
print('→ the value of full is %r' % conf.options.lib)
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(rule = 'wget http://download.forge.ow2.org/sat4j/${TGT}',
target = 'sat4j-maxsat-v20130525.zip')
bld(rule = 'unzip ${SRC} -x *src.jar',
source = 'sat4j-maxsat-v20130525.zip',
target = 'org.sat4j.maxsat.jar')
bld(rule = 'wget http://download.forge.ow2.org/sat4j/${TGT}',
target = 'sat4j-pb-v20130525.zip')
bld(rule = 'unzip ${SRC} -x *src.jar',
source = 'sat4j-pb-v20130525.zip',
target = 'org.sat4j.pb.jar')
bld(rule = 'wget -O slf4j-api-1.7.25.jar "http://search.maven.org/remotecontent?filepath=org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar"',
target = 'slf4j-api-1.7.25.jar')
bld.add_group()
bld(features = 'javac jar',
name = 'pardinus',
srcdir = 'src/main/java',
outdir = 'pardinus',
compat = '1.8',
classpath = ['.', 'org.sat4j.core.jar', 'org.sat4j.maxsat.jar', 'org.sat4j.pb.jar', 'slf4j-api-1.7.25.jar'],
manifest = 'src/MANIFEST',
basedir = 'pardinus',
destfile = 'pardinus.jar')
bld(features = 'javac jar',
name = 'examples',
use = 'pardinus',
srcdir = 'src/main/java',
outdir = 'examples',
compat = '1.8',
classpath = ['.', 'pardinus.jar', 'org.sat4j.core.jar', 'org.sat4j.maxsat.jar', 'org.sat4j.pb.jar', 'slf4j-api-1.7.25.jar'],
manifest = 'src/MANIFEST',
basedir = 'examples',
destfile = 'examples.jar')
bld.install_files('${LIBDIR}', ['pardinus.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 = ['.', 'pardinus.jar', 'org.sat4j.core.jar', 'junit.jar', 'hamcrest-core.jar']
bld(features = 'javac',
name = 'test',
srcdir = 'src/test/java',
classpath = cp,
use = ['pardinus'])
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 = 'pardinus.test.AllTests'),
always = True)