I’m currently programming a Mac-native interface for CraftBukkit using MacRuby and XCode.
Right now, I am using NSTask and NSPipe to run Minecraft’s Java server:
buk.setLaunchPath("/usr/bin/java")
buk.setArguments([
"-Xmx1024M",
"-Xincgc",
"-jar",
"#{NSBundle.mainBundle.pathForResource 'bukkit', :ofType => 'jar'}",
"nogui"
])
buk.launch
However, I cannot add bukkit.jar as a Resource! It just won’t build. I can include images easily, and NSBundle works.
#{NSBundle.mainBundle.pathForResource 'bukkit', :ofType => 'jar'} doesn’t return anything (because the file does not include).
How can I include bukkit.jar as a Resource to be built into sample.app/Contents/Resources?
Thanks!
You have to put your jar file in the mainBundle under Resources/Java. To do that, adda a new copy files build phase of type “Java Resources”, then drag and drop your jar file here.
Then call the method:
Notice that launching a separate process could be an issue in having your application accepted on the Mac App Store.