Skip to content

Commit 2b05bf3

Browse files
spoon search for classpath, new versions
1 parent 6089043 commit 2b05bf3

File tree

3 files changed

+46
-5
lines changed

3 files changed

+46
-5
lines changed

liquidjava-api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<groupId>liquidjava-api</groupId>
1313
<artifactId>liquidjava-api</artifactId>
14-
<version>0.0.1-SNAPSHOT</version>
14+
<version>0.0.2-SNAPSHOT</version>
1515
<name>liquidjava-api</name>
1616
<packaging>jar</packaging>
1717

liquidjava-verifier/pom.xml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<groupId>liquidjava-verifier
1313
</groupId>
1414
<artifactId>liquidjava-verifier</artifactId>
15-
<version>0.0.1-SNAPSHOT</version>
15+
<version>5.2-SNAPSHOT</version>
1616
<name>liquidjava-verifier</name>
1717
<packaging>jar</packaging>
1818

@@ -64,6 +64,36 @@
6464
</execution>
6565
</executions>
6666
</plugin>
67+
<plugin>
68+
<groupId>org.apache.maven.plugins</groupId>
69+
<artifactId>maven-shade-plugin</artifactId>
70+
<version>3.2.4</version>
71+
<executions>
72+
<execution>
73+
<phase>package</phase>
74+
<goals>
75+
<goal>shade</goal>
76+
</goals>
77+
<configuration>
78+
<transformers>
79+
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
80+
<mainClass>liquidjava.api.CommandLineLauncher</mainClass>
81+
</transformer>
82+
</transformers>
83+
<filters>
84+
<filter>
85+
<artifact>*:*</artifact>
86+
<excludes>
87+
<exclude>META-INF/*.SF</exclude>
88+
<exclude>META-INF/*.DSA</exclude>
89+
<exclude>META-INF/*.RSA</exclude>
90+
</excludes>
91+
</filter>
92+
</filters>
93+
</configuration>
94+
</execution>
95+
</executions>
96+
</plugin>
6797
</plugins>
6898
</build>
6999

@@ -116,7 +146,11 @@
116146
<artifactId>junit-jupiter-params</artifactId>
117147
<scope>test</scope>
118148
</dependency>
119-
149+
<dependency>
150+
<groupId>ch.qos.logback</groupId>
151+
<artifactId>logback-classic</artifactId>
152+
<version>1.4.11</version>
153+
</dependency>
120154
<dependency>
121155
<groupId>org.mdkt.compiler</groupId>
122156
<artifactId>InMemoryJavaCompiler</artifactId>

liquidjava-verifier/src/main/java/liquidjava/api/CommandLineLauncher.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package liquidjava.api;
22

3+
import java.io.File;
4+
35
import liquidjava.errors.ErrorEmitter;
46
import liquidjava.processor.RefinementProcessor;
57
import spoon.Launcher;
@@ -10,7 +12,7 @@
1012

1113
public class CommandLineLauncher {
1214
public static void main(String[] args) {
13-
String allPath = "./liquidjava-example/src/main/java/test/currentlyTesting";
15+
String allPath = "./liquidjava-example/src/main/java/test/currentlyTesting";
1416

1517
// String allPath = "C://Regen/test-projects/src/Main.java";
1618
// In eclipse only needed this:"../liquidjava-example/src/main/java/"
@@ -30,7 +32,12 @@ public static ErrorEmitter launchTest(String file) {
3032
public static ErrorEmitter launch(String file) {
3133
Launcher launcher = new Launcher();
3234
launcher.addInputResource(file);
33-
launcher.getEnvironment().setNoClasspath(true);
35+
// launcher.getEnvironment().setNoClasspath(true);
36+
37+
// Get the current classpath from the system
38+
String classpath = System.getProperty("java.class.path");
39+
launcher.getEnvironment().setSourceClasspath(classpath.split(File.pathSeparator));
40+
3441
// optional
3542
// launcher.getEnvironment().setSourceClasspath(
3643
// "lib1.jar:lib2.jar".split(":"));

0 commit comments

Comments
 (0)