Mercurial > hg > truffle
annotate mx.truffle/mx_truffle.py @ 22016:92168cb0e803
removed non-Truffle code from mx.truffle/mx_truffle.py
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 08 Jul 2015 22:30:27 +0200 |
parents | de52ea7de779 |
children | a4c9f8c89c68 |
rev | line source |
---|---|
3718 | 1 # |
4225
339cf8d4904d
Made mx.run work properly when stderr is redirected to stdout.
Doug Simon <doug.simon@oracle.com>
parents:
4219
diff
changeset
|
2 # commands.py - the GraalVM specific commands |
3718 | 3 # |
4 # ---------------------------------------------------------------------------------------------------- | |
5 # | |
18891
9afee75cee46
mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents:
18888
diff
changeset
|
6 # Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. |
3718 | 7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
8 # | |
9 # This code is free software; you can redistribute it and/or modify it | |
10 # under the terms of the GNU General Public License version 2 only, as | |
11 # published by the Free Software Foundation. | |
12 # | |
13 # This code is distributed in the hope that it will be useful, but WITHOUT | |
14 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 # version 2 for more details (a copy is included in the LICENSE file that | |
17 # accompanied this code). | |
18 # | |
19 # You should have received a copy of the GNU General Public License version | |
20 # 2 along with this work; if not, write to the Free Software Foundation, | |
21 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
22 # | |
23 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
24 # or visit www.oracle.com if you need additional information or have any | |
25 # questions. | |
26 # | |
27 # ---------------------------------------------------------------------------------------------------- | |
28 | |
4144
34527a24bcf8
Adopted mxtool changes.
Doug Simon <doug.simon@oracle.com>
parents:
3736
diff
changeset
|
29 import mx |
4177
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4163
diff
changeset
|
30 |
22016
92168cb0e803
removed non-Truffle code from mx.truffle/mx_truffle.py
Doug Simon <doug.simon@oracle.com>
parents:
21984
diff
changeset
|
31 _suite = mx.suite('truffle') |
16622
faaea970b951
Add an mx install command to install the Truffle jars to the local Maven repository.
Chris Seaton <chris.seaton@oracle.com>
parents:
16621
diff
changeset
|
32 |
4577
bc8b58c11768
Added debug build of HotSpot Client to the gate.
Doug Simon <doug.simon@oracle.com>
parents:
4575
diff
changeset
|
33 def build(args, vm=None): |
22016
92168cb0e803
removed non-Truffle code from mx.truffle/mx_truffle.py
Doug Simon <doug.simon@oracle.com>
parents:
21984
diff
changeset
|
34 """build the Java sources""" |
92168cb0e803
removed non-Truffle code from mx.truffle/mx_truffle.py
Doug Simon <doug.simon@oracle.com>
parents:
21984
diff
changeset
|
35 opts2 = mx.build(['--source', '1.7'] + args) |
11392
66251d9f62ab
fail faster with better error message if deprecated and unsupported mx build command line is given
Doug Simon <doug.simon@oracle.com>
parents:
11377
diff
changeset
|
36 assert len(opts2.remainder) == 0 |
4145
9aee7df31417
Removed 'tests' command.
Doug Simon <doug.simon@oracle.com>
parents:
4144
diff
changeset
|
37 |
16693
b002c864e974
Truffle: rename install to maven-install-truffle and update location of Truffle JARs.
Chris Seaton <chris.seaton@oracle.com>
parents:
16676
diff
changeset
|
38 def maven_install_truffle(args): |
16622
faaea970b951
Add an mx install command to install the Truffle jars to the local Maven repository.
Chris Seaton <chris.seaton@oracle.com>
parents:
16621
diff
changeset
|
39 """install Truffle into your local Maven repository""" |
21981
da5e694d2b3c
Using groupId=com.oracle.[suite.name] when deploying the artifacts. Iterating thru all distributions (except ap ones). Using name of the JAR file as artifactId.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21977
diff
changeset
|
40 for name in mx._dists: |
da5e694d2b3c
Using groupId=com.oracle.[suite.name] when deploying the artifacts. Iterating thru all distributions (except ap ones). Using name of the JAR file as artifactId.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21977
diff
changeset
|
41 dist = mx._dists[name] |
da5e694d2b3c
Using groupId=com.oracle.[suite.name] when deploying the artifacts. Iterating thru all distributions (except ap ones). Using name of the JAR file as artifactId.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21977
diff
changeset
|
42 if dist.isProcessorDistribution: |
da5e694d2b3c
Using groupId=com.oracle.[suite.name] when deploying the artifacts. Iterating thru all distributions (except ap ones). Using name of the JAR file as artifactId.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21977
diff
changeset
|
43 continue |
16729
3d148f5e90b8
mx: refactor maven_install_truffle such that it uses specified paths from the project file
Bernhard Urban <bernhard.urban@jku.at>
parents:
16699
diff
changeset
|
44 mx.archive(["@" + name]) |
21981
da5e694d2b3c
Using groupId=com.oracle.[suite.name] when deploying the artifacts. Iterating thru all distributions (except ap ones). Using name of the JAR file as artifactId.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21977
diff
changeset
|
45 path = dist.path |
da5e694d2b3c
Using groupId=com.oracle.[suite.name] when deploying the artifacts. Iterating thru all distributions (except ap ones). Using name of the JAR file as artifactId.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21977
diff
changeset
|
46 slash = path.rfind('/') |
da5e694d2b3c
Using groupId=com.oracle.[suite.name] when deploying the artifacts. Iterating thru all distributions (except ap ones). Using name of the JAR file as artifactId.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21977
diff
changeset
|
47 dot = path.rfind('.') |
da5e694d2b3c
Using groupId=com.oracle.[suite.name] when deploying the artifacts. Iterating thru all distributions (except ap ones). Using name of the JAR file as artifactId.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21977
diff
changeset
|
48 if dot <= slash: |
21984
de52ea7de779
Doug prefers usage of abort
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21981
diff
changeset
|
49 mx.abort('Dot should be after / in ' + path) |
21981
da5e694d2b3c
Using groupId=com.oracle.[suite.name] when deploying the artifacts. Iterating thru all distributions (except ap ones). Using name of the JAR file as artifactId.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21977
diff
changeset
|
50 artifactId = path[slash + 1: dot] |
22016
92168cb0e803
removed non-Truffle code from mx.truffle/mx_truffle.py
Doug Simon <doug.simon@oracle.com>
parents:
21984
diff
changeset
|
51 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]) |
5245 | 52 |
11867 | 53 def sl(args): |
12693
c6b833f7935e
mx sl: change vm args syntax
Andreas Woess <andreas.woess@jku.at>
parents:
12647
diff
changeset
|
54 """run an SL program""" |
22016
92168cb0e803
removed non-Truffle code from mx.truffle/mx_truffle.py
Doug Simon <doug.simon@oracle.com>
parents:
21984
diff
changeset
|
55 vmArgs, slArgs = mx.extract_VM_args(args) |
92168cb0e803
removed non-Truffle code from mx.truffle/mx_truffle.py
Doug Simon <doug.simon@oracle.com>
parents:
21984
diff
changeset
|
56 mx.run_java(vmArgs + ['-cp', mx.classpath(["TRUFFLE", "com.oracle.truffle.sl"]), "com.oracle.truffle.sl.SLLanguage"] + slArgs) |
11867 | 57 |
21568
3b8bbf51d320
Truffle/Debugging: add the Truffle DebugEngine and supporting code, as well as add a crude command-line debugging tool used mainly to test the DebugEngine. Migrate the small tols out of project com.oracle.truffle.api into the new project com.oracle.truffle.tools.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
21447
diff
changeset
|
58 def sldebug(args): |
3b8bbf51d320
Truffle/Debugging: add the Truffle DebugEngine and supporting code, as well as add a crude command-line debugging tool used mainly to test the DebugEngine. Migrate the small tols out of project com.oracle.truffle.api into the new project com.oracle.truffle.tools.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
21447
diff
changeset
|
59 """run a simple command line debugger for the Simple Language""" |
22016
92168cb0e803
removed non-Truffle code from mx.truffle/mx_truffle.py
Doug Simon <doug.simon@oracle.com>
parents:
21984
diff
changeset
|
60 vmArgs, slArgs = mx.extract_VM_args(args, useDoubleDash=True) |
92168cb0e803
removed non-Truffle code from mx.truffle/mx_truffle.py
Doug Simon <doug.simon@oracle.com>
parents:
21984
diff
changeset
|
61 mx.run_java(vmArgs + ['-cp', mx.classpath("com.oracle.truffle.sl.tools"), "com.oracle.truffle.sl.tools.debug.SLREPLServer"] + slArgs) |
14769 | 62 |
22016
92168cb0e803
removed non-Truffle code from mx.truffle/mx_truffle.py
Doug Simon <doug.simon@oracle.com>
parents:
21984
diff
changeset
|
63 mx.update_commands(_suite, { |
92168cb0e803
removed non-Truffle code from mx.truffle/mx_truffle.py
Doug Simon <doug.simon@oracle.com>
parents:
21984
diff
changeset
|
64 'maven-install-truffle' : [maven_install_truffle, ''], |
92168cb0e803
removed non-Truffle code from mx.truffle/mx_truffle.py
Doug Simon <doug.simon@oracle.com>
parents:
21984
diff
changeset
|
65 'sl' : [sl, '[SL args|@VM options]'], |
92168cb0e803
removed non-Truffle code from mx.truffle/mx_truffle.py
Doug Simon <doug.simon@oracle.com>
parents:
21984
diff
changeset
|
66 'sldebug' : [sldebug, '[SL args|@VM options]'], |
92168cb0e803
removed non-Truffle code from mx.truffle/mx_truffle.py
Doug Simon <doug.simon@oracle.com>
parents:
21984
diff
changeset
|
67 }) |