diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..bdd70cc --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: [gungwald] +custom: ["https://www.paypal.me/gungwald", "https://cash.app/$BillChatfield", "https://www.venmo.com/u/Bill-Chatfield"] diff --git a/.gitignore b/.gitignore index d11cac9..0f3a508 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ /examples/6809/test.obj /examples/melps-740/test.obj /examples/4004/*.obj +.*.swp +/build/ diff --git a/README.md b/README.md index aac826e..9607f31 100644 --- a/README.md +++ b/README.md @@ -32,4 +32,34 @@ iterative constructs in the source code. Using these dramatically reduces the nu needed in your code and makes the logic much easier to understand. The generated code automatically uses the shortest branch/jump sequence needed. More documentation for about this is available here: -http://www.obelisk.me.uk/dev65/ \ No newline at end of file +http://www.obelisk.me.uk/dev65/ + +## Requirements + + Runtime: Java 1.6 or greater + Compile: Java 1.6 to Java 11 + +Although the sources are written to Java 1.4, there is a 3rd party jar file that requires Java 1.6 at +runtime. So you must have Java 1.6 or greater to run it. It doesn't matter if you have the JRE or JDK. + +Additionally, IzPack, the installer component, requires at least Java 1.6. + +To support the oldest possible Java at runtime, the compile step specifies Java 1.6 bytecode for the +output. This will be the format of the class files in dev65.jar. This means that Java 1.6 will be +required to run the code. But, at most Java 11 is require to perform the compile step because it is +the last version to be able to generate bytecode as old as Java 1.6. + +Why is support being provided for a version of Java as old as 1.6? Why not only support the latest +version of Java? To answer that, ask yourself why you want an assembler for a CPU as old as the 6502. +Additionally, the latest version of Java is only available for the latest versions of Linux, Mac, +and Windows on 64-bit AMD/Intel hardware. If you have older hardware, non-Intel hardware, and/or +an older operating system, you can't run the lastest version of Java. So, supporting the oldest +version of Java possible expands the types of systems this software will run on. To achieve, +"Write once, run anywhere" an older version of Java is required. For example, +it would be preferrable to support these older system which were supported until the most recent code +was added: + + Mac G3 - can run MacOS 10.3 at most - Java 1.4 at most + Mac G4 - can run MacOS 10.4 at most - Java 1.5 at most + Solaris 8 - Java 1.5 at most + diff --git a/build-installer.xml b/build-installer.xml new file mode 100644 index 0000000..00edccd --- /dev/null +++ b/build-installer.xml @@ -0,0 +1,69 @@ + + + + + + + dev65 + from 2021-08-23 + dev65 + 1.4 + https://github.com/gungwald/dev65 + + + + + + + + + + + + + + + + + + + + + + + + + + + + The core files needed for the application + + + + + + + + + + + + + + + + + + + + + diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..f932d54 --- /dev/null +++ b/build.xml @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/Retrotranslator-1.2.9-bin/ASM-LICENSE.txt b/lib/Retrotranslator-1.2.9-bin/ASM-LICENSE.txt new file mode 100644 index 0000000..d0cd82d --- /dev/null +++ b/lib/Retrotranslator-1.2.9-bin/ASM-LICENSE.txt @@ -0,0 +1,28 @@ + + ASM: a very small and fast Java bytecode manipulation framework + Copyright (c) 2000-2005 INRIA, France Telecom + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + THE POSSIBILITY OF SUCH DAMAGE. diff --git a/lib/Retrotranslator-1.2.9-bin/LICENSE.txt b/lib/Retrotranslator-1.2.9-bin/LICENSE.txt new file mode 100644 index 0000000..2b0b57c --- /dev/null +++ b/lib/Retrotranslator-1.2.9-bin/LICENSE.txt @@ -0,0 +1,26 @@ + Copyright (c) 2005 - 2009 Taras Puchko + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + THE POSSIBILITY OF SUCH DAMAGE. diff --git a/lib/Retrotranslator-1.2.9-bin/backport-util-concurrent-3.1.jar b/lib/Retrotranslator-1.2.9-bin/backport-util-concurrent-3.1.jar new file mode 100644 index 0000000..3a4c279 Binary files /dev/null and b/lib/Retrotranslator-1.2.9-bin/backport-util-concurrent-3.1.jar differ diff --git a/lib/Retrotranslator-1.2.9-bin/backport-util-concurrent-java12-3.1.jar b/lib/Retrotranslator-1.2.9-bin/backport-util-concurrent-java12-3.1.jar new file mode 100644 index 0000000..33e076a Binary files /dev/null and b/lib/Retrotranslator-1.2.9-bin/backport-util-concurrent-java12-3.1.jar differ diff --git a/lib/Retrotranslator-1.2.9-bin/changelog.txt b/lib/Retrotranslator-1.2.9-bin/changelog.txt new file mode 100644 index 0000000..15c5396 --- /dev/null +++ b/lib/Retrotranslator-1.2.9-bin/changelog.txt @@ -0,0 +1,271 @@ +Retrotranslator Changelog +================================= + +1.2.9 (2009-08-09) +--------------------------------- + - Fixed a bug: VerifyError: Stack size too large when translating to 1.2 or 1.1. + - Metadata embedded with the reflection option take the highest precedence. + - Backports for interfaces can be inherited when using the smart option. + - Regular expressions can contain quoted strings that end with a back slash. + - Added support for java.net.Socket(java.net.Proxy), but the proxy is ignored. + +1.2.8 (2008-12-14) +--------------------------------- + - Dropped the support of the Android platform. + - Smaller jars when using embedding since the runtime library doesn't use its advanced features internally. + +1.2.7 (2008-06-22) +--------------------------------- + - Added limited support for using backports via reflection. + - Added support for Java 5.0 features in regular expressions. + - Added support for java.math.BigDecimal.stripTrailingZeros(). + - Added options -syncvolatile and -syncfinal to emulate Java 5.0 memory model. + - Added support for methods highestOneBit and lowestOneBit of java.lang.Integer and java.lang.Long. + - Added option -keepclasslit to prevent replacement of certain types with their base types in class literals. + - Added a feature to identify the current JVM as Java 5.0 when using the java.lang.System.getProperty method. + - Fixed a bug: cannot read annotations when using "-reflection safe". + +1.2.6 (2008-02-29) +--------------------------------- + - The -embed option does not require the -destjar or -destdir options. + - Fixed a bug introduced in 1.2.5. All hyphens in file and directory names were replaced with + dollar signs in advanced mode or when the Retrotranslator.fixHyphen option was specified. + +1.2.5 (2008-02-26) +--------------------------------- + - Added support for generics and annotations on the Android platform. + - Added options -reflection and -stripannot. + +1.2.4 (2008-01-28) +--------------------------------- + - Added support for Java 5.0 API on J2SE 1.3. + - Fixed a bug in translation of inner classes for Java 1.3 and earlier. + - Added a workaround for a bug #4776385 in Sun JDK 1.2.2 for Windows. + - Fixed a bug: translated jar files didn't contain directory entries. + - Added support for java.lang.reflect.Member.isSynthetic(). + - Added support for java.math.BigDecimal.divide(BigDecimal). + - Added support for the java.lang.Math methods: cbrt(double), cosh(double), expm1(double), + log10(double), log1p(double), signum(double), signum(float), sinh(double), tanh(double). + - Added support for UnsupportedOperationException(String, Throwable), UnsupportedOperationException(Throwable). + +1.2.3 (2007-10-28) +--------------------------------- + - Basic support for Java 1.1, 1.2, and 1.3. + - Backports are loaded using the classpath option. + - New option -smart to make backports inheritable. + - Support for Java 5 methods of java.util.Properties. + - Support for Java 5 methods of javax.net.ssl.HttpsURLConnection. + - Support for SecurityException(String, Throwable), SecurityException(Throwable). + - Limited support for java.lang.Thread.getState() and java.lang.Thread.getAllStackTraces(). + - Limited support for Java 5 methods of java.net.URLConnection and java.net.HttpURLConnection. + - Limited support for java.util.Timer(String), java.util.Timer(String, boolean), java.util.Timer.purge(). + - Improved the -uptodatecheck functionality, in particular when translating jars. + - Fixed a bug: Interface methods that override methods from java.lang.Object didn't work in certain cases. + - Fixed a bug: Missing constructors passed verification when such constructors were present in base classes. + - Fixed a bug: It wasn't possible to catch exceptions in java.lang.Thread.run() when using the advanced option. + - Added a warning for a case when wrong classes are used for the verification. + - With the -lazy option only translated classes are verified. + - Upgraded to backport-util-concurrent 3.1. + +1.2.2 (2007-06-25) +--------------------------------- + - Support for java.math.BigInteger.TEN. + - Support for java.lang.Short.reverseBytes(short). + - Support for java.lang.StackTraceElement(String, String, String, int). + - Support for the append methods of java.io.StringWriter and java.io.CharArrayWriter. + - Support for java.math.BigDecimal(char[]) and java.math.BigDecimal(char[], int, int). + - Limited support for java.lang.StringBuffer.trimToSize(). + - Limited support for java.lang.Thread.UncaughtExceptionHandler. + - Limited support for java.nio.charset.Charset.defaultCharset(). + - Limited support for java.lang.management.ManagementFactory.getPlatformMBeanServer(). + - New option -support to enable advanced features one by one. + - New option -uptodatecheck to skip translation of files if the destination files are newer. + - Changed the messages printed during translation. + - Fixed a bug with using enum values when initializing static fields of the same enum. + +1.2.1 (2007-02-01) +--------------------------------- + - Support for java.util.Deque and java.util.ArrayDeque. + - Support for java.util.Arrays.copyOf(...) and java.util.Arrays.copyOfRange(...). + - Limited support for UNICODE-related methods of Character, String, and StringBuffer. + - The -backport option accepts individual classes and is used even when -retainapi is specified. + +1.2.0 (2007-01-10) + WARNING: This release is not fully compatible with the previous one. +--------------------------------- + - Supported java.lang.ThreadLocal.remove() in advanced mode. + - Added -target option for Java 6 to Java 5 translation. + - Improved bytecode compatibility with different JVMs. + - Backported java.util.concurrent.locks.LockSupport. + - Added java.net.Proxy and java.net.ProxySelector. + - Added java.net.URL.openConnection(Proxy), currenly the argument is ignored. + - Added java.lang.instrument.* classes, but instrumentation is not supported. + - Added java.lang.Thread.State enumeration, but Thread.getState() is not implemented. + - Limited support for DecimalFormat.isParseBigDecimal() and DecimalFormat.setParseBigDecimal(boolean). + - Removed deprecated Retrotranslator constructor and JITRetrotranslator.install method. + - Ant task: added nested fileset, jarfileset, and dirset; removed src. + - Upgraded to backport-util-concurrent 3.0. + - Signature is being removed when translating signed jars. + - Retrotranslator runtime depends on backport-util-concurrent. + - When embedding runtime support, only directly or indirectly referenced classes are being kept. + +1.1.0 (2006-11-08) +--------------------------------- + - New -retainflags option to keep Java 5 specific access modifiers (was default before). + - SoftReference(Object, ReferenceQueue) and WeakReference(Object, ReferenceQueue) are being + intercepted in advanced mode to support null for the second parameter on any JVM 1.4. + +1.0.9 (2006-10-25) +--------------------------------- + - Supported: java.net.URL.toURI(). + - Supported: all methods of java.lang.reflect.AccessibleObject. + - Supported: java.lang.Integer.signum(int) and java.lang.Long.signum(long). + - Supported: java.util.Formatter and formatting methods of java.lang.String. + - Supported: all constructors and methods of java.io.PrintStream and java.io.PrintWriter. + - New -backport option for user-specified backport packages. + - New options for JITRetrotranslator: -advanced and -backport (-advanced was default before). + - Bug fixed: Embedding runtime & backport failed in UNIX environments. + - Only required jars are being embedded when an -embed option is specified. + +1.0.8 (2006-08-20) +--------------------------------- + - Supported: all constructors of java.io.PrintWriter. + - Supported: java.rmi.server.RemoteObjectInvocationHandler. + - Supported: IllegalArgumentException(String, Throwable), IllegalArgumentException(Throwable). + - Supported: java.util.concurrent.locks.Condition.awaitNanos(long) but with very little accuracy guarantees. + - Supported in BigDecimal: divideAndRemainder(BigDecimal), divideToIntegralValue(BigDecimal), remainder(BigDecimal). + - Bug fixed: translation did not work for ReentrantReadWriteLock.readLock() and ReentrantReadWriteLock.writeLock(). + - New -retainapi option to make classes compatible with JVM 1.4 but keep use of Java 5 API. + +1.0.7 (2006-07-04) +--------------------------------- + - Bug fixed: MissingResourceException when Java 5.0 API is used for classes generated at runtime. + - Ability to specify a package name for embedding retrotranslator-runtime-x.x.x.jar and backport-util-concurrent.jar. + +1.0.6 (2006-06-27) +--------------------------------- + - Emulated generic signatures for the collections framework classes (useful for JAXB). + - Cached data used by the transformer can be garbage collected. + +1.0.5 (2006-06-05) +--------------------------------- + - New -advanced option allows to override Java 1.4 methods. + - Supported in BigDecimal: ZERO, ONE, TEN, pow(int), toPlainString(), valueOf(double), valueOf(long). + - Supported BigDecimal.setScale(int, int) for negative scales in advanced mode. + - Ability to process UTF-8 text files in addition to bytecode: "-srcmask *.class;*.tld". + - getMethod(String, Class...) and getDeclaredMethod(String, Class...) are intercepted in advanced mode + to better support generics and covariant return types on several JVM implementations, e.g. JRockit 1.4.2_08-b03. + - Upgraded to backport-util-concurrent 2.2. + - Deleted net.sf.retrotranslator.runtime.java.util._Collections (edu.emory.mathcs.backport.java.util.Collections is + used instead), so retrotranslator-runtime-1.0.5.jar is NOT binary compatible with retrotranslator-runtime-1.0.4.jar. + +1.0.4 (2006-04-25) +--------------------------------- + - Bug fixed: String.replace(CharSequence, CharSequence) did not work with some characters. + - Bug fixed: NotSerializableException when serializing annotations. + - Retrotranslator will not replace "-" by "$" in identifiers any more, e.g. in "package-info.class". + +1.0.3 (2006-04-04) +--------------------------------- + - Bug fixed: NullPointerException on invisible (RetentionPolicy.CLASS) annotations + - Supported: java.util.regex.Pattern.quote(String). + +1.0.2 (2006-03-21) +--------------------------------- + - Bug fixed: exception on deserialization of enum inner classes. + +1.0.1 (2006-03-13) +--------------------------------- + - Bug fixed: NullPointerException in RetrotranslatorTask + - Access to methods emptyList(), emptyMap(), emptySet() of java.util.Collections + is now being replaced with access to fields EMPTY_LIST, EMPTY_MAP, EMPTY_SET. + +1.0.0 (2006-03-10) +--------------------------------- + - Ability to process JAR files. + - Supported: System.nanoTime(), System.clearProperty(String), Boolean.compareTo(Boolean) + +0.9.9 (2006-03-01) +--------------------------------- + - Supported: Thread.getId(), UUID, MatchResult, Flushable, Appendable, Readable. + - Retrotranslator transformer API was improved for better plugin integration. + - JIT Retrotranslator works on IBM JDK and BEA JRockit JDK. + - Bug fixed: debug information is kept in translated classes. + - Bug fixed: invocations of DelayQueue are translated properly. + - Bug fixed: JIT Retrotranslator supports runtime annotations. + +0.9.8 (2006-02-03) +--------------------------------- + - Bug fixed: translated classes didn't work on JRE 1.4.1-b21 where only java.lang.Object may be used + as qualifying type for array cloning. See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4750641 + - Limited support for Thread.getStackTrace(). Non-empty stack trace is returned only for current thread. + - Support for StringBuffer(CharSequence) and for StringBuffer methods: append(CharSequence), + append(CharSequence, int, int), insert(int, CharSequence), insert(int, CharSequence, int, int) + - Option "-lazy" was added to transform Java 5.0 bytecode only. + - Upgrade to backport-util-concurrent 2.1. + +0.9.7 (2006-01-12) +--------------------------------- + - Support for EnumMap, Closeable, IllegalStateException(String, Throwable), IllegalStateException(Throwable). + - Class literal expression (Classname.class) caused class initialization, fixed. + - A private copy of ASM was put into retrotranslator-runtime-0.9.7.jar to prevent ASM versions conflict. + - JITRetrotranslator does not require sun.misc.* classes to compile. + +0.9.6 (2006-01-05) +--------------------------------- + - Dynamic discovery of backported classes. + - Full support for generics reflection. + - Improved java.lang.Enum support. + - Support for all methods in java.lang.Class. + - Support for BigDecimal(int), BigDecimal(long). + - Iterable is distinct from Collection, but even Iterable arrays can hold Collections. + - Patch 1392759 - build patch to create maven repository deployment units. + +0.9.5 (2005-12-28) +--------------------------------- + - Support for EnumSet. + - Support for methods in Arrays. + - Partial support for generics reflection. + - Patch 1392096 - easier integration to Maven 2. + - Patch 1391894 - fix for bug 1391863. + - Patch 1391842 - build patch for Mac OS X. + - ASM 2.1 replaced with ASM 3.0 beta. + +0.9.4 (2005-12-19) +--------------------------------- + - Support for methods in LinkedList: element, offer, peek, poll, remove. + - Support for methods in Package: isAnnotationPresent, getAnnotation, getAnnotations, getDeclaredAnnotations. + - A variable or field of type Queue is assignable from LinkedList. + - A variable or field of type AnnotatedElement is assignable from Package, Class, Constructor, Field, or Method. + - Bug fix: IOException when JIT Retrotranslator runs jar file with dependencies. + +0.9.3 (2005-12-13) +--------------------------------- + - JIT Retrotranslator for Sun JVM 1.4 added. You may launch your application from + net.sf.retrotranslator.transformer.JITRetrotranslator or simply + call JITRetrotranslator.install() before loading Java 5.0 classes. + - java.lang.Iterable is now replaced with java.util.Collection during translation. + - Bug fix: Class.isAnnotation and Class.isEnum didn't work. + +0.9.2 (2005-12-09) +--------------------------------- + - Support for methods: String.contains, String.contentEquals, String.replace, Matcher.quoteReplacement, + Class.isAnnotation, Class.isEnum, Collections.checkedMap, Class.checkedSortedMap. + - New option -stripsign to strip signature information used by Java 5.0 compiler. + - Bug fix: the verifier didn't deal with abstract classes and arrays of primitives correctly. + +0.9.1 (2005-12-08) +--------------------------------- + - A reference verifier to show warnings when references to unknown classes, methods, or fields are found. + - An integrated Ant task. + - Command line syntax changed: + replaced: -source by -srcdir; + added: -destdir, -verify, -classpath; + removed: -target + - Support for methods: Boolean.parseBoolean, Class.getEnumConstants, Class.cast, Class.asSubclass. + - Support for new methods in Collections: checkedCollection, checkedSet, checkedSortedSet, + checkedList, emptySet, emptyList, emptyMap, reverseOrder, frequency, disjoint, addAll. + +0.9.0 (2005-11-28) +--------------------------------- +Initial release diff --git a/lib/Retrotranslator-1.2.9-bin/readme.html b/lib/Retrotranslator-1.2.9-bin/readme.html new file mode 100644 index 0000000..f8b9d5f --- /dev/null +++ b/lib/Retrotranslator-1.2.9-bin/readme.html @@ -0,0 +1,1149 @@ + + + + Retrotranslator + + + + + + + + + +

Retrotranslator

SourceForge.net Logo +   + The best Java IDE +
+

Contents

+
    +
  1. What is Retrotranslator?
  2. +
  3. What Java 5.0 features are supported?
  4. +
  5. How to use Retrotranslator from the command line?
  6. +
  7. How to use Retrotranslator from Apache Ant or Maven?
  8. +
  9. How to use Retrotranslator from IntelliJ IDEA?
  10. +
  11. How to produce a jar file compatible with Java 1.4?
  12. +
  13. How to use Just-in-Time Retrotranslator?
  14. +
  15. What API is supported on Java 1.4 and Java 1.3?
  16. +
  17. How to write an extension?
  18. +
  19. What are the limitations?
  20. +
  21. Alternative tools
  22. +
  23. Contact
  24. +
  25. License
  26. +
+

What is Retrotranslator?

+ +

+ Retrotranslator is a tool that makes Java applications compatible with Java 1.4, Java 1.3 and other environments. + It supports all Java 5.0 language features and a significant part of the Java 5.0 API on both J2SE 1.4 and J2SE 1.3. + In other Java environments only the Java 5.0 features that don't depend on the new API are supported. + Retrotranslator employs the ASM bytecode manipulation framework to transform + compiled Java classes and the backport of the Java 5.0 + concurrency utilities to emulate the Java 5.0 API. +

+

What Java 5.0 features are supported?

+ +

How to use Retrotranslator from the command line?

+
    +
  1. Download + and unzip the binary distribution file Retrotranslator-n.n.n-bin.zip, + where n.n.n is the latest Retrotranslator release number. +
  2. +
  3. + Compile your classes with Java 5.0 or Java 6 and put them into some directory, e.g. myclasses. +
  4. +
  5. + Go to the unzipped directory and execute:
    + java -jar retrotranslator-transformer-n.n.n.jar -srcdir myclasses
    + Use appropriate options to verify the result and for troubleshooting, e.g. -verify, + -classpath, -advanced, + and -smart. +
  6. +
  7. + Put retrotranslator-runtime-n.n.n.jar and + backport-util-concurrent-n.n.jar into the + classpath of your application if you use the Java 5.0 API. +
  8. +
  9. + Run or debug the application as usual on Java 1.4. +
  10. +
+

The command line syntax:
+ java -jar retrotranslator-transformer-n.n.n.jar <options> +
or
+ java -cp retrotranslator-transformer-n.n.n.jar + net.sf.retrotranslator.transformer.Retrotranslator <options>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescriptionDefault
-srcdir <path>The directory with the files to process (can be specified several times).-
-srcjar <file>The jar file with the files to process (can be specified several times).-
-destdir <path>The directory to place processed files.The source.
-destjar <file>The jar file to place processed files.The source.
-srcmask <mask>The wildcard pattern specifying the files to transform rather than copy + (classes or UTF-8 text files), e.g. *.class;?*.tld. + *.class
-target <version>The version of the JVM where the translated application should be able to run (1.1, 1.2, 1.3, 1.4, or 1.5). + The Java 5.0 API is supported only for the 1.4 and 1.3 targets, but user-defined + backport classes can be used for other targets as well. + 1.4
-classpath <path>The dependencies of the translated classes including backport packages and jar files from the target JVM. + For the 1.4 target the following files should be specified among others: rt.jar, + jce.jar, and jsse.jar from Sun JRE 1.4; + retrotranslator-runtime-n.n.n.jar and + backport-util-concurrent-n.n.jar. + For the 1.3 target the files are: rt.jar from Sun JRE 1.3, + retrotranslator-runtime13-n.n.n.jar and + backport-util-concurrent-java12-n.n.jar. + This option can be omitted if the current Java environment matches the target one. + The current classpath.
-verifyAsks the translator to examine translated bytecode for references to classes, methods, or fields that cannot be + found in the classpath. Every use of Java 5.0 API will result in a warning + message if the classpath contains jar files from JRE 1.4. + false
-support <features>Enables advanced features. The names specified should be separated with semicolons, e.g. + ThreadLocal.remove;BigDecimal.setScale. + -
-advancedEnables all advanced features at once, but it's recommended to enable only required features + in order to avoid compatibility issues. + false
-smartMakes all backport classes inheritable provided that the classpath + correctly reflects the target environment. + For example, the backport of the Writer.append(String) method can be used + to translate the following expression: new FileWriter("file.tmp").append("Hello"). + false
-syncvolatileMakes access to volatile fields of Java 5.0 classes compliant with Java 5.0 memory model + at the cost of decreased performance. Highly recommended to use. + false
-syncfinalMakes access to final instance fields of Java 5.0 classes compliant with Java 5.0 memory model + at the cost of decreased performance. Not recommended to use. + false
-backport <names>The backport names separated with semicolons, e.g. + com.myco.all;java.util:com.myco.ju;javax.net.SocketFactory:com.myco.jsse.Factory. + The corresponding backport classes must be present in the classpath. + -
-embed <package>The unique package name for a partial copy of retrotranslator-runtime-n.n.n.jar and + backport-util-concurrent-n.n.jar to be put along with translated classes. + This makes the translated application independent of other versions of Retrotranslator present in the classpath. + -
-lazyAsks the translator to transform and verify only the classes compiled with a target greater than the + current one. + false
-stripsignWhether to remove signature (generics) information.false
-stripannotWhether to remove annotations and related attributes.false
-verboseAsks the translator for verbose output.false
-retainapiAsks the translator to modify classes for JVM compatibility but keep use of API + unless overriden with the backport option. + Any references introduced by a compiler remain unchanged, like the use of + java.lang.StringBuilder for string concatenation or + the implicit valueOf method calls for autoboxing. + false
-keepclasslitPrevents replacement of certain types like java.lang.Iterable or java.util.Queue + with their base types in class literals.false
-retainflagsWhether to keep Java 5.0 specific access modifiers.false
-uptodatecheckAsks the translator to skip processing of files if the destination files are newer.false
-reflection <mode>Setting this option to safe makes the translator include additional metadata into classes, + so reflection works even if the classes are unavailable as resources.normal
+

How to use Retrotranslator from Apache Ant or Maven?

+ +

The distribution contains an Apache Ant task + net.sf.retrotranslator.transformer.RetrotranslatorTask. Every command line + option can be set using the corresponding attribute. In addition the source files can be specified with nested + fileset, jarfileset, and dirset elements and the + classpath can be set with nested classpath + elements or the classpathref attribute. + The source directories specified with srcdir, dirset, + and the dir attribute of fileset should contain the root package of the classes. + In case of warnings the build fails unless the value of the failonwarning attribute is set to + false. The following script can be used to build one jar compatible with Java 1.4 and + another one compatible with Java 1.3. +

+
+    <taskdef name="retrotranslator" classname="net.sf.retrotranslator.transformer.RetrotranslatorTask">
+        <classpath>
+            <fileset dir="../Retrotranslator-n.n.n-bin">
+                <include name="retrotranslator-transformer-n.n.n.jar" />
+                <include name="retrotranslator-runtime-n.n.n.jar" />
+                <include name="backport-util-concurrent-n.n.jar" />
+            </fileset>
+        </classpath>
+    </taskdef>
+    
+    <retrotranslator target="1.4" destjar="build/application14.jar"
+                     smart="true" verify="true" failonwarning="false">
+        <fileset dir="build/classes" includes="**/*.class" />
+        <jarfileset dir="build/lib" includes="**/*.jar" />
+        <classpath>
+            <fileset dir="../j2sdk1.4.2_17/jre/lib" includes="**/*.jar"/>
+            <fileset dir="../Retrotranslator-n.n.n-bin">
+                <include name="retrotranslator-runtime-n.n.n.jar" />
+                <include name="backport-util-concurrent-n.n.jar" />
+            </fileset>
+            <fileset dir="lib" includes="**/*.jar"/>
+        </classpath>
+    </retrotranslator>
+
+    <retrotranslator target="1.3" destjar="build/application13.jar"
+                     smart="true" verify="true" failonwarning="false">
+        <fileset dir="build/classes" includes="**/*.class" />
+        <jarfileset dir="build/lib" includes="**/*.jar" />
+        <classpath>
+            <fileset dir="../jdk1.3.1_20/jre/lib" includes="**/*.jar"/>
+            <fileset dir="../Retrotranslator-n.n.n-bin">
+                <include name="retrotranslator-runtime13-n.n.n.jar" />
+                <include name="backport-util-concurrent-java12-n.n.jar" />
+            </fileset>
+            <fileset dir="lib" includes="**/*.jar"/>
+        </classpath>
+    </retrotranslator>
+
+

