Browse Source

Update README.md (#2264)

pull/2265/head
Igor Demin 2 years ago committed by GitHub
parent
commit
8cbf17901c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 32
      compose/README.md

32
compose/README.md

@ -13,34 +13,14 @@ git config --global submodule.recurse true
## General requirements ## General requirements
- Java 11 (should be specified in JAVA_HOME) - Java 11 (should be specified in JAVA_HOME)
- [macOs/Linux] Android SDK downloaded via `./scripts/downloadAndroidSdk` - [macOs/Linux] Android SDK downloaded via `./compose/frameworks/support/jpdeps/android-sdk/downloadAndroidSdk`
- [Windows] Android SDK downloaded from Android Studio and specified in ANDROID_SDK_ROOT. Required components: - [Windows] Android SDK downloaded from Android Studio and specified in ANDROID_SDK_ROOT
- Android 12
- Build-Tools 30.0.3
- NDK 21.3.6528147 (in folder $androidSdk/ndk, not in $androidSdk/ndk/$version)
- CMake 3.10.2.4988404 (in folder $androidSdk/cmake, not in $androidSdk/cmake/$version)
## Developing in IDE ## Developing in IDE
1. Download Android Studio from [the official site](https://developer.android.com/studio/archive) (it is mandatory to use the version, written [here](https://github.com/JetBrains/androidx/blob/jb-main/gradle/libs.versions.toml#L11)). As an alternative you can use IDEA, which is compatible with [this AGP version](https://github.com/JetBrains/androidx/blob/jb-main/gradle/libs.versions.toml#L5), or you can disable Android plugin in IDEA plugins, to develop non-Android targets. 1. Download Android Studio from [the official site](https://developer.android.com/studio/archive) (it is mandatory to use the version, written [here](https://github.com/JetBrains/androidx/blob/jb-main/gradle/libs.versions.toml#L11)). As an alternative you can use IDEA, which is compatible with [this AGP version](https://github.com/JetBrains/androidx/blob/jb-main/gradle/libs.versions.toml#L5), or you can disable Android plugin in IDEA plugins, to develop non-Android targets.
2. Set environment variables in the global script (`~/.zshrc` for macOs), or in the terminal, before starting IDE also from this terminal: 2. Open `compose/frameworks/support` folder in Android Studio or in IDEA.
``` 3. Specify Gradle JDK 11 in `... -> Build Tools -> Gradle`
export ALLOW_PUBLIC_REPOS=1 4. [macOs/Linux] Specify Android SDK pointed to a folder, downloaded via `./compose/frameworks/support/jpdeps/android-sdk/downloadAndroidSdk`
export JAVA_TOOLS_JAR=$PWD/external/tools.jar
export ANDROIDX_PROJECTS=COMPOSE
export JAVA_HOME=<JDK_home> // it should point to Java 11 and contain /include/jvmti.h
```
3. Set gradle properties in ~/.gradle/gradle.properties:
```
androidx.compose.multiplatformEnabled=true
# note that https://android.googlesource.com/platform/frameworks/support build doesn't work with jetbrains.compose.jsCompilerTestsEnabled)
jetbrains.compose.jsCompilerTestsEnabled=true
androidx.validateProjectStructure=false
kotlin.js.webpack.major.version=4
```
4. Open `compose` folder in Android Studio (not `compose/frameworks/support`)
5. Download a custom Gradle 7.2 and specify it in `Settings -> Build, Execution, Deployment -> Build Tools -> Gradle` (because Android Studio will pick the wrong Gradle in the subproject instead of the Gradle in the root project)
6. Specify Gradle JDK 11 in `... -> Build Tools -> Gradle`
7. [macOs/Linux] Specify Android SDK pointed to a folder, downloaded via `./scripts/downloadAndroidSdk`
## Scripts ## Scripts
Publish artifacts to the local directory `out/androidx/build/support_repo/org/jetbrains/compose`: Publish artifacts to the local directory `out/androidx/build/support_repo/org/jetbrains/compose`:
@ -98,7 +78,7 @@ Run native macos sample:
## Multiplatform build ## Multiplatform build
```console ```console
./scripts/downloadAndroidSdk ./compose/frameworks/support/jpdeps/android-sdk/downloadAndroidSdk
export COMPOSE_CUSTOM_VERSION=1.1.0-beta04 export COMPOSE_CUSTOM_VERSION=1.1.0-beta04
./scripts/publishToMavenLocal -Pcompose.platforms=all ./scripts/publishToMavenLocal -Pcompose.platforms=all
./scripts/publishGradlePluginToMavenLocal ./scripts/publishGradlePluginToMavenLocal

Loading…
Cancel
Save