When I create a Xtext Language server, I can build it and get a .jar file. When it comes to Antlr, how do I generate a binary file with all dependencies?
I created an Antlr project in Eclipse and this is the file structure that is generated. I once created a DSL using Xtext and Gradle, and when I built the shadowJar, I got a .jar file created in *.ide/build/libs
directory.
My question is, how do I build a similar .jar or whatever file that will contain all dependencies from my new Antlr project? It is an ANTLR
project, not Xtext.
Can I simply compy and paste a gradle.build into the antlr project directory? I used the below build.gradle code I extracted from a tutorial: -
buildscript {
repositories {
maven {
name 'JFrog OSS snapshot repo'
url 'https://oss.jfrog.org/oss-snapshot-local/'
}
jcenter()
}
dependencies {
classpath 'me.champeau.gradle:antlr4-gradle-plugin:0.1.1-SNAPSHOT'
}
}
repositories {
mavenCentral()
jcenter()
}
apply plugin: 'java'
apply plugin: 'me.champeau.gradle.antlr4'
antlr4 {
source = file('src/main/antlr')
output = file('build/generated-src/me/tomassetti/pythonast/parser')
extraArgs = ['-package', 'me.tomassetti.pythonast.parser']
}
compileJava.dependsOn antlr4
sourceSets.main.java.srcDirs += antlr4.output
configurations {
compile.extendsFrom antlr4
}
task fatJar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'Python-Parser',
'Implementation-Version': '0.0.1'
}
baseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
and built a .jar file. But when I tried to use in in eclipse che as a language server, I get a timeout error. Here is the Git repo of my complete directory: https://github.com/SharkJ/AntlrProject