+ Maven users can use the + Retrotranslator plugin from the + Mojo Project. +

+

How to use Retrotranslator from IntelliJ IDEA?

+ +

+ There is a plugin to automatically translate and verify + classes compiled by IntelliJ IDEA, so you can develop in Java 5.0 but + run and debug on Java 1.4. +

+

How to produce a jar file compatible with Java 1.4?

+ +

+ If you have a myapplication5.jar file built with Java 5.0 you can use the following command to produce + myapplication4.jar. The jar file will be compatible with Java 1.4 and independent of Retrotranslator + because backport classes are added to the translated application with a different package name. +

+ +

+ java -jar retrotranslator-transformer-n.n.n.jar + -srcjar myapplication5.jar -destjar myapplication4.jar -embed com.mycompany.internal
+

+ +

+ Also it is recommended to specify the classpath, + verify, and smart options. + In case of verification failure try the support option. +

+

How to use Just-in-Time Retrotranslator?

+

+ In order to run a Java 5.0 application on Java 1.4 start it with JIT Retrotranslator using one of the following commands: +

+ +

+ The options include support, + advanced, smart, + backport, syncvolatile, + syncfinal, and + keepclasslit. When running on J2SE 5.0 JIT Retrotranslator simply + calls the application, but on J2SE 1.4 it also translates classes compiled for Java 5.0 or later. However this + capability depends on the current JVM and the application itself, so under certain conditions JIT Retrotranslator + may be unable to translate either a jar file or classes from the classpath or both. +

