Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Package NQP runtime into a JAR.
Preferable to having dozens of .class files to load.
  • Loading branch information
jnthn committed Apr 14, 2013
1 parent 140c9ba commit f073947
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Makefile
@@ -1,6 +1,7 @@
NQP = nqp
PARROT = parrot
JAVAC = javac
JAR = jar
PERL = perl
PROVE = prove

Expand Down Expand Up @@ -29,6 +30,7 @@ all: $(NQPLIBS)
bin: $(JAVAS)
$(PERL) -MExtUtils::Command -e mkpath bin
$(JAVAC) -source 1.7 -cp 3rdparty/asm/asm-debug-all-4.1.jar -g -d bin $(JAVAS)
$(JAR) cf0 nqp-runtime.jar -C bin/ .

test: all
$(PROVE) --exec=$(NQP) t/jast/*.t t/qast/*.t
Expand All @@ -37,7 +39,7 @@ nqptest: all
$(PROVE) --exec="$(NQP) nqp-jvm-cc.nqp" t/nqp/*.t

selftest: all
$(PROVE) --exec="java -cp .;bin;3rdparty/asm/asm-4.1.jar NQPJVM" t/nqp/*.t t/serialization/*.t
$(PROVE) --exec="java -cp .;nqp-runtime.jar;3rdparty/asm/asm-4.1.jar NQPJVM" t/nqp/*.t t/serialization/*.t

clean:
$(PERL) -MExtUtils::Command -e rm_rf bin *.pir *.pbc *.class *.dump
Expand Down
2 changes: 1 addition & 1 deletion nqp-jvm-cc.nqp
Expand Up @@ -83,7 +83,7 @@ class HLL::Backend::JVM {
my $name := %*COMPILING<%?OPTIONS><javaclass>;
-> {
run('java',
'-cp ' ~ pathlist('.', 'bin', '3rdparty/asm/asm-4.1.jar'),
'-cp ' ~ pathlist('.', 'nqp-runtime.jar', '3rdparty/asm/asm-4.1.jar'),
$name);
unlink($name ~ '.class');
}
Expand Down
6 changes: 3 additions & 3 deletions t/helper.nqp
Expand Up @@ -7,7 +7,7 @@ sub jast_test($jast_maker, $exercise, $expected, $desc = '') is export {
$jast_maker($c);
spurt('jastdump.temp', $c.dump());
run('java',
'-cp ' ~ pathlist('bin', '3rdparty/asm/asm-4.1.jar'),
'-cp ' ~ pathlist('nqp-runtime.jar', '3rdparty/asm/asm-4.1.jar'),
'org/perl6/nqp/jast2bc/JASTToJVMBytecode',
'jastdump.temp', 'JASTTest.class');
# Compile the test program.
Expand Down Expand Up @@ -49,13 +49,13 @@ sub run_qast($qast) is export {
my $dump := $jast.dump();
spurt('QAST2JASTOutput.dump', $dump);
run('java',
'-cp ' ~ pathlist('bin', '3rdparty/asm/asm-4.1.jar'),
'-cp ' ~ pathlist('nqp-runtime.jar', '3rdparty/asm/asm-4.1.jar'),
'org/perl6/nqp/jast2bc/JASTToJVMBytecode',
'QAST2JASTOutput.dump', 'QAST2JASTOutput.class');

my $before := pir::time__N;
my $spawn_result := pir::spawnw__Is('java ' ~
'-cp ' ~ pathlist('.', 'bin', '3rdparty/asm/asm-4.1.jar') ~
'-cp ' ~ pathlist('.', 'nqp-runtime.jar', '3rdparty/asm/asm-4.1.jar') ~
' QAST2JASTOutput' ~
'> QAST2JASTOutput.output');
my $after := pir::time__N;
Expand Down

0 comments on commit f073947

Please sign in to comment.