OLD | NEW |
1 # Android Studio | 1 # Android Studio |
2 | 2 |
3 [TOC] | 3 [TOC] |
4 | 4 |
5 ## Usage | 5 ## Usage |
6 | 6 |
7 ```shell | 7 ```shell |
8 build/android/gradle/generate_gradle.py --output-directory out-gn/Debug | 8 build/android/gradle/generate_gradle.py --output-directory out-gn/Debug |
9 ``` | 9 ``` |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 ## How it Works | 40 ## How it Works |
41 | 41 |
42 Android Studio integration works by generating `build.gradle` files based on GN | 42 Android Studio integration works by generating `build.gradle` files based on GN |
43 targets. Each `android_apk` and `android_library` target produces a separate | 43 targets. Each `android_apk` and `android_library` target produces a separate |
44 Gradle sub-project. | 44 Gradle sub-project. |
45 | 45 |
46 ### Symlinks and .srcjars | 46 ### Symlinks and .srcjars |
47 | 47 |
48 Gradle supports source directories but not source files. However, some | 48 Gradle supports source directories but not source files. However, some |
49 `java/src/` directories in Chromium are split amonst multiple GN targets. To | 49 `java/src/` directories in Chromium are split amonst multiple GN targets. To |
50 accomodate this, the script detects such targets and creates a `symlinked-java/` | 50 accommodate this, the script detects such targets and creates a `symlinked-java/
` |
51 directory to point gradle at. Be warned that creating new files from Android | 51 directory to point gradle at. Be warned that creating new files from Android |
52 Studio within these symlink-based projects will cause new files to be created in | 52 Studio within these symlink-based projects will cause new files to be created in |
53 the generated `symlinked-java/` rather than the source tree where you want it. | 53 the generated `symlinked-java/` rather than the source tree where you want it. |
54 | 54 |
55 *** note | 55 *** note |
56 ** TLDR:** Always create new files outside of Android Studio. | 56 ** TLDR:** Always create new files outside of Android Studio. |
57 *** | 57 *** |
58 | 58 |
59 Most generated .java files in GN are stored as `.srcjars`. Android Studio does | 59 Most generated .java files in GN are stored as `.srcjars`. Android Studio does |
60 not have support for them, and so the generator script builds and extracts them | 60 not have support for them, and so the generator script builds and extracts them |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 * Basic Java editing and compiling works. | 111 * Basic Java editing and compiling works. |
112 | 112 |
113 ### What doesn't work (yet) ([crbug](https://bugs.chromium.org/p/chromium/issues
/detail?id=620034)) | 113 ### What doesn't work (yet) ([crbug](https://bugs.chromium.org/p/chromium/issues
/detail?id=620034)) |
114 | 114 |
115 * Better support for instrumentation tests (they are treated as non-test .apks r
ight now) | 115 * Better support for instrumentation tests (they are treated as non-test .apks r
ight now) |
116 * Make gradle aware of resources and assets | 116 * Make gradle aware of resources and assets |
117 * Make gradle aware of native code via pointing it at the location of our .so | 117 * Make gradle aware of native code via pointing it at the location of our .so |
118 * Add a mode in which gradle is responsible for generating `R.java` | 118 * Add a mode in which gradle is responsible for generating `R.java` |
119 * Add support for native code editing | 119 * Add support for native code editing |
120 * Make the "Make Project" button work correctly | 120 * Make the "Make Project" button work correctly |
OLD | NEW |