+ +

What API is supported on Java 1.4 and Java 1.3?

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PackageClassMembersCompatibility notes
java.ioCloseable2 + * (all members introduced in Java 5.0) 
Flushable2* 
PrintStream + * (11 new methods and constructors)
+ PrintStream(File, String)5,
+ PrintStream(String, String)5 +
 
PrintWriter + * (11 new methods and constructors) + + The PrintWriter.format and PrintWriter.printf methods always flush the output buffer. +
Reader5* (1 new method) 
Writer* (3 new methods) 
java.langAppendable2* +  
Boolean* (2 new methods)
+ toString(boolean)6,
+ valueOf(boolean)6 +
 
Byte* (1 new method) 
Character* (44 new methods)
+ getDirectionality(int)5,
+ isMirrored(int)5,
+ toString(char)6 +
New members of Character.UnicodeBlock are not supported. + All supplementary code points are considered as unassigned. +
CharSequence6* 
Class* (21 new methods) + Enable feature "Class.forName" to use backported classes as a fallback when calling this + method3.
+ Enable features "Class.getMethod" and "Class.getDeclaredMethod" to use most of + backported static methods as a fallback when calling these methods and for more uniform support of generics + and covariant return types on different platforms3. +
Deprecated* 
DoublevalueOf(double) 
Enum* 
FloatvalueOf(float) 
IllegalArgumentException* (2 new constructors) 
IllegalStateException* (2 new constructors) 
IntegervalueOf(int),
signum(int)
 
Iterable2* 
LongvalueOf(long),
signum(long)
 
Mathcbrt(double), cosh(double),
+ expm1(double), log10(double),
+ log1p(double), signum(double),
+ signum(float), sinh(double),
+ tanh(double)
The quality of computation may be insufficient for applications of certain types.
Package* (4 new methods) + Enable feature "Retrotranslator.fixHyphen" to change the name + of package-info classes to package$info3. +
Readable2,5* 
Short* (2 new methods) 
StackTraceElement6* (1 new constructor) 
String* (10 new methods and constructors)
+ isEmpty()4 +
Enable features "String.matches", "String.replaceAll", + "String.replaceFirst" and "String.split" to support + Java 5.0 features in regular expressions when calling these methods3. +
StringBuffer* (11 new methods and constructors) + append(StringBuffer)6 + + Enable feature "StringBuffer.trimToSize" to use an empty implementation of + the StringBuffer.trimToSize() method3. +
StringBuilder*StringBuilder is being replaced with StringBuffer.
SuppressWarnings* 
SystemnanoTime()1,
clearProperty(String)
+ The System.nanoTime() method precision + + may vary on different platforms.
+ Enable feature "System.getProperty" to identify the current JVM as compatible + with Java 5.0 when calling this method at runtime3. +
Thread* (8 new methods) + The Thread.getId() method does not reflect the order in which threads have been created.
+ The Thread.getStackTrace() and Thread.getAllStackTraces() + methods return non-empty stack trace only for the current thread.
+ Enable feature "Thread.getState" to support this method, but it will detect only + NEW, RUNNABLE and TERMINATED states.3
+ Enable features "Thread.setUncaughtExceptionHandler" and + "Thread.setDefaultUncaughtExceptionHandler" to support exception handlers for threads + created by translated code (in contrast to Java 5.0 the default UncaughtExceptionHandler + takes precedence over ThreadGroup)3. +
Thread.State* 
Thread.UncaughtExceptionHandler2* 
ThreadLocal* (1 new method)Enable feature "ThreadLocal.remove" to use alternative ThreadLocal + and InheritableThreadLocal implementations with method + remove()3. +
TypeNotPresentException* 
Throwable + Throwable(String, Throwable)6,
+ Throwable(String, Throwable)6,
+ getCause()6,
+ getStackTrace()6,
+ initCause(Throwable)6 +
The additional constructors and methods are available for all Java 1.3 exception classes + if the smart option has been used. +
UnsupportedOperationException* (2 new constructors) 
java.lang.annotation* (all classes)* 
java.lang.instrument** + Bytecode instrumentation is not implemented. +
java.lang.managementManagementFactory + getPlatformMBeanServer() + The ManagementFactory.getPlatformMBeanServer() method simply returns + the first registered MBeanServer or creates it when no one exists. + Requires an implementation of JMX 1.2. +
java.lang.refSoftReference* + Enable feature "SoftReference.NullReferenceQueue" to + support null for the second parameter of + SoftReference(Object,ReferenceQueue) + on all platforms3. +
WeakReference* + Enable feature "WeakReference.NullReferenceQueue" to + support null for the second parameter of + WeakReference(Object,ReferenceQueue) + on all platforms3. +
java.lang.reflectAccessibleObject* (4 new methods) 
AnnotatedElement2* 
Constructor* (11 new methods) 
Field* (8 new methods) 
GenericArrayType* 
GenericDeclaration2* 
GenericSignatureFormatError* 
MalformedParameterizedTypeException* 
Member* (1 new method) 
Method* (14 new methods) 
ParameterizedType* 
Type2* 
TypeVariable* 
WildcardType* 
java.mathBigDecimal + ZERO, ONE, TEN,
+ BigDecimal(int),
+ BigDecimal(long),
+ BigDecimal(char[]),
+ BigDecimal(char[], int, int),
+ divide(BigDecimal),
+ divideAndRemainder(BigDecimal),
+ divideToIntegralValue(BigDecimal),
+ pow(int),
+ remainder(BigDecimal),
+ stripTrailingZeros(),
+ toPlainString(),
+ valueOf(double),
+ valueOf(long)
+ Enable feature "BigDecimal.setScale" to support negative scales in the + BigDecimal.setScale(int, int) method3. +
BigIntegerTEN 
java.netHttpURLConnection* (6 new methods) + Enable features "HttpURLConnection.setChunkedStreamingMode", + "HttpURLConnection.setFixedLengthStreamingMode" + to use the corresponding methods, but on Java 1.4 they will simply return. + Consider using alternative or writing own protocol handlers. +
Proxy5* 
ProxySelector5* 
Socket3,5Socket(Proxy) + Enable feature "Socket.New" + to to call the Socket(Proxy) + constructor, but the Proxy parameter will be ignored. +
URL5* (2 new methods)The Proxy parameter is ignored by the + URL.openConnection(Proxy) method. +
URLConnection* (4 new methods) + Enable features "URLConnection.getConnectTimeout", "URLConnection.setConnectTimeout", + "URLConnection.getReadTimeout", "URLConnection.setReadTimeout" + to use the corresponding methods, but on Java 1.4 they will simply return. + Consider using alternative or writing own protocol handlers. +
java.nio5CharBuffer* (4 new methods) 
Charset* (1 new method)The Charset.defaultCharset() method returns UTF-8 + if the default charset is unavailable (occurs on JDK 1.4.0). +
java.rmi.serverRemoteObjectInvocationHandler* 
java.textDecimalFormat* (2 new methods) + Enable feature "DecimalFormat.setParseBigDecimal" to support the + DecimalFormat.setParseBigDecimal(boolean) method, but + parsing and formatting precision will still be limited by the java.lang.Double + or java.lang.Long precision3. +
java.utilAbstractQueue1* 
ArrayDeque1,4* 
Arrays* (21 new methods)
+ copyOf(...)4 (10 methods)
+ copyOfRange(...)4 (10 methods) +
 
