mobac-unlocked/mobac/build.gradle

106 lines
4.4 KiB
Groovy
Raw Normal View History

plugins {
id 'java-library'
id 'edu.sc.seis.launch4j' version '3.0.5'
}
dependencies {
def mapsforgeVersion = '0.20.0'
// def mapsforgeVersion = 'master-SNAPSHOT'
implementation "org.mapsforge:mapsforge-core:${mapsforgeVersion}"
implementation "org.mapsforge:mapsforge-map:${mapsforgeVersion}"
implementation "org.mapsforge:mapsforge-map-awt:${mapsforgeVersion}"
implementation "org.mapsforge:mapsforge-map-reader:${mapsforgeVersion}"
implementation "org.mapsforge:mapsforge-themes:${mapsforgeVersion}"
api 'org.apache-extras.beanshell:bsh:2.0b6'
api 'commons-codec:commons-codec:1.15'
api 'commons-io:commons-io:2.11.0'
api 'org.apache.commons:commons-lang3:3.12.0'
api 'org.apache.commons:commons-text:1.9'
api 'com.github.kerner1000:javapng:2.1.2'
api 'org.xerial:sqlite-jdbc:3.43.0.0'
api 'com.sleepycat:je:5.0.73'
api 'org.glassfish.jaxb:jaxb-runtime:3.0.2'
api 'org.slf4j:slf4j-api:1.7.36'
implementation 'com.twelvemonkeys.imageio:imageio-webp:3.9.4'
implementation 'ch.qos.logback:logback-classic:1.2.11'
implementation 'org.slf4j:jul-to-slf4j:1.7.36'
implementation 'net.sf.jtidy:jtidy:r938'
implementation 'com.itextpdf:itextpdf:5.1.3'
implementation 'javax.media:jai-core:1.1.3'
implementation 'com.sun.media:jai-codec:1.1.3'
testImplementation 'org.jboss.resteasy:tjws:2.3.10.Final'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testImplementation 'javax.servlet:servlet-api:2.5'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
}
processResources {
doLast {
def targetDir = new File(sourceSets.main.output.resourcesDir, "mobac")
targetDir.mkdirs()
def props = new Properties()
props.setProperty("mobac.revision", "$svnRevision")
props.setProperty("mobac.version", project.rootProject.version.toString())
new File(targetDir, "mobac-rev.properties").withWriter { props.store(it, null) }
}
}
jar {
println("SVN revision $svnRevision")
manifest {
attributes 'Main-Class': 'mobac.StartMOBAC'
attributes 'Version': project.rootProject.version
attributes 'SVN-Revision': svnRevision
attributes 'Build-Timestamp': new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date())
// This entry is required by jaxb-runtime to work properly on Java 16+ - otherwise you will encounter
// java.lang.NullPointerException: Cannot invoke "java.lang.reflect.Method.invoke(Object, Object[])" because
// "com.sun.xml.bind.v2.runtime.reflect.opt.Injector.defineClass" is null
attributes 'Multi-Release': 'true'
attributes 'Add-Exports': 'java.base/sun.net.www.protocol.http java.base/sun.net.www.protocol.https'
}
getArchiveBaseName().set('Mobile_Atlas_Creator')
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
exclude("module-info.class")
exclude("META-INF/*.txt")
exclude("META-INF/*.md")
exclude("META-INF/MANIFEST.MF")
exclude("META-INF/maven/*")
// We only support 64 bit common architectures and platforms, remove the rest
exclude("org/sqlite/native/Windows/x86/**")
exclude("org/sqlite/native/Windows/armv7/**")
exclude("org/sqlite/native/Linux/arm*/**")
exclude("org/sqlite/native/Linux/x86/**")
exclude("org/sqlite/native/Linux/ppc64/**")
exclude("org/sqlite/native/Linux-Musl/**")
exclude("org/sqlite/native/Linux-Android/**")
exclude("org/sqlite/native/FreeBSD/**")
duplicatesStrategy DuplicatesStrategy.EXCLUDE
}
launch4j {
productName = "Mobile Atlas Creator"
fileDescription = "Mobile Atlas Creator Windows Launcher"
// only take the number+dot part at the beginning
version = project.rootProject.version.toString().replaceAll('^([0-9\\.]+).*', '$1')
textVersion = project.rootProject.version
copyright = "MOBAC developers"
companyName = ""
icon = "${projectDir}/launch4j/mobac.ico"
downloadUrl = "https://mobac.sourceforge.io/OpenJDK/"
jreMinVersion = '1.11.0'
requires64Bit = true
dontWrapJar = true
libraryDir = ""
copyConfigurable = [] //["${project.buildDir}/libs/Mobile_Atlas_Creator.jar"]
outfile = "Mobile Atlas Creator.exe"
}
test {
useJUnitPlatform()
}