Skip to content
Commits on Source (12)
# Created by .ignore support plugin (hsz.mobi)
.gitignore
JAM.iml
JAM.ipr
JAM.iws
......@@ -8,6 +8,7 @@
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="build-mac-only" location="build-mac-only"/>
<property name="build-java9-only" location="build-java9-only"/>
<property name="lib" location="lib"/>
<property name="dist" location="dist"/>
......@@ -19,6 +20,7 @@
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
<mkdir dir="${build-java9-only}"/>
<mkdir dir="${build-mac-only}"/>
<mkdir dir="${dist}"/>
</target>
......@@ -29,9 +31,10 @@
<condition property="isMac">
<os family="mac"/>
</condition>
<javac source="1.5" target="1.5" srcdir="${src}" destdir="${build}">
<javac source="1.6" target="1.6" srcdir="${src}" destdir="${build}">
<include name="jam/**/*"/>
<exclude name="jam/**/maconly/*"/>
<exclude name="jam/**/java9only/*"/>
<!--<exclude name="org/**/maconly/*" unless = "isMac"/>-->
</javac>
<copy todir="${build}" verbose="true">
......@@ -39,12 +42,32 @@
</copy>
</target>
<target name="compile-java9-only" depends="init">
<!-- Compile the java code from ${jamsrc} into ${build} -->
<condition property="isMac">
<os family="mac"/>
</condition>
<javac source="1.9" target="1.9" srcdir="${src}" destdir="${build-java9-only}">
<include name="jam/**/java9only/*"/>
</javac>
</target>
<target name="dist-java9-only" depends="compile-java9-only" description="generate the -java9-only distribution">
<!-- Create the distribution directory -->
<mkdir dir="${dist}"/>
<!-- create the mac-only jar file -->
<jar jarfile="${lib}/jam-java9-only.jar">
<fileset dir="${build-java9-only}" includes="**/mac*/**/*.class,*.properties"/>
</jar>
</target>
<target name="compile-mac-only" depends="init">
<!-- Compile the java code from ${jamsrc} into ${build} -->
<condition property="isMac">
<os family="mac"/>
</condition>
<javac source="1.5" target="1.5" srcdir="${src}" destdir="${build-mac-only}">
<javac source="1.6" target="1.6" srcdir="${src}" destdir="${build-mac-only}">
<include name="jam/**/maconly/*"/>
</javac>
</target>
......@@ -59,8 +82,10 @@
</jar>
</target>
<!-- jam-mac-only.jar should be compiled using Java 6 and then is linked in here -->
<!-- jam-java9-only.jar should be compiled using Java 9 and then is linked in here -->
<target name="dist" depends="compile" description="generate the distribution">
<target name="dist" depends="compile, dist-java9-only, dist-mac-only" description="generate the distribution">
<!-- Create the distribution directory -->
<mkdir dir="${dist}"/>
<delete file="${dist}/jam.jar"/>
......@@ -68,6 +93,7 @@
<jar jarfile="${dist}/jam.jar">
<fileset dir="${build}" includes="**/*.class,**/*.properties,**/*.png"/>
<zipgroupfileset dir="${lib}" includes="jam-mac-only.jar"/>
<zipgroupfileset dir="${lib}" includes="jam-java9-only.jar"/>
</jar>
</target>
......
jam-lib (0.1.git20180106.740247a+dfsg-1) unstable; urgency=medium
* Use git mode in watch file
* Drop unneeded get-orig-source script
* debhelper 11
* Point Vcs fields to salsa.debian.org
* Standards-Version: 4.3.0
-- Andreas Tille <tille@debian.org> Tue, 08 Jan 2019 13:55:01 +0100
jam-lib (0.1.20140824-2) unstable; urgency=medium
* Fix homepage
......
......@@ -3,16 +3,16 @@ Maintainer: Debian Med Packaging Team <debian-med-packaging@lists.alioth.debian.
Uploaders: Andreas Tille <tille@debian.org>
Section: java
Priority: optional
Build-Depends: debhelper (>= 10),
Build-Depends: debhelper (>= 11~),
javahelper
Build-Depends-Indep: default-jdk,
default-jdk-doc,
libtrove-java,
libtrove-java-doc,
ant
Standards-Version: 3.9.8
Vcs-Browser: https://anonscm.debian.org/cgit/debian-med/jam-lib.git
Vcs-Git: https://anonscm.debian.org/git/debian-med/jam-lib.git
Standards-Version: 4.3.0
Vcs-Browser: https://salsa.debian.org/med-team/jam-lib
Vcs-Git: https://salsa.debian.org/med-team/jam-lib.git
Homepage: https://github.com/rambaut/jam-lib
Package: libjam-java
......
......@@ -2,6 +2,8 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: jam-lib
Upstream-Contact: Andrew Rambaut <a.rambaut@ed.ac.uk>
Source: https://github.com/rambaut/jam-lib
Files-Excluded: */*.jar
*/maconly
Files: *
Copyright: © 2009-2014 Andrew Rambaut <a.rambaut@ed.ac.uk>
......
#!/bin/sh
COMPRESS=xz
set -e
ORIGNAME=jam-lib
NAME=`dpkg-parsechangelog | awk '/^Source/ { print $2 }'`
#VERSION=`dpkg-parsechangelog | awk '/^Version:/ { print $2 }' | sed 's/\([0-9\.]\+\)-[0-9]\+$/\1/'`
mkdir -p ../tarballs
cd ../tarballs
# need to clean up the tarballs dir first because upstream tarball might
# contain a directory with unpredictable name
rm -rf *
git clone --quiet https://github.com/rambaut/${ORIGNAME}.git
cd ${ORIGNAME}
VERSION=0.1.`git log -n 1 --format="%ad" --date=short | sed 's/-//g'`
cd ..
TARDIR=${NAME}-${VERSION}
mv ${ORIGNAME} ${TARDIR}
rm -rf ${TARDIR}/.git
rm -rf ${TARDIR}/lib
rm -rf ${TARDIR}/src/jam/maconly
tar --owner=root --group=root --mode=a+rX -caf "$NAME"_"$VERSION".orig.tar.${COMPRESS} "${TARDIR}"
rm -rf ${TARDIR}
......@@ -8,13 +8,13 @@ Description: Strip OSX specific things from build.xml
<property name="src" location="src"/>
<property name="build" location="build"/>
- <property name="build-mac-only" location="build-mac-only"/>
<property name="build-java9-only" location="build-java9-only"/>
<property name="lib" location="lib"/>
<property name="dist" location="dist"/>
@@ -19,16 +18,12 @@
<tstamp/>
@@ -21,21 +20,15 @@
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
<mkdir dir="${build-java9-only}"/>
- <mkdir dir="${build-mac-only}"/>
<mkdir dir="${dist}"/>
</target>
......@@ -25,19 +25,40 @@ Description: Strip OSX specific things from build.xml
- <condition property="isMac">
- <os family="mac"/>
- </condition>
<javac source="1.5" target="1.5" srcdir="${src}" destdir="${build}">
<javac source="1.6" target="1.6" srcdir="${src}" destdir="${build}">
<include name="jam/**/*"/>
<exclude name="jam/**/maconly/*"/>
@@ -39,27 +34,6 @@
</copy>
</target>
- <exclude name="jam/**/maconly/*"/>
<exclude name="jam/**/java9only/*"/>
- <!--<exclude name="org/**/maconly/*" unless = "isMac"/>-->
</javac>
<copy todir="${build}" verbose="true">
<fileset dir="${src}" includes="jam/**/*.png,jam/**/*.gif"/>
@@ -44,9 +37,6 @@
<target name="compile-java9-only" depends="init">
<!-- Compile the java code from ${jamsrc} into ${build} -->
- <condition property="isMac">
- <os family="mac"/>
- </condition>
<javac source="1.9" target="1.9" srcdir="${src}" destdir="${build-java9-only}">
<include name="jam/**/java9only/*"/>
</javac>
@@ -56,43 +46,17 @@
<!-- Create the distribution directory -->
<mkdir dir="${dist}"/>
- <!-- create the mac-only jar file -->
- <jar jarfile="${lib}/jam-java9-only.jar">
- <fileset dir="${build-java9-only}" includes="**/mac*/**/*.class,*.properties"/>
- </jar>
- </target>
-
- <target name="compile-mac-only" depends="init">
- <!-- Compile the java code from ${jamsrc} into ${build} -->
- <condition property="isMac">
- <os family="mac"/>
- </condition>
- <javac source="1.5" target="1.5" srcdir="${src}" destdir="${build-mac-only}">
- <javac source="1.6" target="1.6" srcdir="${src}" destdir="${build-mac-only}">
- <include name="jam/**/maconly/*"/>
- </javac>
- </target>
......@@ -50,17 +71,20 @@ Description: Strip OSX specific things from build.xml
- <jar jarfile="${lib}/jam-mac-only.jar">
- <fileset dir="${build-mac-only}" includes="**/mac*/**/*.class,*.properties"/>
- </jar>
- </target>
-
-
<target name="dist" depends="compile" description="generate the distribution">
</target>
- <!-- jam-mac-only.jar should be compiled using Java 6 and then is linked in here -->
<!-- jam-java9-only.jar should be compiled using Java 9 and then is linked in here -->
- <target name="dist" depends="compile, dist-java9-only, dist-mac-only" description="generate the distribution">
+ <target name="dist" depends="compile, dist-java9-only" description="generate the distribution">
<!-- Create the distribution directory -->
<mkdir dir="${dist}"/>
@@ -67,7 +41,6 @@
<delete file="${dist}/jam.jar"/>
<!-- Put everything in ${build} into the jam.jar file -->
<jar jarfile="${dist}/jam.jar">
<fileset dir="${build}" includes="**/*.class,**/*.properties,**/*.png"/>
- <zipgroupfileset dir="${lib}" includes="jam-mac-only.jar"/>
<zipgroupfileset dir="${lib}" includes="jam-java9-only.jar"/>
</jar>
</target>
Author: Andreas Tille <tille@debian.org>
Last-Update: Sun, 19 Jul 2015 14:42:56 +0200
Description: Remove OSX only code
--- a/src/jam/framework/MultiDocApplication.java
+++ b/src/jam/framework/MultiDocApplication.java
@@ -14,7 +14,7 @@
package jam.framework;
import jam.mac.Utils;
-import jam.maconly.OSXAdapter;
+//import jam.maconly.OSXAdapter;
import javax.swing.*;
import java.io.File;
remove-mac-only-code.patch
javadoc.patch
remove_maconly.patch
......@@ -12,6 +12,3 @@ override_dh_auto_clean:
override_dh_auto_build:
dh_auto_build
ant -buildfile javadoc.xml
get-orig-source:
. debian/get-orig-source
version=4
opts=dversionmangle=s/.*/0.No-Release/ \
https://people.debian.org/~eriberto/ FakeWatchNoUpstreamReleaseForThisPackage-(\d\S+)\.gz
opts="mode=git,pretty=0.1.git%cd.%h,repacksuffix=+dfsg,dversionmangle=auto,repack,compression=xz" \
https://github.com/rambaut/jam-lib.git HEAD
# Issue asking for release tags:
# https://github.com/rambaut/jam-lib/issues/2
......@@ -55,12 +55,11 @@ public class ConsoleApplication extends Application {
}
public void initialize() {
if (jam.mac.Utils.isMacOSX()) {
// If this is a Mac application then register it at this point.
// Register the application with the OK. Prior to Java 1.9 this was just
// for Mac OS X. Now it uses java.desktop.Desktop to be cross platform
// This will result in any events such as open file being executed
// due to files being double-clicked or dragged on to the application.
jam.mac.Utils.macOSXRegistration(this);
}
jam.mac.Utils.registerDesktopApplication(this);
}
protected JFrame getDefaultFrame() { return consoleFrame; }
......
......@@ -14,7 +14,6 @@
package jam.framework;
import jam.mac.Utils;
import jam.maconly.OSXAdapter;
import javax.swing.*;
import java.io.File;
......@@ -58,15 +57,11 @@ public class MultiDocApplication extends Application {
}
public final void initialize() {
// The frameless default menubar is now handled by the OSXAdapter
// setupFramelessMenuBar();
if (jam.mac.Utils.isMacOSX()) {
// If this is a Mac application then register it at this point.
// Register the application with the OK. Prior to Java 1.9 this was just
// for Mac OS X. Now it uses java.desktop.Desktop to be cross platform
// This will result in any events such as open file being executed
// due to files being double-clicked or dragged on to the application.
jam.mac.Utils.macOSXRegistration(this);
}
jam.mac.Utils.registerDesktopApplication(this);
}
public void setDocumentFrameFactory(DocumentFrameFactory documentFrameFactory) {
......
......@@ -43,12 +43,11 @@ public class SingleDocApplication extends Application {
}
public final void initialize() {
if (jam.mac.Utils.isMacOSX()) {
// If this is a Mac application then register it at this point.
// Register the application with the OK. Prior to Java 1.9 this was just
// for Mac OS X. Now it uses java.desktop.Desktop to be cross platform
// This will result in any events such as open file being executed
// due to files being double-clicked or dragged on to the application.
jam.mac.Utils.macOSXRegistration(this);
}
jam.mac.Utils.registerDesktopApplication(this);
}
public void setDocumentFrame(DocumentFrame documentFrame) {
......
package jam.java9only;
import jam.framework.*;
import javax.swing.*;
import java.awt.*;
import java.awt.desktop.*;
import java.io.File;
public class ApplicationAdapter implements
AboutHandler,
PreferencesHandler,
OpenFilesHandler,
PrintFilesHandler,
QuitHandler {
private static ApplicationAdapter theAdapter;
// reference to the app where the existing quit, about, prefs code is
private jam.framework.Application application;
private ApplicationAdapter(jam.framework.Application application) {
this.application = application;
}
// The main entry-point for this functionality. This is the only method
// that needs to be called at runtime, and it can easily be done using
// reflection.
public static void registerApplication(jam.framework.Application application) {
// if (theApplication == null) {
// theApplication = Application.getApplication();
// }
if (theAdapter == null) {
theAdapter = new ApplicationAdapter(application);
}
Desktop.getDesktop().setAboutHandler(theAdapter);
Desktop.getDesktop().setOpenFileHandler(theAdapter);
Desktop.getDesktop().setPreferencesHandler(theAdapter);
Desktop.getDesktop().setPrintFileHandler(theAdapter);
Desktop.getDesktop().setQuitHandler(theAdapter);
// Create a default menu bar that is shown when all windows are closed
JMenuBar defaultMenuBar = new JMenuBar();
if(jam.framework.Application.getMenuBarFactory() != null) {
jam.framework.Application.getMenuBarFactory().populateMenuBar(defaultMenuBar, null);
Desktop.getDesktop().setDefaultMenuBar(defaultMenuBar);
}
}
@Override
public void handleAbout(AboutEvent e) {
if (application != null) {
application.doAbout();
} else {
throw new IllegalStateException("handleAbout: Application instance detached from listener");
}
}
@Override
public void openFiles(OpenFilesEvent openFilesEvent) {
for (File file : openFilesEvent.getFiles()) {
application.doOpenFile(file);
}
}
@Override
public void handlePreferences(PreferencesEvent e) {
if (application != null) {
application.doPreferences();
} else {
throw new IllegalStateException("handlePreferences: Application instance detached from listener");
}
}
@Override
public void printFiles(PrintFilesEvent printFilesEvent) {
for (File file : printFilesEvent.getFiles()) {
DocumentFrame frame = application.doOpenFile(file);
if (frame != null) {
frame.doPrint();
}
}
}
@Override
public void handleQuitRequestWith(QuitEvent e, QuitResponse response) {
if (application != null) {
application.doQuit();
} else {
throw new IllegalStateException("handleQuit: Application instance detached from listener");
}
}
}
\ No newline at end of file
......@@ -15,8 +15,8 @@ import java.lang.reflect.Method;
public class Utils {
protected static boolean MAC_OS_X;
protected static String MAC_OS_X_VERSION;
private static boolean MAC_OS_X;
private static String MAC_OS_X_VERSION;
public static boolean isMacOSX() {
return MAC_OS_X;
......@@ -35,45 +35,43 @@ public class Utils {
}
public static void macOSXRegistration(jam.framework.Application application) {
if (MAC_OS_X) {
public static void registerDesktopApplication(jam.framework.Application application) {
Class adapter = null;
Class osxAdapter = null;
try {
adapter = Class.forName("jam.java9only.ApplicationAdapter");
} catch (Exception e) {
// do nothing...
}
if (adapter == null && MAC_OS_X) {
try {
osxAdapter = Class.forName("jam.maconly.NewOSXAdapter");
// test if com.apple.eawt is present...
Class.forName("com.apple.eawt.AboutHandler");
adapter = Class.forName("jam.maconly.NewOSXAdapter");
} catch (Exception e) {
System.err.println("This version of Mac OS X does not support the Apple EAWT.");
// do nothing...
}
}
if (adapter != null) {
try {
if (osxAdapter != null) {
// Invoke this by reflection to avoid linking errors on other platforms...
Class[] defArgs = {jam.framework.Application.class};
Method registerMethod = osxAdapter.getDeclaredMethod("registerMacOSXApplication", defArgs);
Method registerMethod = adapter.getDeclaredMethod("registerApplication", defArgs);
if (registerMethod != null) {
Object[] args = {application};
registerMethod.invoke(osxAdapter, args);
registerMethod.invoke(adapter, args);
}
// This is slightly gross. to reflectively access methods with boolean args,
// use "boolean.class", then pass a Boolean object in as the arg, which apparently
// gets converted for you by the reflection system.
// defArgs[0] = boolean.class;
// Method prefsEnableMethod = osxAdapter.getDeclaredMethod("enablePrefs", defArgs);
// if (prefsEnableMethod != null) {
// Object args[] = {Boolean.TRUE};
// prefsEnableMethod.invoke(osxAdapter, args);
// }
}
} catch (Exception e) {
System.err.println("Exception while loading the OSXAdapter:");
System.err.println("Exception while loading the ApplicationAdapter:");
e.printStackTrace();
}
}
} // if there is no adapter then just continue without registering...
}
static {
......