CloudServices/NativeSync: Difference between revisions

Jump to navigation Jump to search
Line 94: Line 94:


* Install Eclipse and the SDK plugin, as described in the Android SDK page.
* Install Eclipse and the SDK plugin, as described in the Android SDK page.
* Run these in your git repository directory (don't forget to checkout the ''develop'' branch):
* Correct formatting: <tt>Preferences > Java > Code style > Formatter > Edit...</tt>, set profile name to <tt>Mozilla</tt>, set <tt>Tab policy</tt> to <tt>Spaces only</tt> change both <tt>Indentation size</tt> and <tt>Tab size</tt> to 2, and check <tt>Align fields in columns</tt>.
* Run these commands in both your <tt>android-sync</tt> and <tt>test-android-sync</tt> git repository directories (don't forget to checkout the ''develop'' branch in both repositories):


  mvn -Declipse.workspace=<path-to-eclipse-workspace> eclipse:add-maven-repo
  mvn -Declipse.workspace=<path-to-eclipse-workspace> eclipse:add-maven-repo
  mvn -DdownloadJavadocs=true -DdownloadSources=true eclipse:eclipse
  mvn -DdownloadJavadocs=true -DdownloadSources=true eclipse:eclipse


* Open Eclipse, choose <tt>File > Import... > General > Existing Projects into Workspace</tt>, and specify your git repository directory.
* Install the project and classpath files (again in both git repository directores), making sure to update the paths where necessary in all files:
* Correct formatting: <tt>Preferences > Java > Code style > Formatter > Edit...</tt>, set profile name to <tt>Mozilla</tt>, set <tt>Tab policy</tt> to <tt>Spaces only</tt> change both <tt>Indentation size</tt> and <tt>Tab size</tt> to 2, and check <tt>Align fields in columns</tt>.
 
Install the project and classpath files, making sure to update the path values in both files:


  cp example.project .project
  cp example.project .project
  cp example.classpath .classpath
  cp example.classpath .classpath


You may need to set <tt>M2_REPO</tt> (for example, as described at [http://www.mkyong.com/maven/how-to-configure-m2_repo-variable-in-eclipse-ide/]) to something like <tt>~/.m2/repository</tt>.
* Open Eclipse, choose <tt>File > Import... > General > Existing Projects into Workspace</tt>, and specify each git repository directory in turn.
 
{{note|You may need to set <tt>M2_REPO</tt> (for example, as described at [http://www.mkyong.com/maven/how-to-configure-m2_repo-variable-in-eclipse-ide/]) to something like <tt>$HOME/.m2/repository</tt>.}}
 
==== To run the android-sync test suite under Eclipse ====
 
* First configure the test suite launcher, under <tt>Preferences > Run/Debug > Launching > Default Launchers</tt>.  Set the Debug and Run launchers to <tt>Android JUnit Test Launcher</tt>.
* Select the <tt>android-sync</tt> project and execute <tt>Run > Run As ... > JUnit Test</tt>.
 
==== To run the test-android-sync test suite under Eclipse ====


To run the test suite under Eclipse, first configure the test suite launcher, under <tt>Preferences > Run/Debug > Launching > Default Launchers</tt>.  Set the Debug and Run launchers to <tt>Android JUnit Test Launcher</tt>.  To run the test suite, select the <tt>android-sync</tt> project and execute <tt>Run > Run As ... > JUnit Test</tt>.
* Select the <tt>android-sync-test</tt> project (yes, the name is different from the git repository) and execute <tt>Run > Run As ... > Android JUnit Test</tt>.


== Development ==
== Development ==
Confirmed users
355

edits

Navigation menu