Skip to content
Snippets Groups Projects
Commit 0c2e714a authored by René Schöne's avatar René Schöne
Browse files

Publish uses jar instead of components.java.

- moved some bits to convention plugins
parent d6464f0f
No related branches found
No related tags found
No related merge requests found
......@@ -6,3 +6,7 @@ plugins {
dependencies {
api group: 'net.sf.beaver', name: 'beaver-rt', version: '0.9.11'
}
File genSrc = file("src/gen/java")
sourceSets.main.java.srcDir genSrc
idea.module.generatedSourceDirs += genSrc
......@@ -15,20 +15,46 @@ dependencies {
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: "${jupiter_version}"
}
tasks.named('test') {
useJUnitPlatform()
jar {
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
def versionFile = "src/main/resources/${project.getName()}Version.properties"
def oldProps = new Properties()
try {
file(versionFile).withInputStream { stream -> oldProps.load(stream) }
version = oldProps['version']
} catch (e) {
// this happens, if either the properties file is not present, or cannot be read from
throw new GradleException("File ${versionFile} not found or unreadable. Aborting.", e)
}
task printVersion() {
doLast {
println(version)
}
}
task newVersion() {
doFirst {
def props = new Properties()
props['version'] = value
props.store(file(versionFile).newWriter(), null)
}
}
//679
publishing {
publications {
maven(MavenPublication) {
// artifactId = 'dumpAst | dumpAstWithPlantuml | grammar2uml'
groupId = 'de.tudresden.inf.st'
from components.java
// artifact("build/libs/ragconnect-${version}.jar") {
// extension 'jar'
// }
// from components.java
artifact("build/libs/${project.getName()}-${project.getVersion()}.jar") {
extension 'jar'
}
}
}
repositories {
......
......@@ -18,37 +18,6 @@ dependencies {
implementation group: 'com.github.spullara.mustache.java', name: 'compiler', version: "${mustache_java_version}"
}
def versionFile = 'src/main/resources/dumpAstVersion.properties'
def oldProps = new Properties()
try {
file(versionFile).withInputStream { stream -> oldProps.load(stream) }
version = oldProps['version']
} catch (e) {
// this happens, if either the properties file is not present, or cannot be read from
throw new GradleException("File ${versionFile} not found or unreadable. Aborting.", e)
}
task newVersion() {
doFirst {
def props = new Properties()
props['version'] = value
props.store(file(versionFile).newWriter(), null)
}
}
jar {
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
archiveBaseName = 'dumpAst'
}
File genSrc = file("src/gen/java")
sourceSets.main.java.srcDir genSrc
idea.module.generatedSourceDirs += genSrc
File dumpAstGrammar = file('./src/main/jastadd/DumpAst.relast')
File mustacheGrammar = file('./src/main/jastadd/mustache/Mustache.relast')
......
......@@ -19,32 +19,6 @@ dependencies {
implementation group: 'com.github.spullara.mustache.java', name: 'compiler', version: "${mustache_java_version}"
}
def versionFile = '../dumpAst/src/main/resources/dumpAstVersion.properties'
def oldProps = new Properties()
try {
file(versionFile).withInputStream { stream -> oldProps.load(stream) }
version = oldProps['version']
} catch (e) {
// this happens, if either the properties file is not present, or cannot be read from
throw new GradleException("File ${versionFile} not found or unreadable. Aborting.", e)
}
jar {
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
archiveBaseName = 'dumpAst-plantuml'
}
// include resources of base dumpAst
sourceSets.main.resources.srcDirs += "../dumpAst/src/main/resources"
File genSrc = file("src/gen/java")
sourceSets.main.java.srcDir genSrc
idea.module.generatedSourceDirs += genSrc
File dumpAstGrammar = file('../dumpAst/src/main/jastadd/DumpAst.relast')
task relast(type: JavaExec) {
......
../../../../dumpAst/src/main/resources/dumpAstVersion.properties
\ No newline at end of file
......@@ -16,48 +16,18 @@ apply plugin: 'jastadd'
application.mainClassName = 'de.tudresden.inf.st.jastadd.grammar2uml.compiler.Compiler'
dependencies {
implementation project(':relast.preprocessor')
implementation group: 'com.github.spullara.mustache.java', name: 'compiler', version: "${mustache_java_version}"
runtime group: 'org.jastadd', name: 'jastadd', version: '2.3.4'
}
def versionFile = 'src/main/resources/grammar2umlVersion.properties'
def oldProps = new Properties()
try {
file(versionFile).withInputStream { stream -> oldProps.load(stream) }
version = oldProps['version']
} catch (e) {
// this happens, if either the properties file is not present, or cannot be read from
throw new GradleException("File ${versionFile} not found or unreadable. Aborting.", e)
}
task newVersion() {
doFirst {
def props = new Properties()
props['version'] = value
props.store(file(versionFile).newWriter(), null)
}
}
jar {
manifest {
attributes "Main-Class": application.mainClassName
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
// configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
archiveBaseName = 'grammar2uml'
}
dependencies {
implementation project(':relast.preprocessor')
File genSrc = file("src/gen/java")
sourceSets.main.java.srcDir genSrc
idea.module.generatedSourceDirs += genSrc
implementation group: 'com.github.spullara.mustache.java', name: 'compiler', version: "${mustache_java_version}"
runtime group: 'org.jastadd', name: 'jastadd', version: '2.3.4'
}
File preprocessorGrammar = file('../relast.preprocessor/src/main/jastadd/RelAst.relast')
File grammar2umlGrammar = file('./src/main/jastadd/Grammar2Uml.relast')
......
......@@ -16,10 +16,6 @@ dependencies {
testImplementation project(':dumpAst')
}
File genSrc = file("src/gen/java")
sourceSets.main.java.srcDir genSrc
idea.module.generatedSourceDirs += genSrc
File testingGrammar = file('./src/main/jastadd/testDumper.relast')
task relast(type: JavaExec) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment