diff --git a/.gitignore b/.gitignore index ac460f0..797bfcc 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,9 @@ bin .gradle build/ +# IDE's +.vscode + # In case we run it locally, AppleCommander files we don't want to commit AppleCommander.preferences *.bas @@ -15,7 +18,7 @@ AppleCommander.preferences *.2mg *.2img # But allowing disk images from the unit tests -!src/test/resources/disks/* +!lib/ac-api/src/test/resources/disks/* # Eclipse .classpath diff --git a/MAVEN-REPO.md b/MAVEN-REPO.md index 3e13994..2cc6ec6 100644 --- a/MAVEN-REPO.md +++ b/MAVEN-REPO.md @@ -24,24 +24,35 @@ Extract secret key for the Gradle signing plugin: $ gpg2 --export-secret-keys > secring.gpg ``` -## Build and publish to Central Repository +## Gradle build and publish to Central Repository + +> NOTE: The build has been updated to allow snapshots to be published. These appear to be automatically available. Ensure full build passes: ```bash -$ ./gradlew clean test javadoc assemble -<...lots of stuff, primarily Javadoc issues...> -BUILD SUCCESSFUL in 3s -13 actionable tasks: 13 executed + ./gradlew clean build + +BUILD SUCCESSFUL in 8s +91 actionable tasks: 91 executed ``` -Upload: +Publish: ```bash -$ ./gradlew uploadArchives +$ ./gradlew publish -BUILD SUCCESSFUL in 10s -10 actionable tasks: 1 executed, 9 up-to-date +BUILD SUCCESSFUL in 8s +2 actionable tasks: 2 executed +``` + +The can also be combined: + +```bash +$ ./gradlew clean build publish + +BUILD SUCCESSFUL in 16s +93 actionable tasks: 93 executed ``` Then follow "releasing the deployment" below. @@ -52,6 +63,7 @@ Just a reminder! # References -* http://central.sonatype.org/pages/gradle.html +* http://central.sonatype.org/pages/gradle.html (NOTE: Documentation is out of date) * http://central.sonatype.org/pages/releasing-the-deployment.html +* https://docs.gradle.org/current/userguide/publishing_maven.html * For all the other little pieces, Google is your friend. ;-) diff --git a/app/ac-cli/build.gradle b/app/ac-cli/build.gradle new file mode 100644 index 0000000..3eed5f5 --- /dev/null +++ b/app/ac-cli/build.gradle @@ -0,0 +1,33 @@ +plugins { + id 'org.springframework.boot' version '2.6.1' + id 'application' +} + +repositories { + mavenCentral() +} + +dependencies { + implementation project(':lib:ac-api') + implementation "net.sf.applecommander:ShrinkItArchive:$shkVersion" + implementation "net.sf.applecommander:applesingle-api:$asVersion" + implementation "net.sf.applecommander:bastools-api:$btVersion" + + compileOnly "org.apache.ant:ant:$antVersion" + + testImplementation "junit:junit:$junitVersion" +} + +application { + mainClass = 'com.webcodepro.applecommander.ui.ac' +} + +bootJar { + archiveBaseName = 'AppleCommander' + archiveAppendix = 'ac' + manifest { + attributes 'Implementation-Title': "AppleCommander 'ac'", + 'Implementation-Version': archiveVersion + } + from('../../LICENSE') +} diff --git a/src/main/java/com/webcodepro/applecommander/ui/AntTask.java b/app/ac-cli/src/main/java/com/webcodepro/applecommander/ui/AntTask.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/ui/AntTask.java rename to app/ac-cli/src/main/java/com/webcodepro/applecommander/ui/AntTask.java diff --git a/src/main/java/com/webcodepro/applecommander/ui/ac.java b/app/ac-cli/src/main/java/com/webcodepro/applecommander/ui/ac.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/ui/ac.java rename to app/ac-cli/src/main/java/com/webcodepro/applecommander/ui/ac.java diff --git a/src/test/java/com/webcodepro/applecommander/util/AppleSingleTest.java b/app/ac-cli/src/test/java/com/webcodepro/applecommander/util/AppleSingleTest.java similarity index 100% rename from src/test/java/com/webcodepro/applecommander/util/AppleSingleTest.java rename to app/ac-cli/src/test/java/com/webcodepro/applecommander/util/AppleSingleTest.java diff --git a/src/test/resources/hello.applesingle.bin b/app/ac-cli/src/test/resources/hello.applesingle.bin similarity index 100% rename from src/test/resources/hello.applesingle.bin rename to app/ac-cli/src/test/resources/hello.applesingle.bin diff --git a/app/ac-swing/build.gradle b/app/ac-swing/build.gradle new file mode 100644 index 0000000..d49fcaa --- /dev/null +++ b/app/ac-swing/build.gradle @@ -0,0 +1,26 @@ +plugins { + id 'org.springframework.boot' version '2.6.1' + id 'application' +} + +repositories { + mavenCentral() +} + +dependencies { + implementation project(':lib:ac-api') +} + +application { + mainClass = 'com.webcodepro.applecommander.ui.swing.SwingAppleCommander' +} + +bootJar { + archiveBaseName = 'AppleCommander' + archiveAppendix = 'swing-ui' + manifest { + attributes 'Implementation-Title': 'AppleCommander (Swing)', + 'Implementation-Version': archiveVersion + } + from('../../LICENSE') +} diff --git a/src/main/java/com/webcodepro/applecommander/ui/swing/DiskExplorer.java b/app/ac-swing/src/main/java/com/webcodepro/applecommander/ui/swing/DiskExplorer.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/ui/swing/DiskExplorer.java rename to app/ac-swing/src/main/java/com/webcodepro/applecommander/ui/swing/DiskExplorer.java diff --git a/src/main/java/com/webcodepro/applecommander/ui/swing/EmulatorFileFilter.java b/app/ac-swing/src/main/java/com/webcodepro/applecommander/ui/swing/EmulatorFileFilter.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/ui/swing/EmulatorFileFilter.java rename to app/ac-swing/src/main/java/com/webcodepro/applecommander/ui/swing/EmulatorFileFilter.java diff --git a/src/main/java/com/webcodepro/applecommander/ui/swing/SwingAppleCommander.java b/app/ac-swing/src/main/java/com/webcodepro/applecommander/ui/swing/SwingAppleCommander.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/ui/swing/SwingAppleCommander.java rename to app/ac-swing/src/main/java/com/webcodepro/applecommander/ui/swing/SwingAppleCommander.java diff --git a/app/ac-swt-linux-aarch64/build.gradle b/app/ac-swt-linux-aarch64/build.gradle new file mode 100644 index 0000000..95aae48 --- /dev/null +++ b/app/ac-swt-linux-aarch64/build.gradle @@ -0,0 +1,30 @@ +plugins { + id 'org.springframework.boot' version '2.6.1' + id 'application' +} + +repositories { + mavenCentral() +} + +dependencies { + implementation project(':lib:ac-swt-common') + + implementation("org.eclipse.platform:org.eclipse.swt.gtk.linux.aarch64:$swtVersion") { + exclude group: "org.eclipse.platform", module: "org.eclipse.swt" + } +} + +application { + mainClass = 'com.webcodepro.applecommander.ui.swt.SwtAppleCommander' +} + +bootJar { + archiveBaseName = 'AppleCommander' + archiveAppendix = 'linux-aarch64' + manifest { + attributes 'Implementation-Title': 'AppleCommander (Linux Arm)', + 'Implementation-Version': archiveVersion + } + from('../../LICENSE') +} diff --git a/app/ac-swt-linux-x86_64/build.gradle b/app/ac-swt-linux-x86_64/build.gradle new file mode 100644 index 0000000..37beebd --- /dev/null +++ b/app/ac-swt-linux-x86_64/build.gradle @@ -0,0 +1,30 @@ +plugins { + id 'org.springframework.boot' version '2.6.1' + id 'application' +} + +repositories { + mavenCentral() +} + +dependencies { + implementation project(':lib:ac-swt-common') + + implementation("org.eclipse.platform:org.eclipse.swt.gtk.linux.x86_64:$swtVersion") { + exclude group: "org.eclipse.platform", module: "org.eclipse.swt" + } +} + +application { + mainClass = 'com.webcodepro.applecommander.ui.swt.SwtAppleCommander' +} + +bootJar { + archiveBaseName = 'AppleCommander' + archiveAppendix = 'linux-x86_64' + manifest { + attributes 'Implementation-Title': 'AppleCommander (Linux)', + 'Implementation-Version': archiveVersion + } + from('../../LICENSE') +} diff --git a/app/ac-swt-macosx-aarch64/build.gradle b/app/ac-swt-macosx-aarch64/build.gradle new file mode 100644 index 0000000..c612bda --- /dev/null +++ b/app/ac-swt-macosx-aarch64/build.gradle @@ -0,0 +1,30 @@ +plugins { + id 'org.springframework.boot' version '2.6.1' + id 'application' +} + +repositories { + mavenCentral() +} + +dependencies { + implementation project(':lib:ac-swt-common') + + implementation("org.eclipse.platform:org.eclipse.swt.cocoa.macosx.aarch64:$swtVersion") { + exclude group: "org.eclipse.platform", module: "org.eclipse.swt" + } +} + +application { + mainClass = 'com.webcodepro.applecommander.ui.swt.SwtAppleCommander' +} + +bootJar { + archiveBaseName = 'AppleCommander' + archiveAppendix = 'macosx-aarch64' + manifest { + attributes 'Implementation-Title': 'AppleCommander (Mac Arm)', + 'Implementation-Version': archiveVersion + } + from('../../LICENSE') +} diff --git a/app/ac-swt-macosx-x86_64/build.gradle b/app/ac-swt-macosx-x86_64/build.gradle new file mode 100644 index 0000000..5dc7277 --- /dev/null +++ b/app/ac-swt-macosx-x86_64/build.gradle @@ -0,0 +1,30 @@ +plugins { + id 'org.springframework.boot' version '2.6.1' + id 'application' +} + +repositories { + mavenCentral() +} + +dependencies { + implementation project(':lib:ac-swt-common') + + implementation("org.eclipse.platform:org.eclipse.swt.cocoa.macosx.x86_64:$swtVersion") { + exclude group: "org.eclipse.platform", module: "org.eclipse.swt" + } +} + +application { + mainClass = 'com.webcodepro.applecommander.ui.swt.SwtAppleCommander' +} + +bootJar { + archiveBaseName = 'AppleCommander' + archiveAppendix = 'macosx-x86_64' + manifest { + attributes 'Implementation-Title': 'AppleCommander (Mac)', + 'Implementation-Version': archiveVersion + } + from('../../LICENSE') +} diff --git a/app/ac-swt-win32-x86_64/build.gradle b/app/ac-swt-win32-x86_64/build.gradle new file mode 100644 index 0000000..7a4feda --- /dev/null +++ b/app/ac-swt-win32-x86_64/build.gradle @@ -0,0 +1,30 @@ +plugins { + id 'org.springframework.boot' version '2.6.1' + id 'application' +} + +repositories { + mavenCentral() +} + +dependencies { + implementation project(':lib:ac-swt-common') + + implementation("org.eclipse.platform:org.eclipse.swt.win32.win32.x86_64:$swtVersion") { + exclude group: "org.eclipse.platform", module: "org.eclipse.swt" + } +} + +application { + mainClass = 'com.webcodepro.applecommander.ui.swt.SwtAppleCommander' +} + +bootJar { + archiveBaseName = 'AppleCommander' + archiveAppendix = 'win32-x86_64' + manifest { + attributes 'Implementation-Title': 'AppleCommander (Windows)', + 'Implementation-Version': archiveVersion + } + from('../../LICENSE') +} diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 73e8ab5..0000000 --- a/build.gradle +++ /dev/null @@ -1,247 +0,0 @@ -plugins { - id 'java' - id 'application' - id 'maven' - id 'signing' -} - -repositories { - mavenCentral() - flatDir { - // SWT libraries - dirs "./swt-lib" - } -} - -mainClassName = 'com.webcodepro.applecommander.ui.AppleCommander' -version "${version}" - -compileJava { - sourceCompatibility = '1.8' - targetCompatibility = '1.8' -} - -test { - String osName = System.getProperty('os.name').toLowerCase().split()[0] - String osArch = System.getProperty('os.arch').toLowerCase().split()[0] - String swtDependency - switch (osName) { - 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" - if (osArch == 'arm') { - swtDependency = "org.eclipse.swt:org.eclipse.swt.gtk.linux.arm:$piswtVersion" - } - break - case 'mac': - swtDependency = "org.eclipse.swt:org.eclipse.swt.cocoa.macosx.x86_64:$swtVersion" - break - default: - throw new Exception('Unknown OS') - } - dependencies { - implementation "$swtDependency" - } - testLogging { - exceptionFormat = 'full' - } -} - -// Disable default JAR creation -project.tasks.jar.setEnabled(false) - -// Generic additions to JAR creation -tasks.withType(Jar) { - manifest { - attributes 'Main-Class': 'com.webcodepro.applecommander.ui.AppleCommander' - attributes 'Implementation-Title': 'AppleCommander', - 'Implementation-Version': archiveVersion - } - from('LICENSE') - doFirst { - // Jar files with an appendix are standalone applications and need to have ShrinkIt included. - if (archiveAppendix) { - from { - configurations.runtimeClasspath.collect { - it.name.startsWith('ShrinkItArchive') || it.name.startsWith('applesingle-api') || - it.name.startsWith('bastools-api') || it.name.startsWith('commons-csv') || - it.name.startsWith('gson') - ? zipTree(it) : 'fake' - } - } - } - } -} - -dependencies { - implementation "net.sf.applecommander:ShrinkItArchive:$shkVersion" - implementation "net.sf.applecommander:applesingle-api:$asVersion" - implementation "net.sf.applecommander:bastools-api:$btVersion" - implementation "org.apache.commons:commons-csv:$commonsCsvVersion" - implementation "com.google.code.gson:gson:$gsonVersion" - compileOnly "org.apache.ant:ant:$antVersion" - - testImplementation "junit:junit:$junitVersion" - testImplementation "org.apache.commons:commons-lang3:$commonsLang3Version" -} - -task mavenJar(type: Jar) { - dependencies { - // Just to pass the compile step; these classes are stripped out below. - implementation "org.eclipse.swt:org.eclipse.swt.cocoa.macosx.x86_64:$swtVersion" - } - from(sourceSets.main.output) { - include 'com/webcodepro/applecommander/**' - exclude 'com/webcodepro/applecommander/ui/images/**' - exclude 'com/webcodepro/applecommander/ui/swing/**' - exclude 'com/webcodepro/applecommander/ui/swt/**' - } -} -task acJar(type: Jar) { - dependencies { - // Just to pass the compile step; these classes are stripped out below. - implementation "org.eclipse.swt:org.eclipse.swt.cocoa.macosx.x86_64:$swtVersion" - } - archiveAppendix = 'ac' - manifest { - 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 { - implementation "org.eclipse.swt:org.eclipse.swt.gtk.linux.x86_64:$swtVersion" - } - archiveAppendix = 'linux64-gtk' - from(sourceSets.main.output) { - include 'com/webcodepro/**' - } - doFirst { - // Pick and include just the Linux JAR contents - from { configurations.runtimeClasspath.collect { it.name.contains('.linux.x86_64-') ? zipTree(it) : 'fake' } } - } -} -task piJar(type: Jar) { - dependencies { - implementation "org.eclipse.swt:org.eclipse.swt.gtk.linux.arm:$piswtVersion" - } - archiveAppendix = 'linuxarm-gtk' - from(sourceSets.main.output) { - include 'com/webcodepro/**' - } - doFirst { - // Pick and include just the Linux JAR contents - from { configurations.runtimeClasspath.collect { it.name.contains('.linux.arm-') ? zipTree(it) : 'fake' } } - } -} -task macosxJar(type: Jar) { - dependencies { - implementation "org.eclipse.swt:org.eclipse.swt.cocoa.macosx.x86_64:$swtVersion" - } - archiveAppendix = 'macosx' - from(sourceSets.main.output) { - include 'com/webcodepro/**' - } - doFirst { - // Pick and include just the Mac OS X JAR contents - from { configurations.runtimeClasspath.collect { it.name.contains('.macosx.') ? zipTree(it) : 'fake' } } - } -} -task windowsJar(type: Jar) { - dependencies { - implementation "org.eclipse.swt:org.eclipse.swt.win32.win32.x86_64:$swtVersion" - } - archiveAppendix = 'win64' - from(sourceSets.main.output) { - include 'com/webcodepro/**' - } - doFirst { - // Pick and include just the Windows SWT JAR contents - from { configurations.runtimeClasspath.collect { it.name.contains('.win32.') ? zipTree(it) : 'fake' } } - } -} - -task javadocJar(type: Jar) { - classifier = 'javadoc' - from javadoc -} - -task sourcesJar(type: Jar) { - classifier = 'sources' - from sourceSets.main.allSource -} - -javadoc { - options.addStringOption('Xdoclint:none', '-quiet') -} - -artifacts { - archives mavenJar, acJar - archives linuxJar, piJar, macosxJar, windowsJar - archives javadocJar, sourcesJar -} - -signing { - // Only sign if we're uploading... - required { gradle.taskGraph.hasTask("uploadArchives") } - sign configurations.archives -} - -uploadArchives { - repositories { - mavenDeployer { - addFilter('AppleCommander') { artifact, file -> - // Note that the other executables all have suffixes which change their name. - return artifact.name == 'AppleCommander' && artifact.ext != 'zip' && artifact.ext != 'tar' - } - - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - - repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { - authentication(userName: findProperty('ossrhUsername'), password: findProperty('ossrhPassword')) - } - - snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { - authentication(userName: findProperty('ossrhUsername'), password: findProperty('ossrhPassword')) - } - - // Only preserve the compile and non-SWT POM dependencies - pom('AppleCommander').whenConfigured { p -> - p.dependencies = p.dependencies.findAll { it.scope == "compile" } - p.dependencies = p.dependencies.findAll { it.groupId != "org.eclipse.swt" } - } - - pom('AppleCommander').project { - name archivesBaseName - packaging 'jar' - description 'AppleCommander is a general utility for Apple II disk images.' - url 'https://applecommander.github.io/' - - scm { - url 'https://github.com/AppleCommander/AppleCommander' - } - - licenses { - license { - name 'The GNU General Public License (GPL) Version 2, June 1991' - url 'https://www.gnu.org/licenses/gpl-2.0.html' - } - } - - developers { - developer { - id 'robgreene' - email 'robgreene@gmail.com' - } - } - } - } - } -} diff --git a/gradle.properties b/gradle.properties index 5c572e8..9c8469d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,20 +1,15 @@ # Universal AppleCommander version number. Used for: # - Naming JAR file. # - The build will insert this into a file that is read at run time as well. -version=1.7.0pre +version=1.7.0-SNAPSHOT # Dependency versions shkVersion=1.2.2 asVersion=1.2.1 btVersion=0.3.1 -swtVersion=4.17 -piswtVersion=3.8.2 +swtVersion=3.118.0 junitVersion=4.12 antVersion=1.8.2 commonsLang3Version=3.7 commonsCsvVersion=1.8 gsonVersion=2.8.6 - -# Maven Central Repository G and A of GAV coordinate. :-) -group=net.sf.applecommander -archivesBaseName=AppleCommander diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e708b1c..7454180 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4d9ca16..84d1f85 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 4f906e0..1b6c787 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ -#!/usr/bin/env sh +#!/bin/sh # -# Copyright 2015 the original author or authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,67 +17,101 @@ # ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +APP_BASE_NAME=${0##*/} # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + JAVACMD=java which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -106,80 +140,95 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=`expr $i + 1` - done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@" diff --git a/init.gradle b/init.gradle deleted file mode 100644 index f99a85c..0000000 --- a/init.gradle +++ /dev/null @@ -1,18 +0,0 @@ -/* - * This settings file was generated by the Gradle 'init' task. - * - * The settings file is used to specify which projects to include in your build. - * In a single project build this file can be empty or even removed. - * - * Detailed information about configuring a multi-project build in Gradle can be found - * in the user guide at https://docs.gradle.org/4.3.1/userguide/multi_project_builds.html - */ - -/* -// To declare projects as part of a multi-project build use the 'include' method -include 'shared' -include 'api' -include 'services:webservice' -*/ - -rootProject.name = 'AppleCommander' diff --git a/lib/ac-api/build.gradle b/lib/ac-api/build.gradle new file mode 100644 index 0000000..c542ae1 --- /dev/null +++ b/lib/ac-api/build.gradle @@ -0,0 +1,93 @@ +plugins { + id 'java-library' + id 'maven-publish' + id 'signing' +} + +ext.isSnapshotVersion = version.endsWith("SNAPSHOT") +ext.isReleaseVersion = !ext.isSnapshotVersion + +repositories { + mavenCentral() +} + +dependencies { + implementation "net.sf.applecommander:ShrinkItArchive:$shkVersion" + implementation "org.apache.commons:commons-csv:$commonsCsvVersion" + implementation "com.google.code.gson:gson:$gsonVersion" + + testImplementation "junit:junit:$junitVersion" +} + +tasks.withType(Jar) { + archiveBaseName = 'AppleCommander' + archiveAppendix = 'api' + manifest { + attributes 'Implementation-Title': 'AppleCommander', + 'Implementation-Version': archiveVersion + } + from('../../LICENSE') +} + +javadoc { + title = "AppleCommander ${version}" + source = sourceSets.main.allJava + options.addStringOption('Xdoclint:none', '-quiet') +} + +java { + withSourcesJar() + withJavadocJar() +} + +signing { + // Only sign if we're uploading... + required { + isReleaseVersion && gradle.taskGraph.hasTask("publish") + } + sign configurations.archives +} + +publishing { + publications { + mavenJava(MavenPublication) { + from components.java + pom { + groupId = "net.sf.applecommander" + artifactId = "AppleCommander" + name = 'AppleCommander' + description = 'AppleCommander is a general utility for Apple II disk images.' + url = 'https://applecommander.github.io/' + licenses { + license { + name = 'The GNU General Public License (GPL) Version 2, June 1991' + url = 'https://www.gnu.org/licenses/gpl-2.0.html' + } + } + developers { + developer { + id = 'robgreene' + name = 'Rob Greene' + email = 'robgreene@gmail.com' + } + } + scm { + connection = 'scm:git:https://github.com/AppleCommander/AppleCommander.git' + developerConnection = 'scm:git:git@github.com:AppleCommander/AppleCommander.git' + url = 'https://github.com/AppleCommander/AppleCommander' + } + } + repositories { + maven { + def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2" + def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/" + url = isSnapshotVersion ? snapshotsRepoUrl : releasesRepoUrl + credentials { + username = findProperty('ossrhUsername') + password = findProperty('ossrhPassword') + } + } + } + } + } +} diff --git a/src/main/java/com/webcodepro/applecommander/compiler/ApplesoftCompiler.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/compiler/ApplesoftCompiler.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/compiler/ApplesoftCompiler.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/compiler/ApplesoftCompiler.java diff --git a/src/main/java/com/webcodepro/applecommander/compiler/CompileException.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/compiler/CompileException.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/compiler/CompileException.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/compiler/CompileException.java diff --git a/src/main/java/com/webcodepro/applecommander/compiler/CompilerBundle.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/compiler/CompilerBundle.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/compiler/CompilerBundle.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/compiler/CompilerBundle.java diff --git a/src/main/java/com/webcodepro/applecommander/compiler/Variable.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/compiler/Variable.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/compiler/Variable.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/compiler/Variable.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/DirectoryEntry.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/DirectoryEntry.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/DirectoryEntry.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/DirectoryEntry.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/Disk.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/Disk.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/Disk.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/Disk.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/DiskCorruptException.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/DiskCorruptException.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/DiskCorruptException.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/DiskCorruptException.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/DiskException.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/DiskException.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/DiskException.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/DiskException.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/DiskFullException.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/DiskFullException.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/DiskFullException.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/DiskFullException.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/DiskUnrecognizedException.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/DiskUnrecognizedException.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/DiskUnrecognizedException.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/DiskUnrecognizedException.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/FileEntry.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/FileEntry.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/FileEntry.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/FileEntry.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/FileEntryComparator.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/FileEntryComparator.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/FileEntryComparator.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/FileEntryComparator.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/FileFilter.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/FileFilter.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/FileFilter.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/FileFilter.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/FormattedDisk.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/FormattedDisk.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/FormattedDisk.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/FormattedDisk.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/StorageBundle.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/StorageBundle.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/StorageBundle.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/StorageBundle.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/filters/AppleWorksDataBaseFileFilter.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/AppleWorksDataBaseFileFilter.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/filters/AppleWorksDataBaseFileFilter.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/AppleWorksDataBaseFileFilter.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/filters/AppleWorksSpreadSheetFileFilter.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/AppleWorksSpreadSheetFileFilter.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/filters/AppleWorksSpreadSheetFileFilter.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/AppleWorksSpreadSheetFileFilter.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/filters/AppleWorksWordProcessorFileFilter.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/AppleWorksWordProcessorFileFilter.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/filters/AppleWorksWordProcessorFileFilter.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/AppleWorksWordProcessorFileFilter.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/filters/ApplesoftFileFilter.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/ApplesoftFileFilter.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/filters/ApplesoftFileFilter.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/ApplesoftFileFilter.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/filters/AssemblySourceFileFilter.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/AssemblySourceFileFilter.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/filters/AssemblySourceFileFilter.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/AssemblySourceFileFilter.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/filters/BinaryFileFilter.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/BinaryFileFilter.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/filters/BinaryFileFilter.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/BinaryFileFilter.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/filters/BusinessBASICFileFilter.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/BusinessBASICFileFilter.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/filters/BusinessBASICFileFilter.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/BusinessBASICFileFilter.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/filters/GraphicsFileFilter.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/GraphicsFileFilter.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/filters/GraphicsFileFilter.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/GraphicsFileFilter.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/filters/GutenbergFileFilter.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/GutenbergFileFilter.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/filters/GutenbergFileFilter.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/GutenbergFileFilter.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/filters/HexDumpFileFilter.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/HexDumpFileFilter.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/filters/HexDumpFileFilter.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/HexDumpFileFilter.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/filters/IntegerBasicFileFilter.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/IntegerBasicFileFilter.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/filters/IntegerBasicFileFilter.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/IntegerBasicFileFilter.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/filters/PascalTextFileFilter.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/PascalTextFileFilter.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/filters/PascalTextFileFilter.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/PascalTextFileFilter.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/filters/TextFileFilter.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/TextFileFilter.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/filters/TextFileFilter.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/TextFileFilter.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/filters/imagehandlers/AppleImage.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/imagehandlers/AppleImage.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/filters/imagehandlers/AppleImage.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/imagehandlers/AppleImage.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/filters/imagehandlers/ImageIoImage.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/imagehandlers/ImageIoImage.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/filters/imagehandlers/ImageIoImage.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/imagehandlers/ImageIoImage.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/filters/imagehandlers/SunJpegImage.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/imagehandlers/SunJpegImage.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/filters/imagehandlers/SunJpegImage.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/filters/imagehandlers/SunJpegImage.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/os/cpm/CpmFileEntry.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/cpm/CpmFileEntry.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/os/cpm/CpmFileEntry.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/cpm/CpmFileEntry.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/os/cpm/CpmFormatDisk.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/cpm/CpmFormatDisk.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/os/cpm/CpmFormatDisk.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/cpm/CpmFormatDisk.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/os/dos33/DosFileEntry.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/dos33/DosFileEntry.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/os/dos33/DosFileEntry.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/dos33/DosFileEntry.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/os/dos33/DosFormatDisk.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/dos33/DosFormatDisk.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/os/dos33/DosFormatDisk.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/dos33/DosFormatDisk.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/os/dos33/DosSectorAddress.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/dos33/DosSectorAddress.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/os/dos33/DosSectorAddress.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/dos33/DosSectorAddress.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/os/dos33/OzDosFormatDisk.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/dos33/OzDosFormatDisk.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/os/dos33/OzDosFormatDisk.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/dos33/OzDosFormatDisk.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/os/dos33/UniDosFormatDisk.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/dos33/UniDosFormatDisk.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/os/dos33/UniDosFormatDisk.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/dos33/UniDosFormatDisk.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/os/gutenberg/GutenbergFileEntry.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/gutenberg/GutenbergFileEntry.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/os/gutenberg/GutenbergFileEntry.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/gutenberg/GutenbergFileEntry.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/os/gutenberg/GutenbergFormatDisk.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/gutenberg/GutenbergFormatDisk.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/os/gutenberg/GutenbergFormatDisk.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/gutenberg/GutenbergFormatDisk.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/os/nakedos/NakedosFileEntry.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/nakedos/NakedosFileEntry.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/os/nakedos/NakedosFileEntry.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/nakedos/NakedosFileEntry.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/os/nakedos/NakedosFormatDisk.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/nakedos/NakedosFormatDisk.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/os/nakedos/NakedosFormatDisk.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/nakedos/NakedosFormatDisk.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/os/pascal/PascalFileEntry.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/pascal/PascalFileEntry.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/os/pascal/PascalFileEntry.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/pascal/PascalFileEntry.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/os/pascal/PascalFormatDisk.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/pascal/PascalFormatDisk.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/os/pascal/PascalFormatDisk.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/pascal/PascalFormatDisk.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosBlockAddress.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosBlockAddress.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosBlockAddress.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosBlockAddress.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosCommonDirectoryHeader.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosCommonDirectoryHeader.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosCommonDirectoryHeader.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosCommonDirectoryHeader.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosCommonEntry.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosCommonEntry.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosCommonEntry.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosCommonEntry.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosDirectoryEntry.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosDirectoryEntry.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosDirectoryEntry.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosDirectoryEntry.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosDiskSizeDoesNotMatchException.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosDiskSizeDoesNotMatchException.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosDiskSizeDoesNotMatchException.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosDiskSizeDoesNotMatchException.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosFileEntry.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosFileEntry.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosFileEntry.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosFileEntry.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosFormatDisk.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosFormatDisk.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosFormatDisk.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosFormatDisk.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosSubdirectoryHeader.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosSubdirectoryHeader.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosSubdirectoryHeader.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosSubdirectoryHeader.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosVolumeDirectoryHeader.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosVolumeDirectoryHeader.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosVolumeDirectoryHeader.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosVolumeDirectoryHeader.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/os/rdos/RdosFileEntry.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/rdos/RdosFileEntry.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/os/rdos/RdosFileEntry.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/rdos/RdosFileEntry.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/os/rdos/RdosFormatDisk.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/rdos/RdosFormatDisk.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/os/rdos/RdosFormatDisk.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/rdos/RdosFormatDisk.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/physical/ByteArrayImageLayout.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/physical/ByteArrayImageLayout.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/physical/ByteArrayImageLayout.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/physical/ByteArrayImageLayout.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/physical/DosOrder.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/physical/DosOrder.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/physical/DosOrder.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/physical/DosOrder.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/physical/ImageOrder.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/physical/ImageOrder.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/physical/ImageOrder.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/physical/ImageOrder.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/physical/NibbleOrder.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/physical/NibbleOrder.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/physical/NibbleOrder.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/physical/NibbleOrder.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/physical/ProdosOrder.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/physical/ProdosOrder.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/physical/ProdosOrder.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/physical/ProdosOrder.java diff --git a/src/main/java/com/webcodepro/applecommander/storage/physical/UniversalDiskImageLayout.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/physical/UniversalDiskImageLayout.java similarity index 100% rename from src/main/java/com/webcodepro/applecommander/storage/physical/UniversalDiskImageLayout.java rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/physical/UniversalDiskImageLayout.java diff --git a/lib/ac-api/src/main/java/com/webcodepro/applecommander/ui/AppleCommander.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/ui/AppleCommander.java new file mode 100644 index 0000000..3febc35 --- /dev/null +++ b/lib/ac-api/src/main/java/com/webcodepro/applecommander/ui/AppleCommander.java @@ -0,0 +1,34 @@ +/* + * AppleCommander - An Apple ][ image utility. + * Copyright (C) 2002-3 by Robert Greene + * robgreene at users.sourceforge.net + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +package com.webcodepro.applecommander.ui; + +/** + * Make AppleCommander version available. + *
+ * Date created: Nov 16, 2002 9:13:25 PM
+ * @author Rob Greene
+ */
+public class AppleCommander {
+ public static final String VERSION;
+
+ static {
+ VERSION = AppleCommander.class.getPackage().getImplementationVersion();
+ }
+}
diff --git a/src/main/java/com/webcodepro/applecommander/ui/DirectoryLister.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/ui/DirectoryLister.java
similarity index 100%
rename from src/main/java/com/webcodepro/applecommander/ui/DirectoryLister.java
rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/ui/DirectoryLister.java
diff --git a/src/main/java/com/webcodepro/applecommander/ui/ImportSpecification.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/ui/ImportSpecification.java
similarity index 100%
rename from src/main/java/com/webcodepro/applecommander/ui/ImportSpecification.java
rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/ui/ImportSpecification.java
diff --git a/src/main/java/com/webcodepro/applecommander/ui/UiBundle.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/ui/UiBundle.java
similarity index 100%
rename from src/main/java/com/webcodepro/applecommander/ui/UiBundle.java
rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/ui/UiBundle.java
diff --git a/src/main/java/com/webcodepro/applecommander/ui/UserPreferences.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/ui/UserPreferences.java
similarity index 100%
rename from src/main/java/com/webcodepro/applecommander/ui/UserPreferences.java
rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/ui/UserPreferences.java
diff --git a/src/main/java/com/webcodepro/applecommander/util/AppleUtil.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/util/AppleUtil.java
similarity index 100%
rename from src/main/java/com/webcodepro/applecommander/util/AppleUtil.java
rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/util/AppleUtil.java
diff --git a/src/main/java/com/webcodepro/applecommander/util/ApplesoftToken.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/util/ApplesoftToken.java
similarity index 100%
rename from src/main/java/com/webcodepro/applecommander/util/ApplesoftToken.java
rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/util/ApplesoftToken.java
diff --git a/src/main/java/com/webcodepro/applecommander/util/ApplesoftTokenizer.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/util/ApplesoftTokenizer.java
similarity index 100%
rename from src/main/java/com/webcodepro/applecommander/util/ApplesoftTokenizer.java
rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/util/ApplesoftTokenizer.java
diff --git a/src/main/java/com/webcodepro/applecommander/util/ApplesoftTokens.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/util/ApplesoftTokens.java
similarity index 100%
rename from src/main/java/com/webcodepro/applecommander/util/ApplesoftTokens.java
rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/util/ApplesoftTokens.java
diff --git a/src/main/java/com/webcodepro/applecommander/util/BusinessBASICToken.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/util/BusinessBASICToken.java
similarity index 100%
rename from src/main/java/com/webcodepro/applecommander/util/BusinessBASICToken.java
rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/util/BusinessBASICToken.java
diff --git a/src/main/java/com/webcodepro/applecommander/util/BusinessBASICTokenizer.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/util/BusinessBASICTokenizer.java
similarity index 100%
rename from src/main/java/com/webcodepro/applecommander/util/BusinessBASICTokenizer.java
rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/util/BusinessBASICTokenizer.java
diff --git a/src/main/java/com/webcodepro/applecommander/util/BusinessBASICTokens.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/util/BusinessBASICTokens.java
similarity index 100%
rename from src/main/java/com/webcodepro/applecommander/util/BusinessBASICTokens.java
rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/util/BusinessBASICTokens.java
diff --git a/src/main/java/com/webcodepro/applecommander/util/DiskRecurser.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/util/DiskRecurser.java
similarity index 100%
rename from src/main/java/com/webcodepro/applecommander/util/DiskRecurser.java
rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/util/DiskRecurser.java
diff --git a/src/main/java/com/webcodepro/applecommander/util/Host.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/util/Host.java
similarity index 100%
rename from src/main/java/com/webcodepro/applecommander/util/Host.java
rename to lib/ac-api/src/main/java/com/webcodepro/applecommander/util/Host.java
diff --git a/lib/ac-api/src/main/java/com/webcodepro/applecommander/util/Name.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/util/Name.java
new file mode 100644
index 0000000..6ccb80b
--- /dev/null
+++ b/lib/ac-api/src/main/java/com/webcodepro/applecommander/util/Name.java
@@ -0,0 +1,89 @@
+package com.webcodepro.applecommander.util;
+
+import java.util.List;
+
+import com.webcodepro.applecommander.storage.DirectoryEntry;
+import com.webcodepro.applecommander.storage.DiskException;
+import com.webcodepro.applecommander.storage.FileEntry;
+import com.webcodepro.applecommander.storage.FormattedDisk;
+import com.webcodepro.applecommander.ui.UiBundle;
+
+public class Name {
+ private static TextBundle textBundle = UiBundle.getInstance();
+
+ private String fullName;
+ private String name;
+ private String[] path;
+
+ public Name(String s) {
+ this.fullName = s;
+ if (s.startsWith("/")) {
+ fullName = s.substring(1, s.length());
+ }
+ this.path = s.split("/");
+ this.name = path[path.length - 1];
+ }
+
+ public FileEntry getEntry(FormattedDisk formattedDisk) throws DiskException {
+ List
- * Regarding SWT, this application launcher tries to not be SWT dependent.
- * That means that SwtAppleCommander is launched purely by reflection.
- * NOTE: This may yet prove to be a worthless trick. If it is, remove
- * the crud. However, as the VERSION and COPYRIGHT are in this class and
- * are referenced in various places, it may well be worth it.
- *
- * Date created: Nov 16, 2002 9:13:25 PM
- * @author Rob Greene
- */
-public class AppleCommander {
- public static final String VERSION;
- private static TextBundle textBundle = UiBundle.getInstance();
-
- static {
- VERSION = AppleCommander.class.getPackage().getImplementationVersion();
- }
-
- /**
- * Launch AppleCommander.
- */
- public static void main(String[] args) {
- if (args.length == 0) {
- if (isSwtAvailable()) {
- launchSwtAppleCommander(args);
- } else if (isSwingAvailable()) {
- launchSwingAppleCommander(args);
- } else {
- showHelp();
- }
- } else {
- String[] extraArgs = new String[args.length - 1];
- System.arraycopy(args, 1, extraArgs, 0, extraArgs.length);
- if ("-swt".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
- if (isSwtAvailable()) {
- launchSwtAppleCommander(extraArgs);
- } else {
- System.err.println(textBundle.get("SwtVersionNotAvailable")); //$NON-NLS-1$
- }
- } else if ("-swing".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
- if (isSwingAvailable()) {
- launchSwingAppleCommander(extraArgs);
- } else {
- System.err.println(textBundle.get("SwingVersionNotAvailable")); //$NON-NLS-1$
- }
- } else if ("-command".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
- System.err.println(textBundle.get("CommandLineNotAvailable")); //$NON-NLS-1$
- } else if ("-help".equalsIgnoreCase(args[0]) //$NON-NLS-1$
- || "-?".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
- showHelp();
- } else {
- ac.main(args);
- }
- }
- }
- /**
- * Launch the SWT version of AppleCommander. This method
- * uses reflection to load SwtAppleCommander to minimize which
- * classes get loaded. This is particularly important for the
- * command-line version.
- */
- protected static void launchSwtAppleCommander(String[] args) {
- Class> swtAppleCommander;
- try {
- swtAppleCommander = Class.forName(
- "com.webcodepro.applecommander.ui.swt.SwtAppleCommander"); //$NON-NLS-1$
- Constructor> constructor = swtAppleCommander.getConstructor();
- Object object = constructor.newInstance();
- Method launchMethod = swtAppleCommander.
- getMethod("launch", args.getClass()); //$NON-NLS-1$
- launchMethod.invoke(object, new Object[] { args });
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- } catch (SecurityException e) {
- e.printStackTrace();
- } catch (NoSuchMethodException e) {
- e.printStackTrace();
- } catch (IllegalArgumentException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- e.printStackTrace();
- } catch (InstantiationException e) {
- e.printStackTrace();
- }
- }
- /**
- * Test to see if SWT is available.
- */
- protected static boolean isSwtAvailable() {
- try {
- Class.forName("org.eclipse.swt.SWT"); //$NON-NLS-1$
- Class.forName("com.webcodepro.applecommander.ui.swt.SwtAppleCommander"); //$NON-NLS-1$
- return true;
- } catch (ClassNotFoundException ex) {
- return false;
- }
- }
- /**
- * Test to see if Swing is available.
- */
- protected static boolean isSwingAvailable() {
- try {
- Class.forName("com.webcodepro.applecommander.ui.swing.SwingAppleCommander"); //$NON-NLS-1$
- return true;
- } catch (ClassNotFoundException ex) {
- return false;
- }
- }
- /**
- * Launch the Swing version of AppleCommander. This method
- * uses reflection to load SwingAppleCommander to minimize which
- * classes get loaded. This is particularly important for the
- * command-line version.
- */
- protected static void launchSwingAppleCommander(String[] args) {
- Class> swingAppleCommander;
- try {
- swingAppleCommander = Class.forName(
- "com.webcodepro.applecommander.ui.swing.SwingAppleCommander"); //$NON-NLS-1$
- Constructor> constructor = swingAppleCommander.getConstructor();
- Object object = constructor.newInstance();
- Method launchMethod = swingAppleCommander.
- getMethod("launch", (Class[]) null); //$NON-NLS-1$
- launchMethod.invoke(object, (Object[]) null);
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- } catch (SecurityException e) {
- e.printStackTrace();
- } catch (NoSuchMethodException e) {
- e.printStackTrace();
- } catch (IllegalArgumentException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- e.printStackTrace();
- } catch (InstantiationException e) {
- e.printStackTrace();
- }
- }
- /**
- * Display help message(s) for AppleCommander.
- */
- protected static void showHelp() {
- System.err.println(textBundle.get("AppleCommanderHelp")); //$NON-NLS-1$
- System.err.println();
- ac.help();
- }
-}
diff --git a/swt-lib/org.eclipse.swt.cocoa.macosx.x86_64-4.17.jar b/swt-lib/org.eclipse.swt.cocoa.macosx.x86_64-4.17.jar
deleted file mode 100644
index 03724dd..0000000
Binary files a/swt-lib/org.eclipse.swt.cocoa.macosx.x86_64-4.17.jar and /dev/null differ
diff --git a/swt-lib/org.eclipse.swt.gtk.linux.aarch64-4.17.jar b/swt-lib/org.eclipse.swt.gtk.linux.aarch64-4.17.jar
deleted file mode 100644
index bd159af..0000000
Binary files a/swt-lib/org.eclipse.swt.gtk.linux.aarch64-4.17.jar and /dev/null differ
diff --git a/swt-lib/org.eclipse.swt.gtk.linux.arm-3.8.2.jar b/swt-lib/org.eclipse.swt.gtk.linux.arm-3.8.2.jar
deleted file mode 100644
index 61d9da1..0000000
Binary files a/swt-lib/org.eclipse.swt.gtk.linux.arm-3.8.2.jar and /dev/null differ
diff --git a/swt-lib/org.eclipse.swt.gtk.linux.x86_64-4.17.jar b/swt-lib/org.eclipse.swt.gtk.linux.x86_64-4.17.jar
deleted file mode 100644
index 0d23b19..0000000
Binary files a/swt-lib/org.eclipse.swt.gtk.linux.x86_64-4.17.jar and /dev/null differ
diff --git a/swt-lib/org.eclipse.swt.win32.win32.x86_64-4.17.jar b/swt-lib/org.eclipse.swt.win32.win32.x86_64-4.17.jar
deleted file mode 100644
index 8b00aea..0000000
Binary files a/swt-lib/org.eclipse.swt.win32.win32.x86_64-4.17.jar and /dev/null differ