2017-11-19 19:23:59 +00:00
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
maven {
|
|
|
|
// SWT libraries
|
|
|
|
url "http://maven-eclipse.github.io/maven"
|
|
|
|
}
|
|
|
|
}
|
2017-11-16 05:00:11 +00:00
|
|
|
|
|
|
|
apply plugin: 'java'
|
|
|
|
apply plugin: 'application'
|
|
|
|
|
2017-11-19 19:23:59 +00:00
|
|
|
ext {
|
|
|
|
sourceCompatibility = '1.8'
|
|
|
|
targetCompatibility = '1.8'
|
|
|
|
|
|
|
|
swtVersion = "4.6.1"
|
|
|
|
junitVersion = "4.12"
|
|
|
|
antVersion = "1.8.2"
|
2018-03-03 18:04:48 +00:00
|
|
|
commonsLang3Version = "3.7"
|
2017-11-19 19:23:59 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 05:00:11 +00:00
|
|
|
mainClassName = 'com.webcodepro.applecommander.ui.AppleCommander'
|
2018-03-02 18:47:06 +00:00
|
|
|
version "${version}"
|
2017-11-16 05:00:11 +00:00
|
|
|
|
2018-03-03 02:51:29 +00:00
|
|
|
test {
|
|
|
|
String swtDependency
|
|
|
|
switch (System.getProperty('os.name').toLowerCase().split()[0]) {
|
|
|
|
case 'windows':
|
|
|
|
swtDependency = "org.eclipse.swt:org.eclipse.swt.win32.win32.x86_64:$swtVersion"
|
|
|
|
break
|
|
|
|
case 'linux':
|
|
|
|
swtDependency = "org.eclipse.swt:org.eclipse.swt.gtk.linux.x86_64:$swtVersion"
|
|
|
|
break
|
|
|
|
case 'mac':
|
|
|
|
swtDependency = "org.eclipse.swt:org.eclipse.swt.cocoa.macosx.x86_64:$swtVersion"
|
|
|
|
break
|
|
|
|
default:
|
|
|
|
throw new Exception('Unknown OS')
|
|
|
|
}
|
|
|
|
dependencies {
|
|
|
|
compile "$swtDependency"
|
|
|
|
}
|
|
|
|
testLogging {
|
|
|
|
exceptionFormat = 'full'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-19 19:23:59 +00:00
|
|
|
// Disable default JAR creation
|
|
|
|
jar {
|
|
|
|
enabled = false
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType(Javadoc) {
|
|
|
|
// disable the crazy super-strict doclint tool in Java 8
|
|
|
|
options.addStringOption('Xdoclint:none', '-quiet')
|
|
|
|
}
|
|
|
|
tasks.withType(Jar) {
|
|
|
|
manifest {
|
|
|
|
attributes 'Main-Class': 'com.webcodepro.applecommander.ui.AppleCommander'
|
2018-03-02 18:47:06 +00:00
|
|
|
attributes 'Implementation-Title': 'AppleCommander',
|
|
|
|
'Implementation-Version': version
|
|
|
|
}
|
2017-11-19 19:23:59 +00:00
|
|
|
from('LICENSE', 'CONTRIB', 'TODO', 'VERSIONS')
|
2017-11-16 05:00:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compileOnly "org.apache.ant:ant:$antVersion"
|
|
|
|
|
|
|
|
testCompile "junit:junit:$junitVersion"
|
2018-03-03 18:04:48 +00:00
|
|
|
testCompile "org.apache.commons:commons-lang3:$commonsLang3Version"
|
|
|
|
|
2017-11-16 05:00:11 +00:00
|
|
|
}
|
|
|
|
|
2017-11-19 19:23:59 +00:00
|
|
|
task acJar(type: Jar) {
|
|
|
|
dependencies {
|
|
|
|
// Just to pass the compile step; these classes are stripped out below.
|
|
|
|
compile "org.eclipse.swt:org.eclipse.swt.cocoa.macosx.x86_64:$swtVersion"
|
|
|
|
}
|
|
|
|
appendix 'ac'
|
2017-11-16 05:00:11 +00:00
|
|
|
manifest {
|
2017-11-19 19:23:59 +00:00
|
|
|
attributes 'Main-Class' : 'com.webcodepro.applecommander.ui.ac'
|
2017-11-16 05:00:11 +00:00
|
|
|
}
|
2017-11-19 19:23:59 +00:00
|
|
|
from(sourceSets.main.output) {
|
|
|
|
include 'com/webcodepro/**'
|
|
|
|
exclude 'com/webcodepro/applecommander/ui/images/**'
|
|
|
|
exclude 'com/webcodepro/applecommander/ui/swing/**'
|
|
|
|
exclude 'com/webcodepro/applecommander/ui/swt/**'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
task linuxJar(type: Jar) {
|
|
|
|
dependencies {
|
|
|
|
compile "org.eclipse.swt:org.eclipse.swt.gtk.linux.x86_64:$swtVersion"
|
|
|
|
}
|
|
|
|
appendix 'linux64-gtk'
|
|
|
|
from(sourceSets.main.output) {
|
|
|
|
include 'com/webcodepro/**'
|
|
|
|
}
|
|
|
|
doFirst {
|
|
|
|
// Pick and include just the Linux JAR contents
|
|
|
|
from { configurations.runtime.collect { it.name.contains('.linux.') ? zipTree(it) : 'fake' } }
|
|
|
|
}
|
2017-11-16 05:00:11 +00:00
|
|
|
}
|
2017-11-19 19:23:59 +00:00
|
|
|
task macosxJar(type: Jar) {
|
|
|
|
dependencies {
|
|
|
|
compile "org.eclipse.swt:org.eclipse.swt.cocoa.macosx.x86_64:$swtVersion"
|
|
|
|
}
|
|
|
|
appendix 'macosx'
|
|
|
|
from(sourceSets.main.output) {
|
|
|
|
include 'com/webcodepro/**'
|
|
|
|
}
|
|
|
|
doFirst {
|
|
|
|
// Pick and include just the Mac OS X JAR contents
|
|
|
|
from { configurations.runtime.collect { it.name.contains('.macosx.') ? zipTree(it) : 'fake' } }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
task windowsJar(type: Jar) {
|
|
|
|
dependencies {
|
|
|
|
compile "org.eclipse.swt:org.eclipse.swt.win32.win32.x86_64:$swtVersion"
|
|
|
|
}
|
|
|
|
appendix 'win64'
|
|
|
|
from(sourceSets.main.output) {
|
|
|
|
include 'com/webcodepro/**'
|
|
|
|
}
|
|
|
|
doFirst {
|
|
|
|
// Pick and include just the Windows SWT JAR contents
|
|
|
|
from { configurations.runtime.collect { it.name.contains('.win32.') ? zipTree(it) : 'fake' } }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
artifacts {
|
|
|
|
archives acJar
|
|
|
|
archives linuxJar
|
|
|
|
archives macosxJar
|
|
|
|
archives windowsJar
|
|
|
|
}
|