Skip to content
Jan Polák edited this page Jan 28, 2015 · 1 revision

NOTE: This document is WIP and written for https://github.com/Darkyenus/sbt-robovm, so some details may be inaccurate.

Project setup (for iOS)

Set up your environment

  1. Be on OSX
  2. Get Xcode from App Store to be able to compile natives
  3. Get JDK 7 to be able to compile & run Java
  4. Get sbt

Set up your project

You can either start from scratch (example) or use g8 template, such as this one for libGDX. Being familiar with sbt will help a lot.

sbt-robovm specific information

Sbt projects using this, should inherit RobovmProject, instead of default Project. That means you'll probably need to use more advanced .scala configuration, instead of simple .sbt files.

Everything you'll need to configure can be imported by import sbtrobovm.RobovmPlugin._ and the rest of this document will assume you did that. (sbtrobovm.RobovmProjects contains only plugin implementation)

sbt-robovm plugin should then work fine out of the box (depending on your setup), but you'll likely want to customize some settings. That can be done either through setting keys, or preferably through robovm.xml (See configFile key), so you have access to all RoboVM settings in one place.

Setting keys

General

  • executableName String - Name of produced executable. Must be same as in configFile and iosInfoPlist if you specify them. Default is "RoboVM App" which is probably wrong.
  • configFile Option[File] - When Some, given xml file will be used for RoboVM settings. Details on content are here. Default is None.
  • robovmProperties Option[Either[File, Map[String, String]]] - Properties used for replacement in configFile. Example `robovmProperties := Some(Right(Map("app.name" -> "MyGame","app.mainclass" -> "com.my.Game"))) Default is None.
  • robovmInputJars Seq[File] - Task that produces jar files to be compiled by RoboVM. Useful when fine control over the compiled jars is needed. Default is fullClasspath in Compile.
  • robovmVerbose Boolean - Will promote all RoboVM debug output (logs) to info level when true. Useful when debugging only RoboVM and launching sbt --debug produces too much debug noise. Default is false.
  • distHome Option[File] - Can specify where the RoboVM is installed if you need to use manual installation. Note: As of now (#30 unmerged), you need to install and configure this key properly. Some(file("path/to/robovm")) - use explicit RoboVM installation Some(null) - RoboVM will try to find the installation by its rules, most notably in $ROBOVM_HOME. None - RoboVM will be installed in your local maven repo automatically. Default is None
  • simulatorDevice Option[String] - Simulator device to be used by simulator task. Use simulatorDevices task to list all possible values for this. Default is None - use default device.

Settings preferably put into the robovm.xml, see configFile.

  • forceLinkClasses - Classes to be always linked, even when not directly accessed (for reflection)
  • frameworks - Apple frameworks that are used by the program
  • nativePath - Path to all native libraries (and directories containing native libraries)
  • skipPngCrush - Disable pngcrush-ing images. Some libraries sometimes don't know how to load crushed images (I had this problem in libGDX).
  • flattenResources
  • skipSigning - Will skip signing step. Sometimes useful.
  • iosSdkVersion
  • iosSignIdentity
  • iosProvisioningProfile
  • iosInfoPlist
  • iosEntitlementsPlist
  • iosResourceRulesPlist

Tasks

  • simulator - Launch program on an iOS device simulator. See simulatorDevice key.
  • device - Launch program on connected device. (When more than one device is connected, one will be selected arbitrarily (?))
  • iphoneSim - Launch program on an iOS simulator with default iPhone device.
  • ipadSim - Launch program on an iOS simulator with default iPad device.
  • ipa - Create an ipa archive for distribution to the App Store. Archive will be fat, i.e. will include both 32 bit executable and 64 bit executable. (Note: Your native libraries must have 32/64 versions as well.
  • native - Launch program as a native application. This should also work on Linux. Application has to be of course written a bit differently than iOS app. See example.
  • robovmLicense - Will launch a GUI to enter RoboVM license key, to be able to use proprietary extensions, such as debugging.