|
| 1 | +## Deploying libraries to MavenLocal |
| 2 | + |
| 3 | +- When working locally on backbone or skin, it can help to deploy the libraries to a local maven repo for testing |
| 4 | +- Open the **ResearchStack project** in Android Studio |
| 5 | +- Go to Run > Edit Configurations... |
| 6 | +- Add new configuration (plus icon) |
| 7 | +- Choose Gradle as the configuration type |
| 8 | +- Set the name to "Deploy locally" or something |
| 9 | +- Choose the **/build.gradle** file as the "Gradle project" field |
| 10 | +- Add "install" to the tasks field |
| 11 | +- Save |
| 12 | +- Run that configuration and check ~/.m2 to see if it deployed |
| 13 | +- Open your own Android Studio project and follow the instructions below to add these newly-deployed libraries as dependencies. |
| 14 | + |
| 15 | +## Using the local library in a gradle Android app |
| 16 | + |
| 17 | +After deploying the library module(s) that you need to your local machine using the above instructions, add it to your Android Studio project by doing this: |
| 18 | + |
| 19 | +In the build.gradle file in your app folder, add the following to your root build.gradle so that it knows to search the ~/.m2 directory for dependencies: |
| 20 | + |
| 21 | +``` |
| 22 | +allprojects { |
| 23 | + repositories { |
| 24 | + ... |
| 25 | + mavenLocal() |
| 26 | + ... |
| 27 | + } |
| 28 | +} |
| 29 | +``` |
| 30 | + |
| 31 | +Then add the following entry to your dependencies in your app build.gradle: |
| 32 | + |
| 33 | +``` |
| 34 | +dependencies { |
| 35 | + ... |
| 36 | + compile 'org.researchstack:backbone:VERSION' |
| 37 | + // or (if using Skin, you don't need Backbone since it is included) |
| 38 | + compile 'org.researchstack:skin:VERSION' |
| 39 | + ... |
| 40 | +} |
| 41 | +``` |
| 42 | + |
| 43 | +## Running tests |
| 44 | + |
| 45 | +Tests are located in the /backbone/src/test or /skin/src/test folder. Run the tests in Android Studio by right clicking on 'backbone' or 'skin' and clicking "Run 'All Tests'". |
| 46 | + |
| 47 | +## Code Style |
| 48 | + |
| 49 | +Contributors should import code_style_settings.jar into Android Studio and use the 'researchstack' Java code style. Make sure to 'Reformat Code' and 'Optimize Imports' using this style (but don't 'Reorganize Code') before submitting a pull request. |
0 commit comments