Calendar + getTimeInMillis()6,
+ setTimeInMillis(long)6 +
 
Collections1* (13 new methods)
+ newSetFromMap(Map)4,
+ list(Enumeration)6,
+ replaceAll(List, Object, Object)6,
+ swap(List, int, int)6 +
 
Deque1,2,4* 
EnumMap* 
EnumSet* 
Formatter* 
LinkedList* (5 new methods) 
PriorityQueue1* 
Properties*Requires an implementation of JAXP 1.3 for J2SE 1.3.
Queue1,2* 
Timer* (3 new methods and constructors) + Enable feature "Timer.All" to use alternative Timer + and TimerTask implementations in order to be able to call Timer(String), + Timer(String, boolean), and Timer.purge()3. +
UUID* 
java.util.concurrent,
java.util.concurrent.atomic,
java.util.concurrent.locks
almost all classes1almost all methodsThe LockSupport class may be unusable due to insufficient performance. + The Condition.awaitNanos(long) method has + + little accuracy guarantees. +
java.util.regex5Matcher + quoteReplacement(String),
toMatchResult()
 
MatchResult2* 
PatternLITERAL3,
quote(String)
Enable features "Pattern.compile" and "Pattern.matches" to support + Java 5.0 features in regular expressions when calling these methods3. +
javax.net.ssl5HttpsURLConnection * (2 new methods) 
+

+ 1 Supported via the + Backport of JSR 166.
+ 2 In most cases this type is being replaced with its base type.
+ 3 Supported only when the corresponding feature is enabled via the + support or + advanced options.
+ 4 Introduced in Java 6.
+ 5 Not supported on J2SE 1.3.
+ 6 Introduced in Java 1.4 and supported on J2SE 1.3.
+

+

How to write an extension?

+ +

+ In order to support the API unavailable on the target platform Retrotranslator should be able to replace all references + to new classes, constructors, methods, and fields with references to backports compatible with the platform. + The location of the backports must be specified with the classpath option. The + default + backports for the 1.4 target have been packaged into the retrotranslator-runtime-n.n.n.jar and + backport-util-concurrent-n.n.jar files, and to complement or override them additional backport + names can be specified via the backport option or a + properties + file. The backport names can have five + different forms, the first one declares a universal backport package and the others allow reusing existing backports. +

+ + + + + + + + + + + + + + + + + + + + + + + + + +
Backport name formExample
<universal backport package name>net.sf.retrotranslator.runtime
+ com.mycompany.backport
<original package name>:<backport package name>java.util.concurrent:edu.emory.mathcs.backport.java.util.concurrent
+ com.sun.org.apache.xerces.internal:org.apache.xerces
<original class name>:<backport class name>java.lang.StringBuilder:java.lang.StringBuffer
+ java.util.LinkedHashMap:org.apache.commons.collections.map.LinkedMap
<original method name>:<backport method name>java.lang.System.nanoTime:edu.emory.mathcs.backport.java.util.concurrent.helpers.Utils.nanoTime
<original field name>:<backport field name>java.util.Collections.EMPTY_MAP:edu.emory.mathcs.backport.java.util.Collections.EMPTY_MAP
+

