comparison mx.truffle/mx_truffle.py @ 22044:88eaf4852595

No need for special maven-install-truffle - generic maven-install should be good enough
author Jaroslav Tulach <jaroslav.tulach@oracle.com>
date Wed, 29 Jul 2015 16:43:47 +0200
parents a4c9f8c89c68
children 2867e02e6fdb
comparison
equal deleted inserted replaced
22043:a96b05205d3b 22044:88eaf4852595
37 def build(args, vm=None): 37 def build(args, vm=None):
38 """build the Java sources""" 38 """build the Java sources"""
39 opts2 = mx.build(['--source', '1.7'] + args) 39 opts2 = mx.build(['--source', '1.7'] + args)
40 assert len(opts2.remainder) == 0 40 assert len(opts2.remainder) == 0
41 41
42 def maven_install_truffle(args):
43 """install Truffle into your local Maven repository"""
44 for name in mx._dists:
45 dist = mx._dists[name]
46 if dist.isProcessorDistribution:
47 continue
48 mx.archive(["@" + name])
49 path = dist.path
50 slash = path.rfind('/')
51 dot = path.rfind('.')
52 if dot <= slash:
53 mx.abort('Dot should be after / in ' + path)
54 artifactId = path[slash + 1: dot]
55 mx.run(['mvn', 'install:install-file', '-DgroupId=com.oracle.' + dist.suite.name, '-DartifactId=' + artifactId, '-Dversion=' + mx.suite('truffle').release_version('SNAPSHOT'), '-Dpackaging=jar', '-Dfile=' + path])
56
57 def sl(args): 42 def sl(args):
58 """run an SL program""" 43 """run an SL program"""
59 vmArgs, slArgs = mx.extract_VM_args(args) 44 vmArgs, slArgs = mx.extract_VM_args(args)
60 mx.run_java(vmArgs + ['-cp', mx.classpath(["TRUFFLE", "com.oracle.truffle.sl"]), "com.oracle.truffle.sl.SLLanguage"] + slArgs) 45 mx.run_java(vmArgs + ['-cp', mx.classpath(["TRUFFLE", "com.oracle.truffle.sl"]), "com.oracle.truffle.sl.SLLanguage"] + slArgs)
61 46
69 if t: unittest(['--suite', 'truffle', '--enable-timing', '--verbose', '--fail-fast']) 54 if t: unittest(['--suite', 'truffle', '--enable-timing', '--verbose', '--fail-fast'])
70 55
71 mx_gate.add_gate_runner(_suite, _truffle_gate_runner) 56 mx_gate.add_gate_runner(_suite, _truffle_gate_runner)
72 57
73 mx.update_commands(_suite, { 58 mx.update_commands(_suite, {
74 'maven-install-truffle' : [maven_install_truffle, ''],
75 'sl' : [sl, '[SL args|@VM options]'], 59 'sl' : [sl, '[SL args|@VM options]'],
76 'sldebug' : [sldebug, '[SL args|@VM options]'], 60 'sldebug' : [sldebug, '[SL args|@VM options]'],
77 }) 61 })