Page 1 of 5 1 2 3 ... LastLast
Results 1 to 10 of 44

Thread: Ant 1.8.1 and Jarbundler task

  1. #1

    Post Ant 1.8.1 and Jarbundler task

    hello, old friends, long time, etc...

    A recent MacOSX Java update broke the current jarbundler task in build.xml (probably due to the classpath changes in ANT 1.8.1, but that's just my theory).

    I installed the latest jarbundler (2.1.0) from https://www.informagen.com/JarBundler/ and it fixed the xerxes dependency (amongst other things) and it runs fine. The version on sourceforge is way out of date.

    I recommend that we change the version of jarbundler in the util/macosx directory and change build.xml to reference the new version. I've only tested this with my up-to-date system. It could also be dependent on the version of ANT, if that's a concern...

    Output of the error, for the curious:
    Code:
    /Users/mcroft/Projects/kolmafia/build.xml:223: java.lang.NoClassDefFoundError: org/apache/xml/serialize/OutputFormat
    	at net.sourceforge.jarbundler.PropertyListWriter.writeFile(Unknown Source)
    	at net.sourceforge.jarbundler.JarBundler.writeInfoPlist(Unknown Source)
    	at net.sourceforge.jarbundler.JarBundler.execute(Unknown Source)
    	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
    	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    	at org.apache.tools.ant.Task.perform(Task.java:348)
    	at org.apache.tools.ant.Target.execute(Target.java:390)
    	at org.apache.tools.ant.Target.performTasks(Target.java:411)
    	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
    	at org.apache.tools.ant.Project.executeTarget(Project.java:1366)
    	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    	at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
    	at org.apache.tools.ant.Main.runBuild(Main.java:801)
    	at org.apache.tools.ant.Main.startAnt(Main.java:218)
    	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
    	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
    Caused by: java.lang.ClassNotFoundException: org.apache.xml.serialize.OutputFormat
    	at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1361)
    	at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1311)
    	at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1064)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    	... 19 more
    
    Total time: 9 seconds

  2. #2
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,287

    Default

    Is that related to this?
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


  3. #3

    Default

    No, it's not that but it's got the same root cause. My problem is the mac jarbundler command. I've got a script that runs 'ant daily jarbundler'. The daily works fine (so effectively I've got the jar file you're pointing me to) but the jarbundler task fails because of the xerxes dependency in the old jarbundler and the classpath handling change in ANT 1.8.x

    I'm not looking to grab builds, but to have my nightly builds bundled into an executable app, so the jarbundler task has to work.

  4. #4
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    11,426

    Default

    OK. Revision 8516 updates to the new jarbundler task
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  5. #5

    Default

    That fixed my issue (thank you!), but I noticed that the "dmg" target has it's own jarbundler command, still using 1.9. Is this on purpose? You may want to give it a dependency on the jarbundler target, so that it doesn't get out of sync...

  6. #6
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    11,426

    Default

    I've not gotten the dmg target to work for many years; the "hdiutil" task stopped working for me many major releases ago of OS X. Does it work for you?
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  7. #7

    Default

    Haven't even tried, since I'm building just for myself, but I can look at it.

    There are two web pages I've found that talk about how to do this in leopard/snow leopard.
    https://www.rkuntz.org/pmwiki.php?n=Code.AntDiskImage
    https://www.informagen.com/JarBundler/DiskImage.html

    If this is of value, I could try to make this work using ideally the first and less-ideally the second method.

  8. #8

    Post

    Yep, the one in the build.xml didn't work. The first problem was with the paths (a basedir vs. working dir issue). The second problem was with not putting the .app in the source directory.

    This works for me (10.6.4, latest java/xcode, etc.). I had to use the exec cp rather than the copy task because the copy task doesn't save the permissions (specifically the execute bit).

    Code:
    	<!-- ========================== -->
    	<!--  create an OSX disk image  -->
    	<!-- ========================== -->
    
    	<target name="dmg" depends="init,update,jar,jarbundler">
    
    		<exec executable="rm" dir="${dist}">
    			<arg line="-rf KoLmafia" />
    		</exec>
    
    		<mkdir dir="${dist}/KoLmafia"/>
    
    		<symlink action="single" link="${dist}/KoLmafia/Applications" resource="/Applications" />
            <exec executable="cp" dir="${dist}">
    			<arg line="-a ${basedir}/${dist}/KoLMafia.app ${basedir}/${dist}/KoLmafia/" />
    		</exec>
    
     
            <delete file="${basedir}/${dmgfile}"/>
    		<exec executable="hdiutil" dir="${dist}">
    			<arg line="create ${basedir}/${dmgfile} -srcfolder ${basedir}/${dist}/KoLmafia -volname KoLmafia" />
    		</exec>
    		<exec executable="rm" dir="${dist}">
    			<arg line="-rf KoLmafia" />
    		</exec>
    	</target>

  9. #9
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    11,426

    Default

    Interesting. I included that and I get some errors, but it continued past them. The errors appear to come from having obsolete stuff in ~/Library/Plug-ins/DiskImages (which was created back in 2004) which hdiutil tries to load and fails, since it can't find the right architecture. I moved that directory out of the way and now hdiutil works fine with no errors.

    I'll check it in, as an example, though I still won't use it for spinning releases, for now, since I currently have to manually rename "KoLmafia.app" to "KoLmafia-14.4.app", for example. Ditto for the .jar, .tar.dmg, and .exe files. Obviating that will require more build-file hackery.
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  10. #10

    Default

    I'll check it in, as an example, though I still won't use it for spinning releases, for now, since I currently have to manually rename "KoLmafia.app" to "KoLmafia-14.4.app", for example. Ditto for the .jar, .tar.dmg, and .exe files. Obviating that will require more build-file hackery.
    Originally Posted by Veracity View Post
    Glad to help. My ANT skills go to waste since I moved jobs and my new team is all MAVEN-y.

    If you have a christmas list of build.xml changes you'd like, I'd be happy to see what I can do...

Similar Threads

  1. Relay Task List (Programmable!)
    By rlbond86 in forum Relay Override Scripts
    Replies: 37
    Last Post: 08-15-2018, 08:47 PM
  2. Replies: 0
    Last Post: 08-06-2012, 06:50 PM
  3. Jar issues with Task Scheduler
    By bordemstirs in forum Community Support
    Replies: 4
    Last Post: 06-11-2011, 04:06 PM
  4. Replies: 0
    Last Post: 01-23-2011, 02:37 AM
  5. 8716: Update jarbundler ant task
    By RSS Bot in forum Latest SVN Changes
    Replies: 0
    Last Post: 10-26-2010, 02:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •