Skip to content

Support using sources instead of androidx artifacts#3169

Closed
Igor Demin (igordmn) wants to merge 3 commits into
igor.demin/buildSrc-fork-jbmainfrom
igor.demin/buildSrc-fork-support-using-sources
Closed

Support using sources instead of androidx artifacts#3169
Igor Demin (igordmn) wants to merge 3 commits into
igor.demin/buildSrc-fork-jbmainfrom
igor.demin/buildSrc-fork-support-using-sources

Conversation

@igordmn

@igordmn Igor Demin (igordmn) commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Part of CMP-10017 Simplify merges short-term. Make buildSrc/build.gradle for the fork mode

  • move stubs into separate -stub project
  • reset the state of projects that are needed to be included as sources to the AOSP state
  • fork them, apply necessary changes, so they can work with the forked build structure
  • add jetbrains.androidx.use.androidx.sources.instead.of.artifacts. If true - sources instead of androidx artifacts are used for specific projects, using dependency substitution

Supported projects to run from sources:

  • compose:runtime
  • compose:runtime-annotation
  • TBD

Release Notes

N/A

```
cp compose/runtime/runtime/build-fork.gradle compose/runtime/runtime-stub/build.gradle
```
```
git checkout --no-overlay androidx/compose-ui/1.12.0-beta01 -- compose/runtime/runtime/build**
git checkout --no-overlay androidx/compose-ui/1.12.0-beta01 -- compose/runtime/runtime-annotation/build**
cp compose/runtime/runtime/build.gradle compose/runtime/runtime/build-fork.gradle
cp compose/runtime/runtime-annotation/build.gradle compose/runtime/runtime-annotation/build-fork.gradle
```
@igordmn Igor Demin (igordmn) changed the title Igor.demin/build src fork support using sources Support using sources instead of androidx artifacts Jun 30, 2026
@igordmn

Igor Demin (igordmn) commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator Author

Discussed not doing this as it is controversial, and revisit when it is needed

Igor Demin (igordmn) added a commit that referenced this pull request Jul 1, 2026
Part of [CMP-10017](https://youtrack.jetbrains.com/issue/CMP-10017)
Simplify merges short-term. Make buildSrc/build.gradle for the fork mode

The reason is to simplify regular AOSP merges.

There are 2 modes:
- AOSP mode. used if it is opened via `gradlew studio`
- fork mode. used if it is opened via IDEA.

The build fork is separated using this code:
```
def isRunFromGradlewStudio = System.getenv().get("EXPECTED_AGP_VERSION")
if (!isRunFromGradlewStudio) {
    apply from: "settings-fork.gradle"
    return
}
```

This works, but not ideally because some parts of the build are still
shared with AOSP and we need to review them during the merge:
```
gradle.properties
gradle/wrapper
gradle/libs.version.toml
buildSrc/gradle.properties
```
Alternatives that I tried:
- create `fork-project`, add symlinks to the top-level projects. Didn't
work because integration with Git is broken (the changed files are
treated as not a part of the project)
- create `fork-project`, use `../project` paths to the top-level
projects. Didn't work because running from the gutter is broken (IDEA
tells that the project folder isn't part of the root project)

Next steps:
1. [Support using sources instead of androidx
artifacts](#3169)
2. Merge it into `integration`
3. Reset state of `buildSrc`, `build.gradle` to the AOSP state
(excluding the code that redirects to the fork)
4. Add an automatic task that compares source sets dependencies inside
`build-fork.gradle`
5. Clean up `buildSrc` from not needed code


[TeamCity](https://teamcity.jetbrains.com/buildConfiguration/JetBrainsPublicProjects_Compose_AllPersonalBuild/6263205)

Should be reviewed commit by commit.

## Release Notes
N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant