forked from JavaTX/JavaCompilerCore
Compare commits
2 Commits
a84d1ffdd7
...
f093edb74f
Author | SHA1 | Date | |
---|---|---|---|
f093edb74f | |||
8ea459fcd7 |
BIN
JavaTXcompiler-0.1-jar-with-dependencies.jar
Normal file
BIN
JavaTXcompiler-0.1-jar-with-dependencies.jar
Normal file
Binary file not shown.
41
makefile
Normal file
41
makefile
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
JFLAGS = -g
|
||||||
|
JC = javac
|
||||||
|
|
||||||
|
JTX = JavaTXcompiler-0.1-jar-with-dependencies.jar
|
||||||
|
|
||||||
|
SRCDIR = src/main/java
|
||||||
|
DESTDIR = out
|
||||||
|
|
||||||
|
# Use find to locate all .java files recursively
|
||||||
|
JAVASOURCES := $(shell find $(SRCDIR) -name '*.java')
|
||||||
|
JAVSOURCES := $(shell find $(SRCDIR) -name '*.jav')
|
||||||
|
|
||||||
|
# Convert .java files to .class files with the same directory structure
|
||||||
|
JAVACLASSES := $(patsubst $(SRCDIR)/%.java,$(DESTDIR)/%.class,$(JAVASOURCES))
|
||||||
|
JAVCLASSES := $(patsubst $(SRCDIR)/%.jav,$(DESTDIR)/%.class,$(JAVSOURCES))
|
||||||
|
|
||||||
|
# Create a list of directories that need to be created in the destination directory
|
||||||
|
DIRS := $(sort $(dir $(JAVACLASSES))) $(sort $(dir $(JAVCLASSES)))
|
||||||
|
|
||||||
|
all:
|
||||||
|
@echo "$(JAVCLASSES)"
|
||||||
|
|
||||||
|
default: classes
|
||||||
|
|
||||||
|
# Rule for creating directories
|
||||||
|
$(DIRS):
|
||||||
|
@mkdir -p $@
|
||||||
|
|
||||||
|
|
||||||
|
# Rule for compiling jav files
|
||||||
|
$(DESTDIR)/%.class: $(SRCDIR)/%.jav | $(DIRS)
|
||||||
|
java -jar $(JTX) -d $(DESTDIR) -cp "src/main/java:target/dependencies/" $<
|
||||||
|
|
||||||
|
#rule for compiling java files
|
||||||
|
$(DESTDIR)/%.class: $(SRCDIR)/%.java | $(DIRS)
|
||||||
|
$(JC) -nowarn -d $(DESTDIR) -cp "src/main/java:out:target/dependencies/*" $(JFLAGS) $<
|
||||||
|
|
||||||
|
classes: $(JAVCLASSES) $(JAVACLASSES)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(RM) -r $(DESTDIR)
|
20
pom.xml
20
pom.xml
@ -48,6 +48,23 @@ http://maven.apache.org/maven-v4_0_0.xsd">
|
|||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
|
<version>3.1.2</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>copy-dependencies</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-dependencies</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${project.build.directory}/dependencies</outputDirectory>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
@ -73,6 +90,9 @@ http://maven.apache.org/maven-v4_0_0.xsd">
|
|||||||
<groupId>org.antlr</groupId>
|
<groupId>org.antlr</groupId>
|
||||||
<artifactId>antlr4-maven-plugin</artifactId>
|
<artifactId>antlr4-maven-plugin</artifactId>
|
||||||
<version>4.11.1</version>
|
<version>4.11.1</version>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${project.basedir}/src/main/java</outputDirectory>
|
||||||
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>antlr</id>
|
<id>antlr</id>
|
||||||
|
Loading…
Reference in New Issue
Block a user