MESSAGE
DATE | 2016-04-28 |
FROM | Christopher League
|
SUBJECT | Subject: [Hangout-NYLXS] how to build/run assn7/8 from cmdline
|
From hangout-bounces-at-nylxs.com Thu Apr 28 19:25:17 2016 Return-Path: X-Original-To: archive-at-mrbrklyn.com Delivered-To: archive-at-mrbrklyn.com Received: from www.mrbrklyn.com (www.mrbrklyn.com [96.57.23.82]) by mrbrklyn.com (Postfix) with ESMTP id 39417163D44; Thu, 28 Apr 2016 19:25:17 -0400 (EDT) X-Original-To: hangout-at-nylxs.com Delivered-To: hangout-at-nylxs.com Received: by mrbrklyn.com (Postfix, from userid 1000) id E928C162A0A; Thu, 28 Apr 2016 19:25:14 -0400 (EDT) Resent-From: Ruben Safir Resent-Date: Thu, 28 Apr 2016 19:25:14 -0400 Resent-Message-ID: <20160428232514.GA24199-at-www.mrbrklyn.com> Resent-To: hangout-at-nylxs.com X-Original-To: ruben-at-mrbrklyn.com Delivered-To: ruben-at-mrbrklyn.com Received: from B-EXH-EDGE1.liunet.edu (b-edge1.smtp.liu.edu [148.4.248.206]) by mrbrklyn.com (Postfix) with ESMTP id 772A2161224 for ; Thu, 28 Apr 2016 09:13:24 -0400 (EDT) Received: from B-EXH-3.liunet.edu (148.4.250.212) by B-EXH-EDGE1.liunet.edu (148.4.248.206) with Microsoft SMTP Server (TLS) id 14.3.210.2; Thu, 28 Apr 2016 09:13:14 -0400 Received: from localhost (96.250.202.133) by B-EXH-3.liunet.edu (148.4.250.212) with Microsoft SMTP Server (TLS) id 15.0.1156.6; Thu, 28 Apr 2016 09:13:23 -0400 From: Christopher League To: Ruben Safir User-Agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-unknown-linux-gnu) Date: Thu, 28 Apr 2016 09:13:14 -0400 Message-ID: <87vb31op05.fsf-at-lydrik.home.lan> MIME-Version: 1.0 X-Originating-IP: [96.250.202.133] X-ClientProxiedBy: U-EXH-CAS.liunet.edu (148.4.184.26) To B-EXH-3.liunet.edu (148.4.250.212) X-UID: 19856 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Subject: [Hangout-NYLXS] how to build/run assn7/8 from cmdline X-BeenThere: hangout-at-nylxs.com X-Mailman-Version: 2.1.17 Precedence: list Reply-To: NYLXS Discussions List List-Id: NYLXS Discussions List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============0389114296==" Errors-To: hangout-bounces-at-nylxs.com Sender: "hangout"
--===============0389114296== Content-Type: multipart/signed; boundary="===-=-="; micalg=pgp-sha256; protocol="application/pgp-signature"
--===-=-= Content-Type: multipart/alternative; boundary="==-=-="
--==-=-= Content-Type: text/plain
Got something I think you'll prefer. I made an alternative version of the assn7 code where all the java sources are in the top-level directory. Then, instead of gradle, I defined and documented a relatively simple Makefile that can build and run it. See here:
In the Makefile, you'll probably have to customize the locations of the jars for ANTLR and JUNIT -- the two variables right at the top. That's where they were on my system due to loading them into IntelliJ. If your CLASSPATH environent var already contains the jars for ANTLR and JUNIT then you can probably just ignore those a make the JARS variable empty, or set it to '.'
The output of the test cases should be way more usable than what gradle does.
Apart from the Makefile and changing the directory structure, all the Java source in assn7-one-dir is exactly the same as in the assn7 dir... except the main method added to TestRunExpect to compensate for jUnit's shitty console output.
CL
~~~~ {.makefile} # Minimal-ish makefile to build assn7-8 with sources in a single directory # Use 'make run' to do interactive translation from stdin (ConvertToIR.main) # Use 'make test' to run all test-cases in run-expect (TestRunExpect.main)
# We need these jars; specify locations on your system (or set CLASSPATH) ANTLRJAR=$(HOME)/.m2/repository/org/antlr/antlr4-runtime/4.5.3/antlr4-runtime-4.5.3.jar JUNIT=$(HOME)/.m2/repository/junit/junit/4.12/junit-4.12.jar
JARS=$(ANTLRJAR):$(JUNIT)
# .class files go in a subdir for cleanliness BUILD=build # Interactive translation from stdin MAINPROG=ConvertToIR # Translate files from examples/run-expect/ TESTPROG=TestRunExpect
# You can override these commands if needed ANTLR=antlr4 -visitor -package calc.grammar JAVAC=javac -d $(BUILD) -cp .:$(JARS) JAVA=java -cp .:$(BUILD):$(JARS)
default: CalcLangParser.java $(BUILD)/$(MAINPROG).class
run: default $(JAVA) $(MAINPROG)
test: default $(JAVA) $(TESTPROG)
CalcLangParser.java: CalcLang.g4 $(ANTLR) $<
$(BUILD)/%.class: *.java mkdir -p $(BUILD) && $(JAVAC) *.java
clean: $(RM) *.tokens CalcLang*.java *.class $(BUILD)/*.class
.PHONY: default run test clean ~~~~
--==-=-= MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"
Got something I think you'll prefer. I made an alternative version of the assn7 code where all the java sources are in the top-level directory. Then, instead of gradle, I defined and documented a relatively simple Makefile that can build and run it. See here: [1]https://git.liucs.net/cs664s16/cs664pub/tree/master/assn7-one-dir
In the Makefile, you'll probably have to customize the locations of the jars for ANTLR and JUNIT - the two variables right at the top. That's where they were on my system due to loading them into IntelliJ. If your CLASSPATH environent var already contains the jars for ANTLR and JUNIT then you can probably just ignore those a make the JARS variable empty, or set it to `.'
The output of the test cases should be way more usable than what gradle does.
Apart from the Makefile and changing the directory structure, all the Java source in assn7-one-dir is exactly the same as in the assn7 dir... except the main method added to TestRunExpect to compensate for jUnit's shitty console output.
CL
# Minimal-ish makefile to build assn7-8 with sources in a single directory # Use 'make run' to do interactive translation from stdin (ConvertToIR.main) # Use 'make test' to run all test-cases in run-expect (TestRunExpect.main)
# We need these jars; specify locations on your system (or set CLASSPATH) ANTLRJAR=$(HOME)/.m2/repository/org/antlr/antlr4-runtime/4.5.3/antlr4-runtime-4. 5.3.jar JUNIT=$(HOME)/.m2/repository/junit/junit/4.12/junit-4.12.jar
JARS=$(ANTLRJAR):$(JUNIT)
# .class files go in a subdir for cleanliness BUILD=build # Interactive translation from stdin MAINPROG=ConvertToIR # Translate files from examples/run-expect/ TESTPROG=TestRunExpect
# You can override these commands if needed ANTLR=antlr4 -visitor -package calc.grammar JAVAC=javac -d $(BUILD) -cp .:$(JARS) JAVA=java -cp .:$(BUILD):$(JARS)
default: CalcLangParser.java $(BUILD)/$(MAINPROG).class
run: default $(JAVA) $(MAINPROG)
test: default $(JAVA) $(TESTPROG)
CalcLangParser.java: CalcLang.g4 $(ANTLR) $<
$(BUILD)/%.class: *.java mkdir -p $(BUILD) && $(JAVAC) *.java
clean: $(RM) *.tokens CalcLang*.java *.class $(BUILD)/*.class
.PHONY: default run test clean
References
1. https://git.liucs.net/cs664s16/cs664pub/tree/master/assn7-one-dir
--==-=-=--
--===-=-= Content-Type: application/pgp-signature; name="signature.asc"
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2
iQEcBAEBCAAGBQJXIgxqAAoJEGuLsz1PMbCL2QkIAJxeVLpMKlM3RRzA1ytGMMId 0SIbainpicsKzfdw7STo+LWPUTu8gRzrYBENrj2SxdMh+UpZ3WfKyr3H0gmrqjl4 RwmXWvZgR/rO6FvRSrCzxAFY+/29kA5Yxgl1qrXLORgIl8PzAoK+onBugdMepslw NH3QwDFXMCLh0YEoxepGGX6aKsla7SFQXruC5/NNlV3Ig2TMoo5xHlWgpSKhWlyh TuZYcVcvxvldI65ODg48VlpNoLJg77VdzNSMdMkKNhJXISaTGXGuniPpoAeEEWmo KkhnV6lmU6B5z7uqJC4gGRfZ5/S3bTXUy8z+Tck56fKsi7H4ZP4/dd/seoUBIJM= =uu8Y -----END PGP SIGNATURE----- --===-=-=--
--===============0389114296== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline
_______________________________________________ hangout mailing list hangout-at-nylxs.com http://www.nylxs.com/ --===============0389114296==--
--===============0389114296== Content-Type: multipart/signed; boundary="===-=-="; micalg=pgp-sha256; protocol="application/pgp-signature"
--===-=-= Content-Type: multipart/alternative; boundary="==-=-="
--==-=-= Content-Type: text/plain
Got something I think you'll prefer. I made an alternative version of the assn7 code where all the java sources are in the top-level directory. Then, instead of gradle, I defined and documented a relatively simple Makefile that can build and run it. See here:
In the Makefile, you'll probably have to customize the locations of the jars for ANTLR and JUNIT -- the two variables right at the top. That's where they were on my system due to loading them into IntelliJ. If your CLASSPATH environent var already contains the jars for ANTLR and JUNIT then you can probably just ignore those a make the JARS variable empty, or set it to '.'
The output of the test cases should be way more usable than what gradle does.
Apart from the Makefile and changing the directory structure, all the Java source in assn7-one-dir is exactly the same as in the assn7 dir... except the main method added to TestRunExpect to compensate for jUnit's shitty console output.
CL
~~~~ {.makefile} # Minimal-ish makefile to build assn7-8 with sources in a single directory # Use 'make run' to do interactive translation from stdin (ConvertToIR.main) # Use 'make test' to run all test-cases in run-expect (TestRunExpect.main)
# We need these jars; specify locations on your system (or set CLASSPATH) ANTLRJAR=$(HOME)/.m2/repository/org/antlr/antlr4-runtime/4.5.3/antlr4-runtime-4.5.3.jar JUNIT=$(HOME)/.m2/repository/junit/junit/4.12/junit-4.12.jar
JARS=$(ANTLRJAR):$(JUNIT)
# .class files go in a subdir for cleanliness BUILD=build # Interactive translation from stdin MAINPROG=ConvertToIR # Translate files from examples/run-expect/ TESTPROG=TestRunExpect
# You can override these commands if needed ANTLR=antlr4 -visitor -package calc.grammar JAVAC=javac -d $(BUILD) -cp .:$(JARS) JAVA=java -cp .:$(BUILD):$(JARS)
default: CalcLangParser.java $(BUILD)/$(MAINPROG).class
run: default $(JAVA) $(MAINPROG)
test: default $(JAVA) $(TESTPROG)
CalcLangParser.java: CalcLang.g4 $(ANTLR) $<
$(BUILD)/%.class: *.java mkdir -p $(BUILD) && $(JAVAC) *.java
clean: $(RM) *.tokens CalcLang*.java *.class $(BUILD)/*.class
.PHONY: default run test clean ~~~~
--==-=-= MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"
Got something I think you'll prefer. I made an alternative version of the assn7 code where all the java sources are in the top-level directory. Then, instead of gradle, I defined and documented a relatively simple Makefile that can build and run it. See here: [1]https://git.liucs.net/cs664s16/cs664pub/tree/master/assn7-one-dir
In the Makefile, you'll probably have to customize the locations of the jars for ANTLR and JUNIT - the two variables right at the top. That's where they were on my system due to loading them into IntelliJ. If your CLASSPATH environent var already contains the jars for ANTLR and JUNIT then you can probably just ignore those a make the JARS variable empty, or set it to `.'
The output of the test cases should be way more usable than what gradle does.
Apart from the Makefile and changing the directory structure, all the Java source in assn7-one-dir is exactly the same as in the assn7 dir... except the main method added to TestRunExpect to compensate for jUnit's shitty console output.
CL
# Minimal-ish makefile to build assn7-8 with sources in a single directory # Use 'make run' to do interactive translation from stdin (ConvertToIR.main) # Use 'make test' to run all test-cases in run-expect (TestRunExpect.main)
# We need these jars; specify locations on your system (or set CLASSPATH) ANTLRJAR=$(HOME)/.m2/repository/org/antlr/antlr4-runtime/4.5.3/antlr4-runtime-4. 5.3.jar JUNIT=$(HOME)/.m2/repository/junit/junit/4.12/junit-4.12.jar
JARS=$(ANTLRJAR):$(JUNIT)
# .class files go in a subdir for cleanliness BUILD=build # Interactive translation from stdin MAINPROG=ConvertToIR # Translate files from examples/run-expect/ TESTPROG=TestRunExpect
# You can override these commands if needed ANTLR=antlr4 -visitor -package calc.grammar JAVAC=javac -d $(BUILD) -cp .:$(JARS) JAVA=java -cp .:$(BUILD):$(JARS)
default: CalcLangParser.java $(BUILD)/$(MAINPROG).class
run: default $(JAVA) $(MAINPROG)
test: default $(JAVA) $(TESTPROG)
CalcLangParser.java: CalcLang.g4 $(ANTLR) $<
$(BUILD)/%.class: *.java mkdir -p $(BUILD) && $(JAVAC) *.java
clean: $(RM) *.tokens CalcLang*.java *.class $(BUILD)/*.class
.PHONY: default run test clean
References
1. https://git.liucs.net/cs664s16/cs664pub/tree/master/assn7-one-dir
--==-=-=--
--===-=-= Content-Type: application/pgp-signature; name="signature.asc"
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2
iQEcBAEBCAAGBQJXIgxqAAoJEGuLsz1PMbCL2QkIAJxeVLpMKlM3RRzA1ytGMMId 0SIbainpicsKzfdw7STo+LWPUTu8gRzrYBENrj2SxdMh+UpZ3WfKyr3H0gmrqjl4 RwmXWvZgR/rO6FvRSrCzxAFY+/29kA5Yxgl1qrXLORgIl8PzAoK+onBugdMepslw NH3QwDFXMCLh0YEoxepGGX6aKsla7SFQXruC5/NNlV3Ig2TMoo5xHlWgpSKhWlyh TuZYcVcvxvldI65ODg48VlpNoLJg77VdzNSMdMkKNhJXISaTGXGuniPpoAeEEWmo KkhnV6lmU6B5z7uqJC4gGRfZ5/S3bTXUy8z+Tck56fKsi7H4ZP4/dd/seoUBIJM= =uu8Y -----END PGP SIGNATURE----- --===-=-=--
--===============0389114296== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline
_______________________________________________ hangout mailing list hangout-at-nylxs.com http://www.nylxs.com/ --===============0389114296==--
|
|