Building from the SVN?

bluestars

New member
Okay, I might be a total idiot here, but how would I go about downloading the latest KoLmafia code from the SVN and building it? I have the JDK and basic computer skills, although no java knowledge. Thanks![br]Posted on: August 24, 2006, 04:56:28 PM
I figured it out! Ahh, that feels good. :) Anyway, for other aspiring devel noobs like myself, here's a quick intro on what to do running under WinXP/2k. If I made any mistakes, feel free to correct me.

First, grab a copy of the following software:
Apache Ant (http://ant.apache.org/bindownload.cgi)
SVN Client (Windows: https://subversion.apache.org/)
JDK 1.4 or later (1.5.0 is the latest) (http://java.sun.com/ , you can find it)

Next, find a directory where you want the builds to go. SVN will create a subdirectory. Open command prompt ("cmd" for XP/2k users) and type:
svn co https://kolmafia.svn.sourceforge.net/svnroot/kolmafia kolmafia

Once it finishes, go to the subdirectory and type:
ant

Then look under the dist folder for the .jar file.

Note: Ant can be a bit tricky to install. There's a guide at the ant website though. If you're having problems with that step, post here and I'll explain more in detail.

EDIT: Edited address for Java and made it clicky -Daychilde
Edited to update to the correct url for svn, the previous one quit working. -efilnikufecin
 
Last edited by a moderator:
[quote author=bluestars link=topic=374.msg2036#msg2036 date=1156461865]

JDK 1.4 or later (1.5.0 is the latest) (sun.java.com, you can find it)

[/quote]

It appears to actually be java.sun.com
 
double posting here, but look how old that previous post is.

I moved this topic here, and set it sticky so that it could easily be found for future reference. I'm sure everyone can see why.

[blue]( just so you know, it's not double-posting if it's been more than 24 hours... also, now that I have the merge-double-post mod in place, unless a glitch happens upon posting (happens upon rare occasion), nobody *can* double-post anymore :D -Daychilde )[/blue]
 

Wylin

New member
[quote author=bluestars]Open command prompt ("cmd" for XP/2k users) and type:
svn co https://svn.sourceforge.net/svnroot/kolmafia kolmafia

Once it finishes, go to the subdirectory and type:
ant
[/quote]

I have a batch file made called update.bat.. it goes a little something like this:
Code:
svn co [url]https://kolmafia.svn.sourceforge.net/svnroot/kolmafia[/url] kolmafia

cd kolmafia

ant

my snv co line is slightly different.. it seems to work for me, does it matter?
 

holatuwol

Developer
Technically, no, but kolmafia.svn.sourceforge.net is the URL that Sourceforge tells us we should use.

Once you've checked out KoLmafia once, you can change your update.bat file to say something like "cd kolmafia" followed by "svn update". A clean checkout can help if you're having some weird problems, but update is recommended to save time/bandwidth.
 

Ethelred

Member
I don't know anything about ant, but was able to build a jar file using the instructions above. So first of all, thanks for that. Now, I'd like to go one step further and build a MacOS X application and .dmg file. Can someone please explain how to do that? As I say, I know nothing about ant, but I looked at the build.xml file and didn't see anything there that looked promising, but maybe I just missed it. I don't actually know that much about building MacOS X applications, either, so I don't know if all I need is the proper build.xml "descriptions" or if some other process would be needed.

Thanks, as they say, in advance, for any help anyone can provide with this.
 

holatuwol

Developer
If all you need is the application bundle:

  • Load up JAR Bundler, located in "/Developer/Applications/Java Tools"
  • Select the KoLmafia.jar generated in a build
  • Drag and drop the "limeglass.icns" file in the "lib" folder into the icon section
  • Make sure the Java runtime compatibility is 1.4+
  • Add a key/value pair, with "app.name" being the key, and anything you want being the value.
  • Generate the application bundle

[br][br]If you actually need the DMG for one reason or another:

  • Create a "KoLmafia-x.x" folder
  • Inside the "KoLmafia-x.x" folder, create a "KoLmafia" folder
  • Also inside the "KoLmafia-x.x" folder, create a symbolic link to "/Applications"
  • Load up JAR Bundler, located in "/Developer/Applications/Java Tools"
  • Select the KoLmafia.jar generated in a build
  • Drag and drop the "limeglass.icns" file in the "lib" folder into the icon section
  • Make sure the Java runtime compatibility is 1.4+
  • Generate the application bundle inside of the "KoLmafia" folder created earlier
  • Drag and drop the  "KoLmafia-x.x" folder onto Disk Utility
  • Save the .dmg file where it'll be easy to access
 

th3y

Member
I use Windows XP and sometimes build from the SVN to get the latest fixes/updates.

I noticed that the build-with-ant process ends up creating a .jar file, whereas the "official" versioned releases are .exe .

Are the advantages to using a compiled .exe instead of a .jar (which I presume is intrepreted) significant? I'm sure the "performance" of the .exe is much better, but given that practically everything you want to do with KOLmafia requires an external-round-trip response from the KOL server, I suspect that the performance difference may not be noticeable in practical use.

But if the advantages are significant, could someone give some hints as to how to build the exe? I guess it's analogous to the Mac example above.

Thanks a bunch,
-TH3Y
 

holatuwol

Developer
[quote author=th3y link=topic=374.msg5165#msg5165 date=1184861813]
Are the advantages to using a compiled .exe instead of a .jar (which I presume is intrepreted) significant?   I'm sure the "performance" of the .exe is much better, but given that practically everything you want to do with KOLmafia requires an external-round-trip response from the KOL server, I suspect that the performance difference may not be noticeable in practical use.
[/quote]

The EXE simply asks Java to run the JAR wrapped inside it.  In other words ... if you're interested in speed, you're better off with the JAR.
 

fewyn

Administrator
Staff member
I've been trying to make ant build it and list the rev number in the file name as late, It comes out as KoLmafia-${brevision}.jar I was using "ant daily" under Gentoo, any ideas?
 

fewyn

Administrator
Staff member
[quote author=holatuwol link=topic=374.msg5427#msg5427 date=1186595873]
What does the following say?

Code:
svnversion -n .
[/quote]

It goes

Code:
shiro ~ # svnversion -n
exportedshiro ~ #
 

fewyn

Administrator
Staff member
[quote author=holatuwol link=topic=374.msg5431#msg5431 date=1186598405]
From the KoLmafia build directory. :p
[/quote]

Oops =p

Code:
shiro kolmafia # svnversion -n
4671shiro kolmafia #
 

hippymon

Member
[quote author=bluestars link=topic=374.msg2036#msg2036 date=1156461865]
First, grab a copy of the following software:
Apache Ant (http://ant.apache.org/bindownload.cgi)
SVN Client (Windows: http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91)
JDK 1.4 or later (1.5.0 is the latest) (http://java.sun.com/ , you can find it)

Next, find a directory where you want the builds to go. SVN will create a subdirectory. Open command prompt ("cmd" for XP/2k users) and type:
svn co https://kolmafia.svn.sourceforge.net/svnroot/kolmafia kolmafia

Once it finishes, go to the subdirectory and type:
ant

Then look under the dist folder for the .jar file.

Note: Ant can be a bit tricky to install. There's a guide at the ant website though. If you're having problems with that step, post here and I'll explain more in detail.
[/quote]

I have the software stated, but when I do "svn co http://kolmafia.svn.sourceforge.net/viewvc/kolmafia?view=rev kolmafia" it returns 'svn' is not recognized as a command...

I use Windows Vista, is that the problem? How do I do this??
 

fewyn

Administrator
Staff member
[quote author=hippymon link=topic=374.msg5433#msg5433 date=1186603830]


I have the software stated, but when I do "svn co http://kolmafia.svn.sourceforge.net/viewvc/kolmafia?view=rev kolmafia" it returns 'svn' is not recognized as a command...

I use Windows Vista, is that the problem? How do I do this??
[/quote]

That's if you are doing it from the command line, if you are using tortisesvn you need to create a folder somewhere right click on it, select svn checkout and put https://kolmafia.svn.sourceforge.net/svnroot/kolmafia in the box and click ok at the bottom and it should grab it all.
 

hippymon

Member
[quote author=bluestars link=topic=374.msg2036#msg2036 date=1156461865]
Note: Ant can be a bit tricky to install. There's a guide at the ant website though. If you're having problems with that step, post here and I'll explain more in detail.[/quote]

I have tried everything I can think of and I have NO clue what I am doing, how exactly do you install ant?
 
Top