diff --git a/.gitignore b/.gitignore index b234c5f..79ae8f6 100644 --- a/.gitignore +++ b/.gitignore @@ -12,12 +12,12 @@ TODO.local work TestImage.* **/Thumbs.db -build/ACBuild.properties -build/AppleCommander.preferences *.o *.lst .classpath .project .settings .gradle -/build/ +build/ +target/ +.DS_Store \ No newline at end of file diff --git a/build.gradle b/build.gradle index 1f73b6d..ffc8fe0 100644 --- a/build.gradle +++ b/build.gradle @@ -1,34 +1,107 @@ - -// Apply the java plugin to add support for Java -apply plugin: 'java' - -// Apply the application plugin to add support for building an application -apply plugin: 'application' - -// Define the main class for the application -mainClassName = 'com.webcodepro.applecommander.ui.AppleCommander' - -// In this section you declare where to find the dependencies of your project repositories { mavenCentral() maven { + // SWT libraries url "http://maven-eclipse.github.io/maven" } } +apply plugin: 'java' +apply plugin: 'application' + +ext { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' + + swtVersion = "4.6.1" + junitVersion = "4.12" + antVersion = "1.8.2" +} + +mainClassName = 'com.webcodepro.applecommander.ui.AppleCommander' +version '1.3.6-BETA' + +// 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' + } + from('LICENSE', 'CONTRIB', 'TODO', 'VERSIONS') +} + dependencies { - compile "org.eclipse.swt:org.eclipse.swt.cocoa.macosx.x86_64:$swtVersion" - compileOnly "org.apache.ant:ant:$antVersion" testCompile "junit:junit:$junitVersion" } -jar { +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' manifest { - attributes 'Main-Class': "$mainClassName" - } - doFirst { - from { configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) } } + attributes 'Main-Class' : 'com.webcodepro.applecommander.ui.ac' } + 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' } } + } +} +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 +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties deleted file mode 100644 index 28231a8..0000000 --- a/gradle.properties +++ /dev/null @@ -1,5 +0,0 @@ - -swtVersion = 4.6.1 -junitVersion = 4.12 -antVersion = 1.8.2 -