+ The names of backport classes in a universal backport package consist of the backport package name, + the name of the original class, and an optional trailing underscore. For example, + + net.sf.retrotranslator.runtime.java.util.EnumSet_ is a complete backport of + java.util.EnumSet. + But when classes exist on the target platform then the backports of their new fields, constructors and methods are + grouped into classes with a leading underscore in their names. Look at the + + net.sf.retrotranslator.runtime.java.math._BigDecimal class: +

+ +

+ The + net.sf.retrotranslator.runtime.java.io._PrintStream and + + net.sf.retrotranslator.runtime.java.lang._SecurityException classes use another type of + constructor backports. There is a public static + createInstanceBuilder method that accepts constructor's arguments an returns an object with public + argument1...argumentN methods and an optional public void initialize method. + All the argumentX methods don't have any parameters and provide arguments for a constructor that exists + on the target platform. The initialize method has a single parameter for the created instance and can be + used for postprocessing. And the most flexible but unsupported in certain cases way has been used by + + net.sf.retrotranslator.runtime.java.lang._StackTraceElement. +

+

+ If backported methods require access to non-public methods or fields of the instance, they can do it with reflection + when the security manager allows such access. The backports of public instance fields are not supported, but private + instance fields can be emulated using a weak identity map, see + + net.sf.retrotranslator.runtime.java.lang._Thread for an example. +

+ +

What are the limitations?

+ +

Alternative tools

+ +

Contact

+ +

License

