Skip to content

Commit b413b07

Browse files
authored
Build android-sdk-compose locally in the publish workflow (#1)
The module resolves `com.mapconductor:compose` by coordinate in a standalone build, and `compose` itself depends on `core`. The workflow only cloned `android-sdk-core`, so dependency resolution fails. Clone and locally publish `android-sdk-compose` as well. The workflow predates the Compose layer being split out.
1 parent 83b738c commit b413b07

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

.github/workflows/publish-maven-central.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@ jobs:
2929
echo "${{ secrets.GPG_PRIVATE_KEY }}" | base64 --decode > "$HOME/secring.gpg"
3030
gpg --batch --import "$HOME/secring.gpg"
3131
32-
- name: Build core locally
32+
- name: Build core and compose locally
3333
run: |
34+
# このモジュールは単体ビルドだと com.mapconductor:compose を座標で解決する
35+
# (build.gradle.kts の findProject 分岐)。compose はさらに core に依存するので、
36+
# core -> mavenLocal を有効化 -> compose の順に積む。
37+
# **compose を積まないと依存解決で落ちる。** Compose 層を切り出す前の
38+
# ワークフローは core だけを clone していた。
3439
git clone --depth 1 https://github.com/MapConductor/android-sdk-core.git _core
3540
cd _core
3641
./gradlew --no-daemon publishToMavenLocal
@@ -45,6 +50,11 @@ jobs:
4550
}
4651
EOF
4752
53+
git clone --depth 1 https://github.com/MapConductor/android-sdk-compose.git _compose
54+
cd _compose
55+
./gradlew --no-daemon publishToMavenLocal
56+
cd ..
57+
4858
- name: Check version and publish to Maven Central
4959
env:
5060
ORG_GRADLE_PROJECT_ossrh_username: ${{ secrets.OSSRH_USERNAME }}

build.gradle.kts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,13 @@ dependencies {
6363
// (mapscore の transitive 依存と同じ版。DataLoader が okhttp3.Interceptor を受け取る)
6464
implementation("com.squareup.okhttp3:okhttp:5.1.0")
6565

66-
api(project(":android-sdk-compose"))
66+
// 集約ビルド(android-sdk)ではプロジェクト参照、単体ビルド(CI のリリース)では
67+
// Maven 座標で解決する。他プロバイダと同じ形。
68+
if (findProject(":android-sdk-compose") != null) {
69+
api(project(":android-sdk-compose"))
70+
} else {
71+
api("com.mapconductor:compose:$libraryVersion")
72+
}
6773

6874
testImplementation(libs.junit)
6975
}

0 commit comments

Comments
 (0)