mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-02-07 06:12:56 -05:00
build(ksp): ksp and publishing tuning (#4462)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
51
.github/workflows/publish-core.yml
vendored
Normal file
51
.github/workflows/publish-core.yml
vendored
Normal 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 }}
|
||||
@@ -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")
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ afterEvaluate {
|
||||
publications {
|
||||
create<MavenPublication>("release") {
|
||||
from(components["release"])
|
||||
artifactId = "core-api"
|
||||
artifactId = "meshtastic-android-api"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
```
|
||||
@@ -47,7 +47,7 @@ afterEvaluate {
|
||||
publications {
|
||||
create<MavenPublication>("release") {
|
||||
from(components["release"])
|
||||
artifactId = "core-model"
|
||||
artifactId = "meshtastic-android-model"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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-")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.")
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user