Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,11 @@ plugins {
id("org.jetbrains.kotlin.android") version "2.1.0" apply false
id("org.jetbrains.kotlin.plugin.compose") version "2.1.0" apply false
}

// Coordinates for the published Android/JVM artifacts (GitHub Packages). Mirrors the
// npm scope @fundamental-engine and the Swift package products. Version tracks the
// repo's release tags.
subprojects {
group = "com.fundamental"
version = "0.9.5"
}
15 changes: 15 additions & 0 deletions android/fundamental-compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("org.jetbrains.kotlin.plugin.compose")
`maven-publish`
}

android {
publishing { singleVariant("release") }
namespace = "com.fundamental.compose"
compileSdk = 34
buildToolsVersion = "34.0.0"
Expand Down Expand Up @@ -42,3 +44,16 @@ dependencies {
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.8.7")
implementation("androidx.core:core-ktx:1.13.1")
}

// ── Publishing ──────────────────────────────────────────────────────────────
apply(from = rootProject.file("gradle/github-packages.gradle.kts"))
afterEvaluate {
publishing {
publications {
create<MavenPublication>("release") {
from(components["release"]) // AGP's release AAR + POM (transitive core dep included)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Export Compose API dependencies from the AAR

Publishing components["release"] makes Gradle publish the release variant with this module's api/implementation separation. In the inspected Compose API, FieldView/Modifier.fieldBody expose @Composable, Modifier, Color, and LayoutCoordinates (FieldView.kt:78, 83-89, 262-263), but the corresponding Compose UI/runtime BOM/deps remain implementation, so a downstream app that follows the new coordinates and declares only com.fundamental:fundamental-compose will not get those classes on its compile classpath. Move the public Compose dependencies (and BOM constraint) to api or the published artifact is not self-contained.

Useful? React with 👍 / 👎.

artifactId = "fundamental-compose"
}
}
}
}
12 changes: 12 additions & 0 deletions android/fundamental-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
kotlin("jvm")
kotlin("plugin.serialization")
`maven-publish`
}

dependencies {
Expand Down Expand Up @@ -86,3 +87,14 @@ sourceSets.main {
tasks.named<ProcessResources>("processResources") {
dependsOn(syncRecipes)
}

// ── Publishing ──────────────────────────────────────────────────────────────
apply(from = rootProject.file("gradle/github-packages.gradle.kts"))
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
artifactId = "fundamental-core"
}
}
}
17 changes: 17 additions & 0 deletions android/gradle/github-packages.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Shared GitHub Packages target. Applied by the modules we publish (core, compose).
// Credentials come from the environment so nothing secret is committed:
// GITHUB_ACTOR (defaults to the repo owner) + GITHUB_TOKEN (needs write:packages).
// Uses configure<PublishingExtension> rather than the `publishing { }` accessor,
// which is not generated for scripts applied via apply(from = …).
configure<org.gradle.api.publish.PublishingExtension> {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/zachshallbetter/fundamental-engine")
credentials {
username = System.getenv("GITHUB_ACTOR") ?: "zachshallbetter"
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
Loading