1
0

Merge branch 'dev' of thibaud/antlr-compiler into master

This commit is contained in:
Thibaud Gasser 2018-10-23 19:49:04 +00:00 committed by Gogs
commit 07833dfdb1
20 changed files with 86 additions and 2 deletions

View File

@ -11,3 +11,29 @@ Summary of tools used :
Test cases are available [here](src/master/compiler/src/test/test-resources/examples)
From [this playlist](https://www.youtube.com/watch?v=2uvKTmfPNzE&list=PLOfFbVTfT2vbJ9qiw_6fWwBAmJAYV4iUm).
## [Installing third-party jars in maven](https://stackoverflow.com/a/36602256)
Define a local maven repository in folder `lib/` in pom.xml :
```xml
<repositories>
<repository>
<id>local-maven-repo</id>
<url>file:./lib</url>
</repository>
</repositories>
```
For each external jar you want to install run :
```bash
mvn deploy:deploy-file \
-DgroupId=com.example \
-DartifactId=example \
-Dversion=1.0 \
-Durl=file:./lib/ \
-DrepositoryId=local-maven-repo \
-DupdateReleaseInfo=true \
-Dfile=/path/to/file.jar
```

View File

@ -159,7 +159,7 @@ public class CompilerTest {
}
private String[] example(String name, String expectedResult) throws IllegalArgumentException {
try (InputStream in = CompilerTest.class.getClassLoader().getResourceAsStream("examples/" + name)) {
try (InputStream in = getClass().getResourceAsStream("/examples/" + name)) {
if (in == null) {
throw new IllegalArgumentException("No such example " + name);
}

View File

@ -0,0 +1 @@
ce04ccd442e778812cfe4cdc0c730e9b

View File

@ -0,0 +1 @@
c61f93bc746eff2378d0ab68d089f9ed09f257b9

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>net.jasmin</groupId>
<artifactId>jasmin</artifactId>
<version>2.4</version>
</project>

View File

@ -0,0 +1 @@
620c4f9571ddea3add17d3448a2f9cb5

View File

@ -0,0 +1 @@
a61805d8249ca32acf5f4536e8ff2b642bdc20f4

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>net.jasmin</groupId>
<artifactId>jasmin</artifactId>
<versioning>
<release>2.4</release>
<versions>
<version>2.4</version>
</versions>
<lastUpdated>20181023190639</lastUpdated>
</versioning>
</metadata>

View File

@ -0,0 +1 @@
724baa85c2239c0dd3d97fb913d44c00

View File

@ -0,0 +1 @@
906195980677661d2880101f87b7ea8a43b4e324

10
mvn-deploy-jasmin.sh Normal file
View File

@ -0,0 +1,10 @@
#! /bin/bash
mvn deploy:deploy-file \
-DgroupId=net.jasmin \
-DartifactId=jasmin \
-Dversion=2.4 \
-Durl=file:./lib/ \
-DrepositoryId=local-maven-repo \
-DupdateReleaseInfo=true \
-Dfile=./lib/jasmin.jar

View File

@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>compiler</artifactId>
<artifactId>antlr-compiler</artifactId>
<groupId>org.example</groupId>
<version>1.0-SNAPSHOT</version>
</parent>

22
pom.xml
View File

@ -17,6 +17,14 @@
<module>parser</module>
<module>compiler</module>
</modules>
<!-- https://stackoverflow.com/a/36602256 -->
<repositories>
<repository>
<id>local-maven-repo</id>
<url>file:./lib/</url>
</repository>
</repositories>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.antlr/antlr4 -->
@ -25,6 +33,20 @@
<artifactId>antlr4</artifactId>
<version>4.7.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.14.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.jasmin</groupId>
<artifactId>jasmin</artifactId>
<version>2.4</version>
</dependency>
</dependencies>
</project>