There were a couple of other code changes which I checked around last
September. The main one was in MainFrameMenuBar to stop it adding Quit and
Global Preferences to the File menu - by default Apple provide those for you
and the plugin does the right thing to display the Squirrel preferences.
Colin put something in
net.sourceforge.squirrel_sql.client.gui.mainframe.MainFrameMenuBar which has
a boolean method isOsxPluginLoaded, then there are wrappers around the menu
items I wanted to exclude to stop them being added if the osx plugin is
loaded. All the code dependent on Apple classes is in the plugin.
Using reflection should be straightforward - there's nothing clever in the
plugin. I won't get a chance to look at it for a while though so someone
else would need to do it.
The build process needs slightly more thought on the mac - what you need to
deliver is a 'Application Bundle' which is a specific directory structure
with a few files in the right places. That's what the mac_dist target in the
main build.xml does, using the templates in the mac directory at the root of
the CVS tree.
Neville
-----Original Message-----
From: squ...@li...
[mailto:squ...@li...] On Behalf Of gwg
Sent: 25 May 2005 17:25
To: squ...@li...
Subject: Re: [Squirrel-sql-users] Mac OS X bundle of 1.2beta6
When I first got the compile errors I spent a few minutes poking around
on the internet looking for those classes. The conclusion that I came
to was that they are proprietary to Apple and are not redistributable
(at least in our open source arena) because of copywrite issues.
I must confess that I have not tried to run the ant script to build
Squirrel, so that may actually work correctly. The errors that I am
seeing are from the Eclipse IDE when I load all the code in. At some
point (a couple of weeks from now) I'll try the Ant build, and if it has
problems we'll deal with it then.
On a more general note, this raises two questions for me:
- Are there any code changes needed to run on the mac other than the mac
plugin?
- Is it possible to compile the Mac-specific code on Linux/Windows and
run it on the Mac?
Speaking from the perspective of someone who may actually have to create
a release of the Squirrel product (and do that on a Linux system using
the standard Java SDK), it would be nice to have only one version that
needs to be kept up to date. For example, the Mac plugin appears to
reference only two Mac-specific classes, and it uses them in a way that
could be done using reflection. If we changed that code to use
reflection, it would compile on Linux and (hopefully) still run on the
Mac. If there is nothing else special about running Squirrel on the
Mac, then we should be able to build the code on Linux/Windows still run
it on the Mac
Gerd is thinking about creating separate "basic" and "standard"
packages, where the "basic" package contains no plugins and the
"standard" package contains a subset of the more commonly used plugins
(mostly related to SQL editing). If we are able to compile the Mac code
on Linux/Windows and we do create multiple downloadable packages as part
of the release, we should also be able to automatically create a
"basic-for-Mac" package consisting of the basic code plus the mac
plugin, and a similar "standard-for-Mac" package.
This seems fairly straight-forward to me, so I've probably not
understood the problem. :-) Is there anything that would block us from
using reflection (or possibly a proxy) in the mac plugin, building the
code on Linux and running it on a Mac?
Glenn
Rowe, Neville wrote:
> Hmmm. I don't know if those classes are redistributable
> (com.apple.eawt.*) so previously I checked in the compiled code (under
> the plugins/macosx/deliver directory). Changing the ant
> plugin_build.xml to either recompile or use the checked in code as
> appropriate seems best.
>
> I'm away from a machine which has write access to Squirrel SQL CVS,
> however if you replace plugin_build.xml with the below then it should
> do the right thing. I've tried it on both Mac and Windows - running:
> ant compile_app
> ant -Dp_internal_name=macosx init build_plugin
> ant mac_dist
> which produces a package which then runs successfully on my mac.
>
>>From memory I think I still have to make a change to the mac_dist
>>target in
> the main build.xml to get some of the documentation appearing in the
> right place. I might get a chance to take a look at that later.
>
> Neville
>
> ================ plugins/macosx/plugin_build.xml ==================
>
> <?xml version="1.0"?>
> <!--
> This is an Apache Ant build file to build the macosx plugin
> for distribution.
> -->
> <project name="plugin-macosx" default="build" basedir=".">
>
> <target name="init">
> <tstamp/>
> <condition property="macos"><os family="mac" /></condition>
> <property name="internal_name" value="macosx"/>
> <property name="version" value="0.1"/>
>
> <property name="debug" value="on"/>
> <property name="optimize" value="off"/>
> <property name="deprecation" value="on"/>
>
> <property name="p_plugin.work_dir"
> value="${dist_dir}/${internal_name}"/>
> <property name="p_plugin.core_libs_dir"
> value="${core_dist_lib_dir}"/>
> <property name="p_plugin.dist_dir"
> value="${core_dist_dir}/plugins"/>
>
>
> <echo message="---------------- ${internal_name} ${version}
> ----------------"/>
>
> <property environment="env"/>
> </target>
> <!--
> ==================================================================
> Compile the plugin.
> No parameters.
> ==================================================================
> -->
> <target name="build" depends="init,compile,fakecompile" />
>
> <target name="compile" if="macos">
> <property name="obj_dir" value="${p_plugin.work_dir}/obj"/>
> <mkdir dir="${obj_dir}"/>
>
> <javac srcdir="src"
> destdir="${obj_dir}"
> deprecation="${deprecation}"
> debug="${debug}"
> optimize="${optimize}"
> includeJavaRuntime="yes">
> <classpath>
> <fileset dir="${p_plugin.core_libs_dir}">
> <include name="fw.jar"/>
> <include name="squirrel-sql.jar"/>
> </fileset>
> </classpath>
> </javac>
> <copy todir="${obj_dir}" >
> <fileset dir="src" >
> <include name="**/*.gif"/>
> <include name="**/*.jpg"/>
> <include name="**/*.jpeg"/>
> <include name="**/*.xml"/>
> <include name="**/*.properties"/>
> </fileset>
> </copy>
> <jar jarfile="${p_plugin.dist_dir}/${internal_name}.jar"
> compress="false">
> <fileset dir="${obj_dir}">
> <include name="**/*.*"/>
> </fileset>
> </jar>
>
> <copy todir="${p_plugin.dist_dir}" >
> <fileset dir="doc" >
> <include name="**/*.*"/>
> </fileset>
> </copy>
> </target>
>
> <target name="fakecompile" unless="macos">
> <copy todir="${p_plugin.dist_dir}" file="deliver/macosx.jar"
/>
> <copy todir="${p_plugin.dist_dir}" >
> <fileset dir="doc" >
> <include name="**/*.*"/>
> </fileset>
> </copy>
> </target>
>
> </project>
>
>
> ----------------------------------------------------------------------
> ----------
> The information contained herein is confidential and is intended solely
for the
> addressee. Access by any other party is unauthorised without the express
> written permission of the sender. If you are not the intended recipient,
please
> contact the sender either via the company switchboard on +44 (0)20 7623
8000, or
> via e-mail return. If you have received this e-mail in error or wish to
read our
> e-mail disclaimer statement and monitoring policy, please refer to
> http://www.drkw.com/disc/email/ or contact the sender. 3166
>
----------------------------------------------------------------------------
----
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: GoToMeeting - the easiest way to
> collaborate online with coworkers and clients while avoiding the high
> cost of travel and communications. There is no equipment to buy and
> you can meet as often as you want. Try it
> free.http://ads.osdn.com/?ad_id=7402&alloc_id=16135&op=click
> _______________________________________________
> Squirrel-sql-users mailing list
> Squ...@li...
> https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
>
>
-------------------------------------------------------
SF.Net email is sponsored by: GoToMeeting - the easiest way to collaborate
online with coworkers and clients while avoiding the high cost of travel and
communications. There is no equipment to buy and you can meet as often as
you want. Try it
free.http://ads.osdn.com/?ad_id=7402&alloc_id=16135&op=click
_______________________________________________
Squirrel-sql-users mailing list Squ...@li...
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
--------------------------------------------------------------------------------
The information contained herein is confidential and is intended solely for the
addressee. Access by any other party is unauthorised without the express
written permission of the sender. If you are not the intended recipient, please
contact the sender either via the company switchboard on +44 (0)20 7623 8000, or
via e-mail return. If you have received this e-mail in error or wish to read our
e-mail disclaimer statement and monitoring policy, please refer to
http://www.drkw.com/disc/email/ or contact the sender. 3167
--------------------------------------------------------------------------------
|