AppleCommander/lib/ac-swt-common/build.gradle

49 lines
1.3 KiB
Groovy

plugins {
id 'java-library'
}
repositories {
mavenCentral()
}
dependencies {
implementation project(':lib:ac-api')
implementation "net.sf.applecommander:applesingle-api:$asVersion"
testImplementation "junit:junit:$junitVersion"
testImplementation "org.apache.commons:commons-lang3:$commonsLang3Version"
}
test {
String osName = System.getProperty('os.name').toLowerCase().split()[0]
String osArch = System.getProperty('os.arch').toLowerCase().split()[0]
if ("amd64".equals(osArch)) {
osArch = "x86_64"
}
String swtDependency
switch (osName) {
case 'windows':
swtDependency = "org.eclipse.platform:org.eclipse.swt.win32.win32.${osArch}:$swtVersion"
break
case 'linux':
swtDependency = "org.eclipse.platform:org.eclipse.swt.gtk.linux.${osArch}:$swtVersion"
break
case 'mac':
swtDependency = "org.eclipse.platform:org.eclipse.swt.cocoa.macosx.${osArch}:$swtVersion"
break
default:
throw new Exception('Unknown OS')
}
dependencies {
implementation("$swtDependency") {
exclude group: "org.eclipse.platform", module: "org.eclipse.swt"
}
}
}
tasks.withType(Jar) {
archiveBaseName = 'AppleCommander'
archiveAppendix = 'swt-common'
}