Commit cb90f3fe authored by Matthias Betz's avatar Matthias Betz
Browse files

Switch back to maven

add build plugin
parent f9c8ded9
Pipeline #7489 failed with stage
in 16 seconds
image: gradle:jdk17-alpine
image: maven:3.8.6-eclipse-temurin-17
before_script:
- GRADLE_USER_HOME="$(pwd)/.gradle"
- export GRADLE_USER_HOME
test:
stage: test
script:
- cd CityDoctorParent
- gradle test
artifacts:
when: always
reports:
junit: CityDoctorParent/*/build/test-results/test/**/TEST-*.xml
cache:
key: "$CI_COMMIT_REF_NAME"
policy: pull
paths:
- build
- .gradle
build:
script:
- cd CityDoctorParent
- mvn verify
artifacts:
when: always
reports:
junit:
- CityDoctorParent/**/target/surefire-reports/TEST-*.xml
# Created by https://www.gitignore.io/api/java,maven,macos,linux,eclipse,windows,netbeans,intellij
# Edit at https://www.gitignore.io/?templates=java,maven,macos,linux,eclipse,windows,netbeans,intellij
# User specific
.sonarlint/
Servers/
### Eclipse ###
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# PyDev specific (Python IDE for Eclipse)
*.pydevproject
# CDT-specific (C/C++ Development Tooling)
.cproject
# CDT- autotools
.autotools
# Java annotation processor (APT)
.factorypath
# PDT-specific (PHP Development Tools)
.buildpath
# sbteclipse plugin
.target
# Tern plugin
.tern-project
# TeXlipse plugin
.texlipse
# STS (Spring Tool Suite)
.springBeans
# Code Recommenders
.recommenders/
# Annotation Processing
.apt_generated/
# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet
### Eclipse Patch ###
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath
# Annotation Processing
.apt_generated
.sts4-cache/
### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr
# Sonarlint plugin
.idea/sonarlint
### Java ###
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### Linux ###
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Maven ###
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
### NetBeans ###
**/nbproject/private/
**/nbproject/Makefile-*.mk
**/nbproject/Package-*.bash
build/
nbbuild/
dist/
nbdist/
.nb-gradle/
### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
# End of https://www.gitignore.io/api/java,maven,macos,linux,eclipse,windows,netbeans,intellij
/.gradle/
### Gradle ###
.gradle
**/build/
!src/**/build/
# Ignore Gradle GUI config
gradle-app.setting
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
# Avoid ignore Gradle wrappper properties
!gradle-wrapper.properties
# Cache of project
.gradletasknamecache
# Eclipse Gradle plugin generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath
### Gradle Patch ###
# Java heap dump
*.hprof
# End of https://www.toptal.com/developers/gitignore/api/gradle
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorBuildPlugin</artifactId>
<version>1.0.0</version>
<packaging>maven-plugin</packaging>
<prerequisites>
<maven>3.5</maven>
</prerequisites>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.plugin.skipErrorNoDescriptorsFound>true</maven.plugin.skipErrorNoDescriptorsFound>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.8.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.9.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.9.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.rauschig</groupId>
<artifactId>jarchivelib</artifactId>
<version>1.2.0</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.8.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
\ No newline at end of file
package de.hft.stuttgart.citydoctor.build.plugin;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import org.apache.maven.plugin.logging.Log;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.rauschig.jarchivelib.ArchiveFormat;
import org.rauschig.jarchivelib.Archiver;
import org.rauschig.jarchivelib.ArchiverFactory;
import org.rauschig.jarchivelib.CompressionType;
@Mojo(name = "downloadJre", defaultPhase = LifecyclePhase.PREPARE_PACKAGE)
public class DownloadJreMojo implements org.apache.maven.plugin.Mojo {
private Log log;
@Parameter(property = "url", required = true, readonly = true)
private URL url;
@Parameter(property = "outputFolder", defaultValue = "jre")
private String outputFolder;
@Parameter(defaultValue = "${project}", required = true, readonly = true)
MavenProject project;
@Override
public void execute() {
Path targetDir = Paths.get(project.getBuild().getDirectory());
Path outputDir = targetDir.resolve(outputFolder);
if (Files.exists(outputDir)) {
log.info("Skipping jre download, folder already exists");
return;
}
outputDir.normalize();
createOutputFolder(outputDir);
if (url.getFile().endsWith(".tar")) {
// handle tar file
extractTarFile(outputDir);
} else if (url.getFile().endsWith(".tar.gz")) {
// handle tar file with gzip compression
extractTarGz(outputDir);
} else if (url.getFile().endsWith(".zip")) {
// handle zip archive
extractZipFile(outputDir);
}
}
private void extractTarGz(Path outputDir) {
Archiver archiver = ArchiverFactory.createArchiver(ArchiveFormat.TAR, CompressionType.GZIP);
try {
archiver.extract(url.openConnection().getInputStream(), outputDir.toFile());
} catch (IOException e) {
log.error("Could not extract file: " + url, e);
}
}
private void extractTarFile(Path outputDir) {
Archiver archiver = ArchiverFactory.createArchiver(ArchiveFormat.TAR);
try {
archiver.extract(url.openConnection().getInputStream(), outputDir.toFile());
} catch (IOException e) {
log.error("Could not extract file: " + url, e);
}
}
private void extractZipFile(Path outputDir) {
try (ZipInputStream zipInput = new ZipInputStream(url.openConnection().getInputStream())) {
ZipEntry entry = zipInput.getNextEntry();
while (entry != null) {
Path newFile = newFile(outputDir, entry);
if (entry.isDirectory()) {
Files.createDirectories(newFile);
} else {
// fix for Windows-created archives
Path parent = newFile.getParent();
if (!Files.isDirectory(parent)) {
throw new IOException("Failed to create directory: " + parent);
}
Files.createDirectories(parent);
// write file content
Files.copy(zipInput, newFile);
}
entry = zipInput.getNextEntry();
}
} catch (IOException e) {
log.error("Could not retrieve file from url", e);
}
}
public static Path newFile(Path destinationDir, ZipEntry zipEntry) throws IOException {
Path destFile = destinationDir.resolve(zipEntry.getName()).normalize();
String destDirPath = destinationDir.toString();
String destFilePath = destFile.toString();
if (!destFilePath.startsWith(destDirPath + File.separator)) {
throw new IOException("Entry is outside of the target dir: " + zipEntry.getName());
}
return destFile;
}
private void createOutputFolder(Path jreDir) {
try {
Files.createDirectories(jreDir);
} catch (IOException e) {
log.error("Could not create output folder", e);
}
}
@Override
public void setLog(Log log) {
this.log = log;
}
@Override
public Log getLog() {
return log;
}
}
plugins {
id 'citydoctor-multi-module'
}
dependencies {
api(libs.jakarta.xml.bind.api)
runtimeOnly(libs.jaxb.impl)
testImplementation(libs.junit)
}
description = 'CityDoctorCheckResult'
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorParent</artifactId>
<version>3.13.0</version>
</parent>
<artifactId>CityDoctorCheckResult</artifactId>
<dependencies>
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
/*
* This file was generated by the Gradle 'init' task.
*/
plugins {
id 'citydoctor-multi-module'
}
dependencies {
api(libs.log4j.api)
api project(':CityDoctorModel')
testImplementation(libs.junit)
testImplementation(libs.log4j.core)
}
test {
ignoreFailures = true
}
description = 'CityDoctorEdge'
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorParent</artifactId>
<version>3.13.0</version>
</parent>
<artifactId>CityDoctorEdge</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
<dependency>
<groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorModel</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
plugins {
id 'citydoctor-multi-module'
id "com.gorylenko.gradle-git-properties" version "2.4.1"
}
dependencies {
api(libs.citygml4j.core)
api(libs.citygml4j.xml)
api(libs.citygml4j.quality.ade)
api(libs.jama)
api(libs.gluegen.rt.main)
api(libs.jogl.all.main)
api(libs.log4j.api)
api(libs.snakeyaml)
api(libs.proj4j)
testImplementation(libs.log4j.core)
}
gitProperties {
extProperty = 'gitProps' // git properties will be put in a map at project.ext.gitProps
}
generateGitProperties.outputs.upToDateWhen { false } // make sure the generateGitProperties task always executes (even when git.properties is not changed)
import org.apache.tools.ant.filters.*
processResources {
dependsOn 'generateGitProperties'
filesMatching('CityDoctorLocalization.properties') {
filter(ReplaceTokens, tokens: [gitVersion: project.ext.gitProps['git.commit.id.abbrev'], cdVersion: version])
}
outputs.upToDateWhen {
false
}
}
description = 'CityDoctorModel'
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorParent</artifactId>
<version>3.13.0</version>
</parent>
<properties>
<versionString>${project.version}-${git.commit.id.abbrev}</versionString>
</properties>
<artifactId>CityDoctorModel</artifactId>
<name>CityDoctorModel</name>
<dependencies>
<dependency>
<groupId>org.citygml4j</groupId>
<artifactId>citygml4j-core</artifactId>
</dependency>
<dependency>
<groupId>org.citygml4j</groupId>
<artifactId>citygml4j-xml</artifactId>
</dependency>
<dependency>
<groupId>de.hft.stuttgart</groupId>
<artifactId>citygml4j-quality-ade</artifactId>
</dependency>
<dependency>
<groupId>gov.nist.math</groupId>
<artifactId>jama</artifactId>
</dependency>
<dependency>
<groupId>org.jogamp.gluegen</groupId>
<artifactId>gluegen-rt-main</artifactId>
</dependency>
<dependency>
<groupId>org.jogamp.jogl</groupId>
<artifactId>jogl-all-main</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</dependency>
<dependency>
<groupId>org.locationtech.proj4j</groupId>
<artifactId>proj4j</artifactId>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>4.9.10</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<dotGitDirectory>${project.basedir}/../../.git</dotGitDirectory>
<prefix>git</prefix>
<verbose>false</verbose>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<gitDescribe>
<skip>false</skip>
<always>false</always>
</gitDescribe>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
......@@ -89,6 +89,11 @@ public class CityDoctorModel {
}
public void setValidated(ValidationPlan plan) {
if (plan == null) {
this.plan = null;
this.isValidated = false;
return;
}
this.plan = plan;
this.isValidated = true;
}
......
......@@ -503,6 +503,21 @@ public class ConcretePolygon extends Polygon {
public void remove() {
parent.removePolygon(this);
}
@Override
public double getArea() {
if (exterior == null) {
return 0;
}
double area = exterior.getArea();
if (innerRings == null || innerRings.isEmpty()) {
return area;
}
for (LinearRing innerRing : innerRings) {
area -= innerRing.getArea();
}
return area;
}
......
......@@ -119,7 +119,7 @@ public class LinearRing extends GmlElement {
public UnitVector3d calculateNormalNormalized() {
return calculateNormal().normalize();
}
/**
* Calculates the normal vector of the ring. Method by Newell. If the Newell
* method would return a (0, 0, 0) vector a cross product is formed from the
......@@ -152,6 +152,77 @@ public class LinearRing extends GmlElement {
return new Vector3d(coords);
}
public double getArea() {
int n = vertices.size();
if (n < 3)
return 0.0; // a degenerated polygon
// prepare an vertex array with n+2 vertices:
// V[0] ... V[n-1] - the n different vertices
// V[n]=V[0]
// V[n+1]=V[1]
Vertex[] vertexArray = new Vertex[n + 2];
for (int i = 0; i < n; i++) {
vertexArray[i] = vertices.get(i);
}
vertexArray[n] = vertices.get(0);
vertexArray[n + 1] = vertices.get(1);
double area = 0;
// make sure the normal has been calculated
Vector3d normal = calculateNormal();
// select largest abs coordinate to ignore for projection
double ax = Math.abs(normal.getX()); // abs x-coord
double ay = Math.abs(normal.getY()); // abs y-coord
double az = Math.abs(normal.getZ()); // abs z-coord
// coord to ignore: 1=x, 2=y, 3=z
int coord = 3; // ignore z-coord
if (ax > ay) {
if (ax > az) {
coord = 1; // ignore x-coord
}
} else if (ay > az) {
coord = 2; // ignore y-coord
}
// compute area of the 2D projection
for (int i = 1, j = 2, k = 0; i <= vertexArray.length - 2; i++, j++, k++) {
switch (coord) {
case 1:
area += (vertexArray[i].getY() * (vertexArray[j].getZ() - vertexArray[k].getZ()));
break;
case 2:
area += (vertexArray[i].getX() * (vertexArray[j].getZ() - vertexArray[k].getZ()));
break;
case 3:
area += (vertexArray[i].getX() * (vertexArray[j].getY() - vertexArray[k].getY()));
break;
default:
throw new IllegalStateException();
}
}
// scale to get area before projection
double an = Math.sqrt(ax * ax + ay * ay + az * az); // length of normal vector
switch (coord) {
case 1:
area *= (an / (2 * ax));
break;
case 2:
area *= (an / (2 * ay));
break;
case 3:
area *= (an / (2 * az));
break;
default:
throw new IllegalStateException();
}
return Math.abs(area);
}
private UnitVector3d calculateNormalWithCross(Vertex v1, Vertex v2, Vertex v3) {
Vector3d dir1 = v2.minus(v1);
Vector3d dir2 = v3.minus(v1);
......@@ -206,7 +277,7 @@ public class LinearRing extends GmlElement {
}
v.addAdjacentRing(this, parent.getParent());
}
public void setVertex(int i, Vertex v) {
vertices.set(i, v);
if (parent.isLinkedTo()) {
......@@ -244,17 +315,17 @@ public class LinearRing extends GmlElement {
public void addAllVertices(List<Vertex> extRing) {
vertices.addAll(extRing);
}
@Override
public void prepareForChecking() {
parent.getParent().prepareForChecking();
}
@Override
public void clearMetaInformation() {
parent.getParent().clearMetaInformation();
}
@Override
public void fillValues(Copyable original, CopyHandler handler) {
super.fillValues(original, handler);
......
......@@ -295,4 +295,9 @@ public class LinkedPolygon extends Polygon {
poly.remove();
}
@Override
public double getArea() {
return poly.getArea();
}
}
......@@ -79,5 +79,7 @@ public abstract class Polygon extends GmlElement {
public abstract ConcretePolygon getOriginal();
public abstract void remove();
public abstract double getArea();
}
\ No newline at end of file
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", "installDist")
.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 {
implementation project(':CityDoctorModel')
implementation project(':CityDoctorEdge')
implementation project(':CityDoctorCheckResult')
implementation(libs.saxon.he) {
exclude group: 'xml-apis', module: 'xml-apis'
}
implementation(libs.fop) {
exclude group: 'xml-apis', module: 'xml-apis'
}
implementation(libs.jdom2)
implementation(libs.log4j.api)
implementation(libs.log4j.core)
implementation(libs.jts.core)
implementation(libs.citygml4j.quality.ade)
}
description = 'CityDoctorValidation'
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorParent</artifactId>
<version>3.13.0</version>
</parent>
<artifactId>CityDoctorValidation</artifactId>
<name>CityDoctorValidation</name>
<description>validation part of city doctor containg all checks</description>
<dependencies>
<dependency>
<groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorModel</artifactId>
</dependency>
<dependency>
<groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorEdge</artifactId>
</dependency>
<dependency>
<groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorCheckResult</artifactId>
</dependency>
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>Saxon-HE</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>fop</artifactId>
<exclusions>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom2</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</dependency>
<dependency>
<groupId>org.locationtech.jts</groupId>
<artifactId>jts-core</artifactId>
</dependency>
<dependency>
<groupId>de.hft.stuttgart</groupId>
<artifactId>citygml4j-quality-ade</artifactId>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<finalName>${project.artifactId}-${project.version}</finalName>
<descriptors>
<descriptor>${project.basedir}/src/assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>create-archive</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
/*
* This file was generated by the Gradle 'init' task.
*/
plugins {
// Support convention plugins written in Groovy. Convention plugins are build scripts in 'src/main' that automatically become available as plugins in the main build.
id 'groovy-gradle-plugin'
}
repositories {
// Use the plugin portal to apply community plugins in convention plugins.
gradlePluginPortal()
}
plugins {
id 'java-library'
id 'maven-publish'
}
repositories {
mavenLocal()
mavenCentral()
flatDir {
dirs rootProject.files('non-maven-libs')
}
}
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
}
test {
useJUnitPlatform()
}
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'
}
group = 'de.hft.stuttgart'
version = '3.13.0'
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
tasks.withType(Javadoc) {
options.encoding = 'UTF-8'
}
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