Commit 52e02a2a authored by Juergen Haug's avatar Juergen Haug Committed by Jan Belle
Browse files

verify java 8 compatibility, update gradle

Change-Id: Ib210afaede06e0762d3522b83b5b023e61b234e4
parent 4fc38770
......@@ -22,24 +22,21 @@ dependencies {
}
def outputDir = "$buildDir/log"
def srcGenDir = "$buildDir/src-gen"
/**
* Creates an eTrice generator task.
* @param name the name of the new task
* @param lang one of the following languages 'c', 'cpp', 'java'
* @param modelDirs a list of model directories passed to the generator
* @param genDir the generation directory
* @param options the eTrice generator options
* @return the generator task
*/
ext.createGenerateTask = { name, lang, modelDirs, genDir = 'src-gen', options = [] ->
ext.createGenerateTask = { name, lang, modelDirs, options = [] ->
return modelSet.create(name) {
module = "etrice-$lang"
source.srcDir modelDirs
source.include '**/*.room', '**/*.etmap', '**/*.etphys', '**/*.config'
modelpath.from configurations."modelpath_$lang"
genDir = project.layout.projectDirectory.file(genDir)
option 'msc_instr'
options.each { option it }
}.generateTask
......@@ -58,7 +55,7 @@ ext.createEtUnitConverterTask = { name, etuFiles, args = [] ->
}
}
def getMainClass(String genDir) {
def getMainClass(genDir) {
// search for SubSystemRunner java file
def mainFile = fileTree(genDir, { include '**/*Runner.java' }).getSingleFile()
// relativize path to generation directory
......@@ -82,11 +79,9 @@ def getMainClass(String genDir) {
ext.createBuild = { lang, name, modelDirs, options = [] ->
def nameCap = name.capitalize()
def genDir = "$srcGenDir/$name"
def workingDir = "$outputDir/$name"
def generateTask = createGenerateTask(name, lang, modelDirs, genDir, options)
def generateTask = createGenerateTask(name, lang, modelDirs, options)
def genDir = generateTask.map { it.genDir }
def runTask
if(lang == 'c' || lang == 'cpp') {
......@@ -141,7 +136,6 @@ ext.createBuild = { lang, name, modelDirs, options = [] ->
add "${name}Implementation", project(':runtime:org.eclipse.etrice.runtime.java')
}
tasks.getByName("compile${nameCap}Java").dependsOn generateTask
build.dependsOn "${name}Classes"
runTask = tasks.create(name: "run$nameCap", type: JavaExec) {
......@@ -149,8 +143,7 @@ ext.createBuild = { lang, name, modelDirs, options = [] ->
classpath = testSourceSet.runtimeClasspath
args '-run_as_test'
it.workingDir = workingDir
doFirst { main = getMainClass(genDir) }
mainClass = genDir.map { getMainClass(it) }
}
}
......@@ -172,7 +165,6 @@ ext.createTest = { lang, name, options = [] ->
def testName = "$name$langCap"
def testNameCap = testName.capitalize()
def suiteName = "${project.name}.$testNameCap"
def genDir = "$srcGenDir/$testName"
def workingDir = "$outputDir/$testName"
def etuFile = "$workingDir/log/${nameCap}.etu"
......
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
......@@ -37,6 +37,7 @@ subprojects {
tasks.withType(JavaCompile) {
options.encoding = 'cp1252'
options.release = 8
}
processResources {
......@@ -44,9 +45,6 @@ subprojects {
into 'META-INF'
}
}
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
configure(xtextProjects) {
......
......@@ -6,9 +6,6 @@ dependencies {
implementation 'org.eclipse.emf:org.eclipse.emf.ecore.xmi'
}
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
ext.classpath = sourceSets.main.runtimeClasspath
mainClassName = 'org.eclipse.etrice.etunit.converter.EtUnitReportConverter'
......
......@@ -10,9 +10,6 @@ dependencies {
api project(':runtime:org.eclipse.etrice.runtime.java')
}
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
modelSet {
room {
option 'msc_instr'
......@@ -31,6 +28,8 @@ sourceSets {
}
}
compileJava.dependsOn generate
compileJava {
options.release = 8
}
components.java.addVariantsFromConfiguration(configurations.modelpathZip) {}
\ No newline at end of file
......@@ -4,13 +4,14 @@ plugins {
apply from: "$rootDir/gradle/publish.gradle"
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
sourceSets {
main {
java {
srcDirs = ['src', 'src-gen']
}
}
}
compileJava {
options.release = 8
}
\ No newline at end of file
......@@ -8,11 +8,11 @@ pluginManagement {
id "pl.allegro.tech.build.axion-release" version "1.11.0"
id "com.github.dkorotych.gradle-maven-exec" version "2.2.1"
id "org.hidetake.ssh" version "2.10.1"
id "de.protos.etrice-base" version "2.0.0"
id "de.protos.etrice-c" version "2.0.0"
id "de.protos.etrice-java" version "2.0.0"
id "de.protos.source-publish" version "2.0.0"
id "de.protos.etunit-convert" version "2.0.0"
id "de.protos.etrice-base" version "2.2.0"
id "de.protos.etrice-c" version "2.2.0"
id "de.protos.etrice-java" version "2.2.0"
id "de.protos.source-publish" version "2.2.0"
id "de.protos.etunit-convert" version "2.2.0"
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment