You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Igor Demin 16df22a716
Update README.md
3 years ago
..
.idea Copy IDEA settings from androidx project (#1455) 3 years ago
.run Change Compose build scripts 3 years ago
buildSrc Fix publishing multiple platforms that use same alternative name (#1790) 3 years ago
external A third party license for NotoSans ttf fonts (#1870) 3 years ago
frameworks Move Compose 3 years ago
golden@ff549f2541 rebasing to latest compose 3 years ago
gradle/wrapper Updated to gradle 7.4 3 years ago
prebuilts/androidx Update Compose 3 years ago
screenshots Compose as submodule, scripts for build/test Compose (#830) 3 years ago
scripts Use cmake from master again 3 years ago
.gitignore Copy IDEA settings from androidx project (#1455) 3 years ago
README.md Update README.md 3 years ago
build.gradle.kts remove a condition (based on .jbWebExistsMarker file) for js tests tasks (#1848) 3 years ago
gradle.properties Moved kotlin native to experimental mm (#1910) 3 years ago
gradlew Updated to gradle 7.4 3 years ago
gradlew.bat Updated to gradle 7.4 3 years ago
settings.gradle.kts Add publishing infrastructure for MPP targets 3 years ago

README.md

Project in Android Studio

Composite build of Compose-jb sources

Download submodules after downloading the main project:

git submodule update --init --recursive

Set this property to always update submodules on git checkout/pull/reset:

git config --global submodule.recurse true

General requirements

  • Java 11 (should be specified in JAVA_HOME)
  • [macOs/Linux] Android SDK downloaded via ./scripts/downloadAndroidSdk
  • [Windows] Android SDK downloaded from Android Studio and specified in ANDROID_SDK_ROOT. Required components:
    • 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

  1. Download Android Studio from the official site (it is mandatory to use the version, written here). As an alternative you can use IDEA, which is compatible with this AGP version, 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:
export ALLOW_PUBLIC_REPOS=1
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
  1. 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
  1. Open compose folder in Android Studio (not compose/frameworks/support)
  2. 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)
  3. Specify Gradle JDK 11 in ... -> Build Tools -> Gradle
  4. [macOs/Linux] Specify Android SDK pointed to a folder, downloaded via ./scripts/downloadAndroidSdk

Scripts

Publish artifacts to the local directory out/androidx/build/support_repo/org/jetbrains/compose:

export COMPOSE_CUSTOM_VERSION=0.0.0-custom
./scripts/publish

(on Windows it doesn't build at the moment, the issue is in the line packageInspector(project, project(":compose:ui:ui-inspection") in compose/frameworks/support/compose/ui/ui/build.gradle)

Publish extended icons:

./scripts/publishExtendedIcons

Run tests for Desktop:

./scripts/testDesktop

Run tests for Web:

./scripts/testWeb

Multiplatform build

./scripts/downloadAndroidSdk
export COMPOSE_CUSTOM_VERSION=1.1.0-beta04
./scripts/publishToMavenLocal -Pcompose.platforms=all
./scripts/publishGradlePluginToMavenLocal
./scripts/publishWebComponentsToMavenLocal

-Pcompose.platforms=all could be replace with comma-separated list of platforms, such as js,jvm,androidDebug,androidRelease,macosx64,uikitx64.