Select Git revision
build.gradle
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
build.gradle 5.33 KiB
import org.gradle.api.tasks.testing.logging.TestLogEvent
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'eclipse'
apply plugin: 'idea'
project.version = '0.1.0-SNAPSHOT' // If no snapshot, adapt ANTLR parser tag to git revision
project.group = 'de.hhu.stups'
repositories {
mavenCentral()
maven {
name = "snapshots"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
implementation group: 'org.antlr', name: 'ST4', version: '4.3.3'
implementation group: "de.hhu.stups", name: "antlr-parser", version: "0.1.0-SNAPSHOT"
implementation group: 'org.clojure', name: 'clojure', version: '1.6.0'
implementation group: "com.fatboyindustrial.gson-javatime-serialisers", name: "gson-javatime-serialisers", version: "1.1.1"
implementation group: "com.google.code.gson", name: "gson", version: "2.8.6"
implementation group: 'commons-cli', name: 'commons-cli', version: '1.5.0'
testImplementation 'junit:junit:4.13.2'
}
java {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
application {
mainClass = 'de.hhu.stups.codegenerator.CodeGenerator'
}
// The JavaScript tests currently cannot run in parallel,
// because multiple tests copy files to the same location and conflict with each other.
final noParallelTests = [
"de.hhu.stups.codegenerator.js.*",
]
test {
// Execute tests in parallel where possible, as recommended here:
// https://docs.gradle.org/8.12/userguide/performance.html#execute_tests_in_parallel
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
filter {
excludePatterns += noParallelTests
}
}
final testNoParallel = tasks.register("testNoParallel", Test) {
description = "Runs tests that cannot be executed in parallel."
group = "verification"
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
filter {
includePatterns += noParallelTests
}
}
tasks.named("check").configure {
dependsOn += [testNoParallel]
}
tasks.withType(Test).configureEach {
testLogging {
events += [TestLogEvent.PASSED]
}
}
jar {
manifest {
attributes(
'Main-Class': 'de.hhu.stups.codegenerator.CodeGenerator'
)
}
}
task fatJar(type: Jar) {
archiveBaseName = project.name + '-all'
manifest {
attributes(
'Main-Class': 'de.hhu.stups.codegenerator.CodeGenerator'
)
}
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
{
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
exclude "META-INF/*.md"
exclude "module-info.class"
}
with jar
}
sourceSets.main.java.srcDirs = ['src/main/java']
sourceSets.test.runtimeClasspath += files(sourceSets.main.java.srcDirs)
tasks.withType(JavaExec) {
if(project.hasProperty('language') && project.hasProperty('file')) {
def arguments = []
arguments.add('-l')
arguments.add(language)
arguments.add('-bi')
if(project.hasProperty('big_integer')) {
arguments.add(big_integer)
} else {
arguments.add(false)
}
arguments.add('-min')
if(project.hasProperty('minint')) {
arguments.add(minint)
} else {
arguments.add(-2147483648)
}
arguments.add('-max')
if(project.hasProperty('maxint')) {
arguments.add(maxint)
} else {
arguments.add(2147483647)
}
arguments.add('-dss')
if(project.hasProperty('deferred_set_size')) {
arguments.add(deferred_set_size)
} else {
arguments.add(10)
}
arguments.add('-cs')
if(project.hasProperty('useConstraintSolving')) {
arguments.add(useConstraintSolving)
} else {
arguments.add(false)
}
arguments.add('-mc')
if(project.hasProperty('forModelchecking')) {
arguments.add(forModelchecking)
} else {
arguments.add(false)
}
arguments.add('-f')
arguments.add(file)
arguments.add('-v')
if(project.hasProperty('visualisation')) {
arguments.add(visualisation)
} else {
arguments.add('')
}
arguments.add('-sim')
if(project.hasProperty('simulation')) {
arguments.add(simulation)
} else {
arguments.add('')
}
arguments.add('-a')
if(project.hasProperty('addition')) {
arguments.add(addition)
} else {
arguments.add("")
}
arguments.add('-sl')
if(project.hasProperty('serverLink')) {
arguments.add(serverLink)
} else {
arguments.add("")
}
args(arguments)
}
def env_vars = ['LD_LIBRARY_PATH' : ("$System.env.LD_LIBRARY_PATH" + System.getProperty("path.separator") + "$projectDir/"),
'DYLD_LIBRARY_PATH': ("$System.env.DYLD_LIBRARY_PATH" + System.getProperty("path.separator") + "$projectDir/"),
'PATH' : ("$System.env.PATH" + System.getProperty("path.separator") + "$projectDir/")]
environment env_vars
systemProperty "java.library.path", "./"
}