build(ksp): ksp and publishing tuning (#4462)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
James Rich
2026-02-05 16:36:38 -06:00
committed by GitHub
parent 9e6de124ee
commit 18aae852fd
9 changed files with 84 additions and 10 deletions

51
.github/workflows/publish-core.yml vendored Normal file
View File

@@ -0,0 +1,51 @@
name: Publish Core Libraries
on:
release:
types: [created]
workflow_dispatch:
inputs:
version_suffix:
description: 'Version suffix (e.g. -alpha01, -SNAPSHOT)'
required: false
default: '-SNAPSHOT'
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Configure Version
id: version
run: |
if [[ "${{ github.event_name }}" == "release" ]]; then
echo "VERSION_NAME=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
else
# Use a timestamp-based version for manual/branch builds to avoid collisions
# or use the base version + suffix
BASE_VERSION=$(grep "VERSION_NAME_BASE" config.properties | cut -d'=' -f2)
echo "VERSION_NAME=${BASE_VERSION}${{ inputs.version_suffix }}" >> $GITHUB_ENV
fi
- name: Publish to GitHub Packages
run: ./gradlew :core:api:publish :core:model:publish :core:proto:publish
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -28,13 +28,13 @@ dependencies {
val meshtasticVersion = "v2.7.13"
// The core AIDL interface
implementation("com.github.meshtastic.Meshtastic-Android:core-api:$meshtasticVersion")
implementation("com.github.meshtastic.Meshtastic-Android:meshtastic-android-api:$meshtasticVersion")
// Data models (DataPacket, MeshUser, NodeInfo, etc.)
implementation("com.github.meshtastic.Meshtastic-Android:core-model:$meshtasticVersion")
implementation("com.github.meshtastic.Meshtastic-Android:meshtastic-android-model:$meshtasticVersion")
// Protobuf definitions (PortNum, Telemetry, etc.)
implementation("com.github.meshtastic.Meshtastic-Android:core-proto:$meshtasticVersion")
implementation("com.github.meshtastic.Meshtastic-Android:meshtastic-android-proto:$meshtasticVersion")
}
```

View File

@@ -39,7 +39,7 @@ afterEvaluate {
publications {
create<MavenPublication>("release") {
from(components["release"])
artifactId = "core-api"
artifactId = "meshtastic-android-api"
}
}
}

View File

@@ -36,5 +36,5 @@ This module contains the Parcelable data classes used by the Meshtastic Android
This module is typically used as a dependency of `core:api` but can be used independently if you need to work with Meshtastic data structures.
```kotlin
implementation("com.github.meshtastic.Meshtastic-Android:core-model:v2.7.12")
implementation("com.github.meshtastic.Meshtastic-Android:meshtastic-android-model:v2.7.12")
```

View File

@@ -47,7 +47,7 @@ afterEvaluate {
publications {
create<MavenPublication>("release") {
from(components["release"])
artifactId = "core-model"
artifactId = "meshtastic-android-model"
}
}
}

View File

@@ -56,9 +56,9 @@ publishing {
publications.withType<MavenPublication>().configureEach {
val baseId = artifactId
if (baseId == "proto") {
artifactId = "core-proto"
artifactId = "meshtastic-android-proto"
} else if (baseId.startsWith("proto-")) {
artifactId = baseId.replace("proto-", "core-proto-")
artifactId = baseId.replace("proto-", "meshtastic-android-proto-")
}
}
}

View File

@@ -44,9 +44,10 @@ android.experimental.lint.analysisPerComponent=true
# KSP 2 Configuration
ksp.useKSP2=true
ksp.run.in.process=false
ksp.run.in.process=true
ksp.incremental=true
ksp.incremental.classpath=true
ksp.incremental.intermodule=true
# UI & Analysis
dependency.analysis.print.build.health=true

View File

@@ -32,3 +32,23 @@ if (project.version == "unspecified") {
println("Configured publication version for project ${project.name}: ${project.version}")
}
val GITHUB_ACTOR = System.getenv("GITHUB_ACTOR")
val GITHUB_TOKEN = System.getenv("GITHUB_TOKEN")
if (!GITHUB_ACTOR.isNullOrEmpty() && !GITHUB_TOKEN.isNullOrEmpty()) {
configure<PublishingExtension> {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/meshtastic/Meshtastic-Android")
credentials {
username = GITHUB_ACTOR
password = GITHUB_TOKEN
}
}
}
}
} else {
println("Skipping GitHub Packages repository configuration: GITHUB_ACTOR or GITHUB_TOKEN not set.")
}

View File

@@ -1,5 +1,7 @@
jdk:
- openjdk17
before_install:
- ./gradlew --stop
install:
- ./gradlew publishToMavenLocal
- ./gradlew :core:proto:publishToMavenLocal :core:model:publishToMavenLocal :core:api:publishToMavenLocal --no-daemon --stacktrace -Dorg.gradle.jvmargs="-Xmx4g -XX:+UseParallelGC"
group: org.meshtastic