diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 33fe14f5e7dd8c7b95ed9dd470b5e47e25267142..0e8f574e4e8e912c4535f86edb6c29bf91d5c11d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,12 +1,16 @@ -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 diff --git a/CityDoctorParent/CityDoctorEdge/build.gradle b/CityDoctorParent/CityDoctorEdge/build.gradle index ed053c92256a4133cebc348bb1cd483e6061c72e..30bf2c0f9a2fcc2899f47dd6d6a12898f58e1d90 100644 --- a/CityDoctorParent/CityDoctorEdge/build.gradle +++ b/CityDoctorParent/CityDoctorEdge/build.gradle @@ -13,4 +13,8 @@ dependencies { testImplementation 'org.apache.logging.log4j:log4j-core:2.18.0' } +test { + ignoreFailures = true +} + description = 'CityDoctorEdge' diff --git a/CityDoctorParent/CityDoctorValidation/build.gradle b/CityDoctorParent/CityDoctorValidation/build.gradle index 0fd95fec96a17e8ae028b926fd1d91a67ef76a08..ecfb016ab0e15a3ee67665774896624cbce186fd 100644 --- a/CityDoctorParent/CityDoctorValidation/build.gradle +++ b/CityDoctorParent/CityDoctorValidation/build.gradle @@ -1,26 +1,159 @@ -/* - * 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' } diff --git a/CityDoctorParent/CityDoctorValidation/src/assembly/assembly.xml b/CityDoctorParent/CityDoctorValidation/src/assembly/assembly.xml deleted file mode 100644 index 01b45aba59d03bd6745d4b8fbd52c4d8f85a2529..0000000000000000000000000000000000000000 --- a/CityDoctorParent/CityDoctorValidation/src/assembly/assembly.xml +++ /dev/null @@ -1,38 +0,0 @@ -<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 diff --git a/CityDoctorParent/CityDoctorValidation/src/assembly/REKaiserwall.gml b/CityDoctorParent/CityDoctorValidation/src/assembly/common/REKaiserwall.gml similarity index 100% rename from CityDoctorParent/CityDoctorValidation/src/assembly/REKaiserwall.gml rename to CityDoctorParent/CityDoctorValidation/src/assembly/common/REKaiserwall.gml diff --git a/CityDoctorParent/CityDoctorValidation/src/assembly/checkForSolid.xml b/CityDoctorParent/CityDoctorValidation/src/assembly/common/checkForSolid.xml similarity index 100% rename from CityDoctorParent/CityDoctorValidation/src/assembly/checkForSolid.xml rename to CityDoctorParent/CityDoctorValidation/src/assembly/common/checkForSolid.xml diff --git a/CityDoctorParent/CityDoctorValidation/src/assembly/testConfigWithStreaming.yml b/CityDoctorParent/CityDoctorValidation/src/assembly/common/testConfigWithStreaming.yml similarity index 100% rename from CityDoctorParent/CityDoctorValidation/src/assembly/testConfigWithStreaming.yml rename to CityDoctorParent/CityDoctorValidation/src/assembly/common/testConfigWithStreaming.yml diff --git a/CityDoctorParent/CityDoctorValidation/src/assembly/lin/start.sh b/CityDoctorParent/CityDoctorValidation/src/assembly/lin/start.sh new file mode 100644 index 0000000000000000000000000000000000000000..85e23ecb732a128e15c02f1195a0b15e881be1d5 --- /dev/null +++ b/CityDoctorParent/CityDoctorValidation/src/assembly/lin/start.sh @@ -0,0 +1,2 @@ +#!/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 diff --git a/CityDoctorParent/CityDoctorValidation/src/assembly/no_runtime/start.bat b/CityDoctorParent/CityDoctorValidation/src/assembly/no_runtime/start.bat new file mode 100644 index 0000000000000000000000000000000000000000..bf042835beb80493f35164bebb2f4daf1ff004bf --- /dev/null +++ b/CityDoctorParent/CityDoctorValidation/src/assembly/no_runtime/start.bat @@ -0,0 +1,2 @@ +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 diff --git a/CityDoctorParent/CityDoctorValidation/src/assembly/no_runtime/start.sh b/CityDoctorParent/CityDoctorValidation/src/assembly/no_runtime/start.sh new file mode 100644 index 0000000000000000000000000000000000000000..8eeb31f3aa46dfc023d4a5de2c7801aaef532d75 --- /dev/null +++ b/CityDoctorParent/CityDoctorValidation/src/assembly/no_runtime/start.sh @@ -0,0 +1,2 @@ +#!/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 diff --git a/CityDoctorParent/CityDoctorValidation/src/assembly/start.bat b/CityDoctorParent/CityDoctorValidation/src/assembly/start.bat deleted file mode 100644 index be1476f93431ac8f554f879d46cc8ce136ab5ef9..0000000000000000000000000000000000000000 --- a/CityDoctorParent/CityDoctorValidation/src/assembly/start.bat +++ /dev/null @@ -1,2 +0,0 @@ -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 diff --git a/CityDoctorParent/CityDoctorValidation/src/assembly/win/start.bat b/CityDoctorParent/CityDoctorValidation/src/assembly/win/start.bat new file mode 100644 index 0000000000000000000000000000000000000000..52d8e1092ea00e3b5e5f33a6c9af45e8747b5f3d --- /dev/null +++ b/CityDoctorParent/CityDoctorValidation/src/assembly/win/start.bat @@ -0,0 +1,2 @@ +"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 diff --git a/CityDoctorParent/CityDoctorValidation/src/main/resources/citydoctor_logo.ico b/CityDoctorParent/CityDoctorValidation/src/main/resources/citydoctor_logo.ico new file mode 100644 index 0000000000000000000000000000000000000000..3321b741356a9f40506da39dd8377c83e227d67a Binary files /dev/null and b/CityDoctorParent/CityDoctorValidation/src/main/resources/citydoctor_logo.ico differ diff --git a/CityDoctorParent/buildSrc/src/main/groovy/citydoctor-multi-module.gradle b/CityDoctorParent/buildSrc/src/main/groovy/citydoctor-multi-module.gradle index d233ef4b5acd55741d7f591b2aeb27b8fa80c594..e0ee2db636e22103a038798e2bae864054a31184 100644 --- a/CityDoctorParent/buildSrc/src/main/groovy/citydoctor-multi-module.gradle +++ b/CityDoctorParent/buildSrc/src/main/groovy/citydoctor-multi-module.gradle @@ -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' }