From c369ac3bb7cbfaa8cd7b7ad1679db346f4beff2f Mon Sep 17 00:00:00 2001 From: Rob Greene Date: Sun, 19 Dec 2021 22:11:43 -0600 Subject: [PATCH] A little cleanup and fix version. #62 --- lib/ac-api/build.gradle | 8 + .../applecommander/ui/AppleCommander.java | 151 +----------------- 2 files changed, 9 insertions(+), 150 deletions(-) diff --git a/lib/ac-api/build.gradle b/lib/ac-api/build.gradle index b8e0f7b..1e6c524 100644 --- a/lib/ac-api/build.gradle +++ b/lib/ac-api/build.gradle @@ -13,3 +13,11 @@ dependencies { testImplementation "junit:junit:$junitVersion" } + +tasks.withType(Jar) { + manifest { + attributes 'Implementation-Title': 'AppleCommander', + 'Implementation-Version': archiveVersion + } + from('LICENSE') +} 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 index 7ebc5d9..3febc35 100644 --- 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 @@ -19,165 +19,16 @@ */ package com.webcodepro.applecommander.ui; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -import com.webcodepro.applecommander.util.TextBundle; - /** - * Launch AppleCommander. - * This application attempts to identify which type of user-interface to - * launch. Additionally, there are some command-line interface switches - * available - see the about method. - *

- * 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. + * Make AppleCommander version available. *

* 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(); -// } }