Confirmed users
355
edits
No edit summary |
Nalexander (talk | contribs) |
||
Line 1: | Line 1: | ||
There is support for building Fennec using Eclipse or IntelliJ in the tree. | There is support for building Fennec using Eclipse or IntelliJ in the tree. | ||
= IntelliJ with Gradle = | = IntelliJ or Android Studio with Gradle = | ||
This is | This is the direction that IDE support is moving towards. | ||
* First, build and package your tree: | |||
./mach build && ./mach package | |||
* | |||
** | * Second, configure Gradle to build Fennec. '''Do not skip this step: it configures your object directory for Gradle.''' | ||
* | |||
* | ./mach gradle-install | ||
* Optionally, verify that Gradle can build Fennec: | |||
* | ./mach gradle build | ||
* Finally, import the newly created Gradle projects into IntelliJ/Android Studio: | |||
** ''File'' > ''Import Project...'' and select <tt>$OBJDIR/mobile/android/gradle</tt>, where <tt>$OBJDIR</tt> is your object directory. (The correct directory is printed by the |mach gradle-install| command.) | |||
** Select ''Import project from external model'' > ''Gradle'' > ''Next''. | |||
** Select ''Use customizable gradle wrapper'' > ''Finish''. | |||
You should have a shiny new Gradle-based project in your IDE! You'll need to configure your Android SDK: | |||
* ''File'' > ''Project Structure'' | |||
** Select ''Android API 21 platform'' for the Project SDK (or whatever is appropriate for your configuration); and | |||
** Select ''7 - Diamonds, ARM, multi-catch etc.'' for the Project language level. | |||
You should be all set! Try it out by choosing ''Build'' > ''Rebuild project''. | |||
== Trouble shooting == | |||
=== Memory === | |||
IntelliJ/Android Studio can require a good deal of memory: | |||
* Optionally, toggle ''Show Memory Indicator''; | |||
* you might need to increase memory in <tt>$INTELLIJ/bin/idea.vmoptions</tt>. Suggested values for min and max are: | |||
** Xms512m | |||
** Xmx2048m | |||
=== Additional file types === | |||
You might want to add <tt>*.java.in</tt> and other preprocessed files to ''Settings'' > ''File Types'' > ''Java source files''. This will help you browse the few preprocessed files remaining, including <tt>AppConstants.java.in</tt>. | |||
== Video tutorial == | |||
nalexander has a slightly [http://www.ncalexander.net/blog/2014/10/23/building-fennec-with-gradle-and-intellij-first-steps/ outdated blog post] that describes an earlier version of this basic setup with IntelliJ. It includes a short video tutorial. | |||
= Eclipse = | = Eclipse = |