IntelliJ

Thomas Cashman edited this page Oct 15, 2016 · 4 revisions

Once you have generated your mini2Dx project you're ready to import it into IntelliJ.

Setting up IntelliJ

You need to install the following for mini2Dx development.

If developing for iOS, you'll also need the following.

  • Mac OS X (iOS Development is only possible on Mac)
  • The latest XCode installed (available for free on the Mac App Store)
  • RoboVM for IntelliJ

Importing your project

  • Go to Import Project
  • Navigate to your project folder and select the build.gradle file
  • Hit OK. In the next dialog, leave all settings as they are and hit OK again.
  • Intellij IDEA will now import your project. This can take a while on the first time.

Common Problems

If you run into problems with missing artifacts, you need to delete your .m2 folder in the appropriate location:

  • Windows: C:\Users\username.m2
  • Mac OS X: /Users/username/.m2
  • Linux: /home/username/.m2

If you encounter a Unsupported major.minor version error, you have an incorrect version of Java installed. Please ensure you have Java 7 installed.

If you run into "Error:org.gradle.tooling.GradleConnectionException: Could not execute build using Gradle installation" check project structure ( Ctrl + Alt + Shift + S ) and add your java JDK to the Project SDK.

Running your project

Desktop

  • Run -> Edit Configurations...
  • Click the plus (+) button and select Application.
  • Set the name to Desktop.
  • Set the field Use classpath of module to desktop
  • Click on the button of the Main class field and select the DesktopLauncher class
  • Set the Working directory to your android/assets/ (or your_project_path/core/assets/ folder if not developing for Android)
  • Click Apply and then OK.

You have now created a run configuration for your desktop project. You can now select the configuration and run it.

Android

  • A configuration for the Android project should be automatically created on project import. As such, you only have to select the configuration and run it!

iOS

  • Run -> Edit Configurations...
  • Click the plus (+) button and select Gradle.
  • Set the Name to iOS
  • Set the Gradle Project to ios
  • Set the Tasks to launchIPhoneSimulator (alternatives are launchIPadSimulator and launchIOSDevicefor provisioned devices).
  • Click Apply and then OK.
  • You have now created a run configuration for your iOS project. You can now select the configuration and run it. The first run will take a bit longer as RoboVM has to compile the entire JDK for iOS. Subsequent runs will compile considerably faster.

Releasing your project

It's best to release your project from the command line.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.