OLD | NEW |
1 # Android Studio | 1 # Android Studio |
2 | 2 |
3 [TOC] | 3 [TOC] |
4 | 4 |
5 ## Usage | 5 ## Usage |
6 | 6 |
| 7 Make sure you have followed [android build instructions](android_build_instructi
ons.md) already. |
| 8 |
7 ```shell | 9 ```shell |
8 build/android/gradle/generate_gradle.py --output-directory out-gn/Debug | 10 build/android/gradle/generate_gradle.py |
9 ``` | 11 ``` |
10 | 12 |
11 This creates a project at `out-gn/Debug/gradle`. To create elsewhere: | 13 This creates a project at `out/Debug/gradle`. To create elsewhere: |
12 | 14 |
13 ```shell | 15 ```shell |
14 build/android/gradle/generate_gradle.py --output-directory out-gn/Debug --projec
t-dir my-project | 16 build/android/gradle/generate_gradle.py --output-directory out/My-Out-Dir --proj
ect-dir my-project |
15 ``` | 17 ``` |
16 | 18 |
17 By default, only common targets are generated. To customize the list of targets | 19 By default, only common targets are generated. To customize the list of targets |
18 to generate projects for: | 20 to generate projects for: |
19 | 21 |
20 ```shell | 22 ```shell |
21 build/android/gradle/generate_gradle.py --output-directory out-gn/Debug --target
//some:target_apk --target //some/other:target_apk | 23 build/android/gradle/generate_gradle.py --target //some:target_apk --target //so
me/other:target_apk |
22 ``` | 24 ``` |
23 | 25 |
24 For first-time Android Studio users: | 26 For first-time Android Studio users: |
25 | 27 |
26 * Avoid running the setup wizard. | 28 * Avoid running the setup wizard. |
27 * The wizard will force you to download unwanted SDK components to `//third_
party/android_tools`. | 29 * The wizard will force you to download unwanted SDK components to `//third_
party/android_tools`. |
28 * To skip it, select "Cancel" when it comes up. | 30 * To skip it, select "Cancel" when it comes up. |
29 | 31 |
30 To import the project: | 32 To import the project: |
31 | 33 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 This wrapper can also be used to invoke gradle commands. | 102 This wrapper can also be used to invoke gradle commands. |
101 | 103 |
102 cd $GRADLE_PROJECT_DIR && bash gradlew | 104 cd $GRADLE_PROJECT_DIR && bash gradlew |
103 | 105 |
104 The resulting artifacts are not terribly useful. They are missing assets, | 106 The resulting artifacts are not terribly useful. They are missing assets, |
105 resources, native libraries, etc. | 107 resources, native libraries, etc. |
106 | 108 |
107 * Use a [gradle daemon](https://docs.gradle.org/2.14.1/userguide/gradle_daemon.h
tml) to speed up builds: | 109 * Use a [gradle daemon](https://docs.gradle.org/2.14.1/userguide/gradle_daemon.h
tml) to speed up builds: |
108 * Add the line `org.gradle.daemon=true` to `~/.gradle/gradle.properties`, cr
eating it if necessary. | 110 * Add the line `org.gradle.daemon=true` to `~/.gradle/gradle.properties`, cr
eating it if necessary. |
109 | 111 |
110 ## Status (as of Sept 21, 2016) | 112 ## Status (as of Jan 19, 2017) |
111 | 113 |
112 ### What works | 114 ### What works |
113 | 115 |
114 * Tested with Android Studio v2.2. | 116 * Tested with Android Studio v2.2. |
115 * Basic Java editing and compiling works. | 117 * Java editing and gradle compile works. |
| 118 * Instrumentation tests included as androidTest. |
| 119 * Symlinks to existing .so files in jniLibs (doesn't generate them). |
116 | 120 |
117 ### What doesn't work (yet) ([crbug](https://bugs.chromium.org/p/chromium/issues
/detail?id=620034)) | 121 ### What doesn't work (yet) ([crbug](https://bugs.chromium.org/p/chromium/issues
/detail?id=620034)) |
118 | 122 |
119 * Better support for instrumentation tests (they are treated as non-test .apks r
ight now) | |
120 * Make gradle aware of resources and assets | 123 * Make gradle aware of resources and assets |
121 * Make gradle aware of native code via pointing it at the location of our .so | |
122 * Add a mode in which gradle is responsible for generating `R.java` | 124 * Add a mode in which gradle is responsible for generating `R.java` |
123 * Add support for native code editing | 125 * Add support for native code editing |
124 * Make the "Make Project" button work correctly | 126 * Make the "Make Project" button work correctly |
OLD | NEW |