+
+    Copyright (c) 2005 - 2009 Taras Puchko
+    All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions
+    are met:
+    1. Redistributions of source code must retain the above copyright
+       notice, this list of conditions and the following disclaimer.
+    2. Redistributions in binary form must reproduce the above copyright
+       notice, this list of conditions and the following disclaimer in the
+       documentation and/or other materials provided with the distribution.
+    3. Neither the name of the copyright holders nor the names of its
+       contributors may be used to endorse or promote products derived from
+       this software without specific prior written permission.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+    THE POSSIBILITY OF SUCH DAMAGE.
+
+ + diff --git a/lib/Retrotranslator-1.2.9-bin/retrotranslator-runtime-1.2.9.jar b/lib/Retrotranslator-1.2.9-bin/retrotranslator-runtime-1.2.9.jar new file mode 100644 index 0000000..dc1f694 Binary files /dev/null and b/lib/Retrotranslator-1.2.9-bin/retrotranslator-runtime-1.2.9.jar differ diff --git a/lib/Retrotranslator-1.2.9-bin/retrotranslator-runtime13-1.2.9.jar b/lib/Retrotranslator-1.2.9-bin/retrotranslator-runtime13-1.2.9.jar new file mode 100644 index 0000000..4ef0803 Binary files /dev/null and b/lib/Retrotranslator-1.2.9-bin/retrotranslator-runtime13-1.2.9.jar differ diff --git a/lib/Retrotranslator-1.2.9-bin/retrotranslator-transformer-1.2.9.jar b/lib/Retrotranslator-1.2.9-bin/retrotranslator-transformer-1.2.9.jar new file mode 100644 index 0000000..f48eff1 Binary files /dev/null and b/lib/Retrotranslator-1.2.9-bin/retrotranslator-transformer-1.2.9.jar differ diff --git a/lib/izpack-standalone-compiler-4.3.5.jar b/lib/izpack-standalone-compiler-4.3.5.jar new file mode 100644 index 0000000..bbc0810 Binary files /dev/null and b/lib/izpack-standalone-compiler-4.3.5.jar differ diff --git a/lib/jar-in-jar-loader.zip b/lib/jar-in-jar-loader.zip new file mode 100644 index 0000000..7e5a3ab Binary files /dev/null and b/lib/jar-in-jar-loader.zip differ diff --git a/scripts/add-to-path b/scripts/add-to-path new file mode 100755 index 0000000..acc9869 --- /dev/null +++ b/scripts/add-to-path @@ -0,0 +1,50 @@ +#!/bin/sh + +# Script: add-to-path.sh +# Author: Bill Chatfield + +findDotProfile() +{ + for f in .bash_profile .profile + do + if [ -n "$SUDO_USER" ] + then + profile=/home/$SUDO_USER/$f + else + profile="$HOME"/"$f" + fi + if [ -f "$profile" ] + then + echo $profile + break + fi + done +} + +addSingleDirToPath() +{ + if grep -eq "^export PATH=.*:$1" "$2" + then + echo $1 is already in the PATH. + else + echo Run this: export PATH=\$PATH:$1 + echo export PATH=\$PATH:$1 >> "$2" + fi +} + +addToPath() +{ + profile=`findDotProfile` + if [ $# -eq 0 ] + then + addSingleDirToPath `pwd` "$profile" + else + for directory in "$@" + do + addSingleDirToPath "$directory" "$profile" + done + fi +} + +addToPath "$@" + diff --git a/scripts/add-to-path.bat b/scripts/add-to-path.bat new file mode 100644 index 0000000..cf22779 --- /dev/null +++ b/scripts/add-to-path.bat @@ -0,0 +1,80 @@ +rem @echo off + +rem Script: add-to-path.bat +rem Author: Bill Chatfield + +rem +rem Check for help argument. +rem +set ARG=%1 +if defined ARG ( + set ARG=%ARG:H=h% + set ARG=!ARG:?=h! + set ARG=!ARG:/=-! + set ARG=!ARG:--=-! + set ARG=!ARG:~0,2! + if !ARG!==-h ( + echo Usage: %~n0 [directory] + ) +) + +if "%1"=="" ( + set TARGET_DIR=%CD% +) else ( + if "%1"=="." ( + set TARGET_DIR=%CD% + ) else ( + set TARGET_DIR=%~1 + ) +) + +setlocal EnableDelayedExpansion + +reg query hkcu\Environment /v Path > NUL: +if %ERRORLEVEL% NEQ 0 goto :END_REGISTRY_QUERY + +rem Retrieve the user's Path from the master environment. +set MY_PATH= +for /f "skip=1 tokens=3*" %%p in ('reg query hkcu\Environment /v Path') do ( + set MY_PATH=%%p %%q + + rem If it's already in the master environment then don't add it. + echo !MY_PATH! | find /i "%TARGET_DIR%" > NUL: + if !ERRORLEVEL! EQU 0 ( + echo Directory %TARGET_DIR% already exists in the permanent Path variable. + ) else ( + rem Add to user's master enviroment. + setx Path "!MY_PATH!;%TARGET_DIR%" + if !ERRORLEVEL! NEQ 0 ( + echo Setx command failed 1>&2 + goto :END + ) + echo Added directory %TARGET_DIR% to permanent Path variable. + ) +) +:END_REGISTRY_QUERY + +rem If the user's Path doesn't exist yet, create it. +if not defined MY_PATH ( + setx Path %TARGET_DIR% + if !ERRORLEVEL! NEQ 0 ( + echo Setx command failed 1>&2 + goto :END + ) + echo Created permanent Path variable with directory %TARGET_DIR%. +) + +rem If it's already in the current environment then don't add it. +echo %PATH% | find /i "%TARGET_DIR%" > NUL: +if %ERRORLEVEL% EQU 0 ( + echo Directory %TARGET_DIR% already exists in the Path. + goto :END +) + +:END +endlocal + +rem Add to current environment. +set PATH=%PATH%;%TARGET_DIR% +echo Added directory %TARGET_DIR% to Path in current environment. +set TARGET_DIR= diff --git a/scripts/as65 b/scripts/as65 new file mode 100755 index 0000000..e8523f9 --- /dev/null +++ b/scripts/as65 @@ -0,0 +1,28 @@ +#!/bin/sh + +getAbsolutePath() +{ + if [ -d "$1" ] + then + (cd "$1" && $(pwd) || exit) + else + (cd $(dirname "$1") && echo $(pwd)/$(basename "$1") || exit) + fi +} + +SELF=$(getAbsolutePath "$0") +SELF_DIR=$(dirname "$SELF") +PARENT_DIR=$(dirname "$SELF_DIR") +JAR_DIR="$PARENT_DIR"/lib +CLASS_PATH="$JAR_DIR"/dev65.jar +MAIN_CLASS=uk.co.demon.obelisk.w65xx.As65 +OUTPUT_CAPTURE=as65-output.log + +# As65 does not exit with a non-zero code when it fails, so another method +# has to be used to detect failure, so that this script can exit with a +# non-zero code when it fails. This is necessary for "make" to work properly. +# If As65 writes any output, then it will be assumed that it failed and then +# this script will exit with a non-zero exit code. +java -classpath "$CLASS_PATH" "$MAIN_CLASS" "$@" 2>&1 \ + | tee "$OUTPUT_CAPTURE" && [ ! -s "$OUTPUT_CAPTURE" ] + diff --git a/scripts/as65.bat b/scripts/as65.bat new file mode 100644 index 0000000..c5b163d --- /dev/null +++ b/scripts/as65.bat @@ -0,0 +1,15 @@ +@echo off + +set JAR_DIR=%~dp0../lib +set CLASS_PATH="%JAR_DIR%"/dev65.jar +set MAIN_CLASS=uk.co.demon.obelisk.w65xx.As65 +set OUTPUT_CAPTURE=as65-output.log + +rem As65 does not exit with a non-zero code when it fails, so another method +rem has to be used to detect failure, so that this script can exit with a +rem non-zero code when it fails. This is necessary for "make" to work properly. +rem If As65 writes any output, then it will be assumed that it failed and then +rem this script will exit with a non-zero exit code. +java -classpath "%CLASS_PATH%" "%MAIN_CLASS%" %* 2>&1 ^ + > "%OUTPUT_CAPTURE%" + diff --git a/scripts/dev65-setup.bat b/scripts/dev65-setup.bat new file mode 100644 index 0000000..1ef2bf1 --- /dev/null +++ b/scripts/dev65-setup.bat @@ -0,0 +1 @@ +@java -Dsun.java2d.uiScale=2 -Dsun.java2d.uiScale.enabled=true -jar %~dpn0.jar diff --git a/scripts/dev65-setup.sh b/scripts/dev65-setup.sh new file mode 100755 index 0000000..78a9d9a --- /dev/null +++ b/scripts/dev65-setup.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +getAbsolutePath() +{ + if [ -d "$1" ] + then + (cd "$1" && $(pwd) || exit) + else + (cd $(dirname "$1") && echo $(pwd)/$(basename "$1") || exit) + fi +} + +SELF=$(getAbsolutePath "$0") +SELF_DIR=$(dirname "$SELF") +JAR="$SELF_DIR"/$(basename --suffix=.sh "$0").jar +JVM_OPTS="-Dsun.java2d.uiScale=2 -Dsun.java2d.uiScale.enabled=true" + +java $JVM_OPTS -jar "$JAR" diff --git a/scripts/lk65 b/scripts/lk65 new file mode 100755 index 0000000..73b924b --- /dev/null +++ b/scripts/lk65 @@ -0,0 +1,21 @@ +#!/bin/sh + +getAbsolutePath() +{ + if [ -d "$1" ] + then + (cd "$1" && $(pwd) || exit) + else + (cd $(dirname "$1") && echo $(pwd)/$(basename "$1") || exit) + fi +} + +SELF=$(getAbsolutePath "$0") +SELF_DIR=$(dirname "$SELF") +PARENT_DIR=$(dirname "$SELF_DIR") +JAR_DIR="$PARENT_DIR"/lib +CLASS_PATH="$JAR_DIR"/dev65.jar +MAIN_CLASS=uk.co.demon.obelisk.w65xx.Lk65 + +java -classpath "$CLASS_PATH" "$MAIN_CLASS" "$@" + diff --git a/scripts/lk65.bat b/scripts/lk65.bat new file mode 100644 index 0000000..c5b163d --- /dev/null +++ b/scripts/lk65.bat @@ -0,0 +1,15 @@ +@echo off + +set JAR_DIR=%~dp0../lib +set CLASS_PATH="%JAR_DIR%"/dev65.jar +set MAIN_CLASS=uk.co.demon.obelisk.w65xx.As65 +set OUTPUT_CAPTURE=as65-output.log + +rem As65 does not exit with a non-zero code when it fails, so another method +rem has to be used to detect failure, so that this script can exit with a +rem non-zero code when it fails. This is necessary for "make" to work properly. +rem If As65 writes any output, then it will be assumed that it failed and then +rem this script will exit with a non-zero exit code. +java -classpath "%CLASS_PATH%" "%MAIN_CLASS%" %* 2>&1 ^ + > "%OUTPUT_CAPTURE%" +