Commit 23d6e480 authored by Matthias Betz's avatar Matthias Betz
Browse files

fixing gradle setup

parent 94b80132
Pipeline #7256 passed with stage
in 1 minute and 58 seconds
image: maven:3.8.6-eclipse-temurin-17
image: gradle:jdk17-alpine
before_script:
- GRADLE_USER_HOME="$(pwd)/.gradle"
- export GRADLE_USER_HOME
build:
script:
- cd CityDoctorParent
- mvn verify
artifacts:
when: always
reports:
junit:
- CityDoctorParent/**/target/surefire-reports/TEST-*.xml
stage: test
script:
- cd CityDoctorParent
- gradle test
artifacts:
when: always
reports:
junit: CityDoctorParent/build/test-results/test/**/TEST-*.xml
\ No newline at end of file
......@@ -13,4 +13,8 @@ dependencies {
testImplementation 'org.apache.logging.log4j:log4j-core:2.18.0'
}
test {
ignoreFailures = true
}
description = 'CityDoctorEdge'
/*
* This file was generated by the Gradle 'init' task.
*/
import org.gradle.testkit.runner.GradleRunner
plugins {
id 'citydoctor-multi-module'
id 'org.beryx.runtime' version '1.12.7'
}
application {
mainClass = 'de.hft.stuttgart.citydoctor2.CityDoctorValidation'
applicationName = 'CityDoctorValidation'
}
runtime {
targetPlatform("lin") {
jdkHome = jdkDownload("https://download.bell-sw.com/java/17.0.6+10/bellsoft-jdk17.0.6+10-linux-amd64.tar.gz")
}
targetPlatform("mac") {
jdkHome = jdkDownload("https://download.bell-sw.com/java/17.0.6+10/bellsoft-jdk17.0.6+10-macos-amd64.tar.gz")
}
targetPlatform("win") {
jdkHome = jdkDownload("https://download.bell-sw.com/java/17.0.6+10/bellsoft-jdk17.0.6+10-windows-amd64.zip")
}
}
tasks.withType(CreateStartScripts).each { task ->
task.doLast {
String text = task.windowsScript.text
text = text.replaceFirst(/(set CLASSPATH=%APP_HOME%\\lib\\).*/, { "${it[1]}*" })
task.windowsScript.write text
}
}
task createPackages(group: 'distribution', description: 'Creating packages for all os') {
doFirst {
def system = it
GradleRunner.create()
.withDebug(true)
.withProjectDir(projectDir)
.forwardOutput()
.withArguments("-is", "build", "jre")
.build();
}
doLast {
copy {
from('src/assembly/common')
into("$buildDir/jpackage/CityDoctorValidation-win/")
}
copy {
from('src/assembly/common')
into("$buildDir/jpackage/CityDoctorValidation-lin/")
}
copy {
from('src/assembly/common')
into("$buildDir/jpackage/CityDoctorValidation-mac/")
}
copy {
from('src/assembly/common')
into("$buildDir/jpackage/CityDoctorValidation/")
}
copy {
from('src/assembly/no_runtime/')
into("$buildDir/jpackage/CityDoctorValidation/")
}
copy {
from('src/assembly/win/start.bat')
into("$buildDir/jpackage/CityDoctorValidation-win/")
}
copy {
from('src/assembly/lin/start.sh')
into("$buildDir/jpackage/CityDoctorValidation-lin/")
}
copy {
from('src/assembly/lin/start.sh')
into("$buildDir/jpackage/CityDoctorValidation-mac/")
}
copy {
from("${project.buildDir}/install/CityDoctorValidation/lib/")
into("$buildDir/jpackage/CityDoctorValidation-win/app/")
}
copy {
from("${project.buildDir}/install/CityDoctorValidation/lib/")
into("$buildDir/jpackage/CityDoctorValidation/app/")
}
copy {
from("${project.buildDir}/install/CityDoctorValidation/lib/")
into("$buildDir/jpackage/CityDoctorValidation-lin/app/")
}
copy {
from("${project.buildDir}/install/CityDoctorValidation/lib/")
into("$buildDir/jpackage/CityDoctorValidation-mac/app/")
}
copy {
from("${project.buildDir}/jre/CityDoctorValidation-win")
into("$buildDir/jpackage/CityDoctorValidation-win/runtime/")
}
copy {
from("${project.buildDir}/jre/CityDoctorValidation-lin")
into("$buildDir/jpackage/CityDoctorValidation-lin/runtime/")
}
copy {
from("${project.buildDir}/jre/CityDoctorValidation-mac")
into("$buildDir/jpackage/CityDoctorValidation-mac/runtime/")
}
}
}
task packageAll(group: 'distribution', description: 'Creating zip packages for all os', type: Zip) {
dependsOn(createPackages)
dependsOn tasks.create("winZip", Zip) {
from file("$buildDir/jpackage/CityDoctorValidation-win/")
archiveBaseName = "CityDoctorValidation"
archiveClassifier = "win"
}
dependsOn tasks.create("linZip", Zip) {
from file("$buildDir/jpackage/CityDoctorValidation-lin/")
archiveBaseName = "CityDoctorValidation"
archiveClassifier = "lin"
}
dependsOn tasks.create("macZip", Zip) {
from file("$buildDir/jpackage/CityDoctorValidation-mac/")
archiveBaseName = "CityDoctorValidation"
archiveClassifier = "mac"
}
dependsOn tasks.create("allZip", Zip) {
from file("$buildDir/jpackage/CityDoctorValidation/")
archiveBaseName = "CityDoctorValidation"
archiveClassifier = "no-runtime"
}
}
jar {
manifest {
attributes 'Implementation-Title': "CityDoctorValidation",
'Main-Class': 'de.hft.stuttgart.citydoctor2.CityDoctorValidation'
}
}
dependencies {
api project(':CityDoctorModel')
api project(':CityDoctorEdge')
api project(':CityDoctorCheckResult')
implementation project(':CityDoctorModel')
implementation project(':CityDoctorEdge')
implementation project(':CityDoctorCheckResult')
implementation('net.sf.saxon:Saxon-HE:11.3') {
exclude group: 'xml-apis', module: 'xml-apis'
}
implementation('org.apache.xmlgraphics:fop:2.7') {
exclude group: 'xml-apis', module: 'xml-apis'
}
api 'org.jdom:jdom2:2.0.6.1'
api "org.apache.logging.log4j:log4j-api:2.18.0"
api 'org.apache.logging.log4j:log4j-core:2.18.0'
api 'org.locationtech.jts:jts-core:1.19.0'
api 'de.hft.stuttgart:citygml4j-quality-ade:3.2.0'
implementation 'org.jdom:jdom2:2.0.6.1'
implementation "org.apache.logging.log4j:log4j-api:2.18.0"
implementation 'org.apache.logging.log4j:log4j-core:2.18.0'
implementation 'org.locationtech.jts:jts-core:1.19.0'
implementation 'de.hft.stuttgart:citygml4j-quality-ade:3.2.0'
testImplementation 'junit:junit:4.13.2'
}
......
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>zip</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<outputDirectory>libs</outputDirectory>
<excludes>
<exclude>${project.groupId}:${project.artifactId}:jar:*</exclude>
</excludes>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>${project.artifactId}-${project.version}.jar</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.basedir}/src/assembly</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>start.bat</include>
<include>testConfigWithStreaming.yml</include>
<include>REKaiserwall.gml</include>
<include>checkForSolid.xml</include>
</includes>
<filtered>true</filtered>
</fileSet>
</fileSets>
</assembly>
\ No newline at end of file
#!/bin/sh
./runtime/bin/java -classpath app/*:plugin/* de.hft.stuttgart.citydoctor2.CityDoctorValidation -in REKaiserwall.gml -config testConfigWithStreaming.yml -xmlReport output.xml
\ No newline at end of file
java -classpath app/*;plugin/* de.hft.stuttgart.citydoctor2.CityDoctorValidation -in REKaiserwall.gml -config testConfigWithStreaming.yml -xmlReport output.xml
pause
\ No newline at end of file
#!/bin/sh
java -classpath app/*:plugin/* de.hft.stuttgart.citydoctor2.CityDoctorValidation -in REKaiserwall.gml -config testConfigWithStreaming.yml -xmlReport output.xml
\ No newline at end of file
java -classpath libs/*;plugins/*;${project.artifactId}-${project.version}.jar de.hft.stuttgart.citydoctor2.CityDoctorValidation -in REKaiserwall.gml -config testConfigWithStreaming.yml -xmlReport output.xml
pause
\ No newline at end of file
"runtime/bin/java.exe" -classpath app/*;plugin/* de.hft.stuttgart.citydoctor2.CityDoctorValidation -in REKaiserwall.gml -config testConfigWithStreaming.yml -xmlReport output.xml
pause
\ No newline at end of file
......@@ -20,6 +20,7 @@ test {
dependencies {
testImplementation 'org.mockito:mockito-core:4.6.1'
testImplementation 'junit:junit:4.13.2'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.8.2'
}
......
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