Started by Emily Erdman and Lyn Turbak
June 5, 2012
Note: before reading this document make sure you are comfortable with how to download and build App Inventor.
This is a work in progress, please get in touch if you want to help improving it!
Use ant to build your local copy of App Inventor, probably inside the appinventor folder if you have cloned it from github:
In appinventor-sources, create an empty bin folder:
You may be prompted for a workspace. You may use your default one.
NOTE: If you want to use the EGit plugin within Eclipse, follow the instructions below in the Egit section to import your project (the import process will be the same described here, but there are a couple of additional steps you can take).
In Eclipse, select File>New>Java Project
In the resulting Create a Java Project window
In the resulting Java Settings folder:
You should now have an appinventor-sources project in Eclipse without errors. (We like to view it with the Package Explorer.) Eclipse’s automatic build process will put .class files in appinventor-sources/bin, but you don’t care about these. Use ant to build appinventor as usual.
Eclipse defaults to using Tabs of size four but the style guides for App Inventor are:
“We indent by two spaces, with four spaces for line continuations. Never use tab characters.”
To change this in Eclipse go to:
Project --> Properties --> Java Code Style --> Formatter
Once there check the box that reads: ‘Enable project specific settings’ and click the ‘Edit’ button.
You will have to change the Profile name to be able to save it, and in the first tab called ‘Indentation’ you can choose to use ‘Spaces only’ as you Tab policy, and use a size of 2. On this same tab, under the indent section check all boxes except ‘Empty lines’.
On the seventh tab called ‘Line Wrapping’, under ‘general settings’ change the ‘Maximum line width’ to 100.
Here is a style profile that you can feel free to import to Eclipse and use. I can’t guarantee that it is correct for all cases but I have been using it for the last 6 months or so without too many issues. Feel free to make and share updates.
Started by Kate Feeney
June 27, 2012
Note: New releases of Eclipse come with a the EGit plugin already installed. This includes Eclipse Juno and also the new ADT bundle that can be downloaded from the Android developers site.
For older versions of eclipse, EGit can be installed as a plugin by following the instructions at: http://www.eclipse.org/egit/download/
This section shows how to use EGit within App Inventor; for more details about EGit itself please consult the documentation at: http://www.eclipse.org/egit/
These instructions work under the assumption that you do NOT have the App Inventor sources already imported in Eclipse. If you already have it, you can either delete it (not off the disk just from Eclipse), or skip steps 2 and 3, and instead right click on your already existing project and click on ‘Team → Share Project’ after you have configured your repo in step 1 below. (Newer versions of Eclipse may do the below automatically)
With Eclipse opened go to: Window → Open Perspective → Other... and select Git Repository Exploring. Click OK Once in the Git Repositories View:
Now if you switch back to the Java Perspective ( in the top right hand corner there are icons for each perspective, click the one for Java) the appinventor project will be listed in your projects.
Make sure you go to Preferences → Team → Git and add your user name and email for using Git.
If you are using Git through SSH. also make sure your configuration in Preferences → General → Network → SSH2 are correct. You can generate ssh keys in the tab ‘Key Management’ if you haven’t done so before. ssh keys are generally stored in your user’s home folder; somewhere like: ~/.ssh/ or C:\Users\username\.ssh
There is some additional configuration you can use so that EGit marks the code that has been changed in the editor, and also gives you a quick diff preview of changes.
To get this working go to Preferences and filter by the word ‘quick’; this should show an option called ‘General → Editors → Text Editors → Quick Diff’. Clicking on quick diff, mark ‘Enable Quick Diff’ and ‘Show differences in overview ruler’, and in the drop box for reference source choose ‘A Git Revision’. Feel free to change the colours in there too. From now on (after restarting the editor) you should be able to see the changes with respect to HEAD as shown in the following images, the first one showing that a change happened in Line 429, and the second hovering over Line 429 to show the quick diff:
Most EGit features can be found by right clicking on your project -> Team
1. Right click on your project -> Team -> Show in Repository View. The Git Repository View will appear
2. Expand the appinventor-sources repository by clicking on the arrow next to it.
3. The first item listed should be Branches. Expand Branches.
4. Inside Branches expand Local to see a list of all your local branches. This is where the foocomp branch would be listed following the example from Developing MIT App Inventor with gitHub and github.com.
5. There will be a check mark indicating which branch is checked out. If you would like to check out a different branch simply double click on that branch.
Adding this section for future things that could be beneficial to look at (please keep on adding!):