Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
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
6 changes: 3 additions & 3 deletions .github/skills/jenv-gradle-low-ram/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ org.gradle.jvmargs=-Xmx1536m -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8
Retry with `--no-daemon --max-workers=1` and lower `-Xmx` if the OS is reclaiming memory aggressively.
- Kotlin compile OOM:
Keep workers low, disable parallel, and run module-targeted tasks (for example `:core:test` or `:processor:test`) instead of full-project builds.
- KAPT out of memory (`:processor` module):
Add `-Dkapt.use.worker.api=false` to avoid spawning an extra worker process during annotation processing.
- KSP processing OOM (`:processor` module):
Keep worker pressure low (`--max-workers=1` or `2`) and run `:processor:test` directly before full-project tasks.

## Completion Checks

Expand All @@ -128,4 +128,4 @@ org.gradle.jvmargs=-Xmx1536m -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8
- "Align my shell to `.java-version` and run debug build with 8GB RAM settings"
- "I get class file major version errors; fix jenv and verify Gradle JVM"
- "Run unit tests with a low-memory Gradle profile and fallback if OOM occurs"
- "Run only the processor module tests without spawning extra KAPT workers"
- "Run only the processor module tests with a low-memory profile"
2 changes: 1 addition & 1 deletion .github/skills/sqlite-android-map/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ val sqliteQuery = builder.asSupportSQLiteQuery()
| Excuse | Reality |
| --- | --- |
| "KSP folders exist, so migration is done" | Folder artifacts are not build wiring truth. Confirm plugin and processor APIs in source/build files. |
| "I can infer output path without reading processor code" | Verify the current KSP `CodeGenerator` and test-harness APIs instead of relying on old KAPT output assumptions. |
| "I can infer output path without reading processor code" | Verify the current KSP `CodeGenerator` and test-harness APIs instead of relying on outdated annotation-processing assumptions. |
| "Bridge code is obvious" | Verify owner module. This repo keeps SQL building and Android bridge in different modules. |

## Red Flags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ Use this map to understand how room metadata becomes generated schema constants.

## Migration Notes

The KAPT-to-KSP migration is complete in current source:
The migration to KSP is complete in current source:

1. `Provider` and `Processor` replace the old KAPT entrypoint shape.
1. `Provider` and `Processor` define the current entrypoint shape.
2. Symbol traversal is KSP-based through `KSClassDeclaration` and related symbols.
3. Generated Kotlin is emitted through `CodeGenerator` plus KotlinPoet.
4. Module and sample wiring use `ksp(...)`.
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/android-spotless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

jobs:
spotless:
name: Spotless Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/android-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

jobs:
test:
name: Android Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on: pull_request_target

jobs:
auto-approve:
name: Auto-approve pull requests
runs-on: ubuntu-latest
permissions:
pull-requests: write
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/first-contribution-greeting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ name: first-contribution-greeting
on: [pull_request_target, issues]

jobs:
first-contribution-greeting:
greeting:
name: Greet first-time contributors
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/first-interaction@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: "Hey there! Thank you for creating an issue :) Please take a moment to review our [**community guidelines**](https://github.com/AniTrend/support-query-builder/blob/develop/CONTRIBUTING.md) to make the contribution process easy and effective for everyone involved."
pr-message: "Hey there! Thank you for this PR :) Please take a moment to review our [**community guidelines**](https://github.com/AniTrend/support-query-builder/blob/develop/CONTRIBUTING.md) to make the contribution process easy and effective for everyone involved."
repo_token: ${{ secrets.GITHUB_TOKEN }}
issue_message: "Hey there! Thank you for creating an issue :) Please take a moment to review our [**community guidelines**](https://github.com/AniTrend/support-query-builder/blob/develop/CONTRIBUTING.md) to make the contribution process easy and effective for everyone involved."
pr_message: "Hey there! Thank you for this PR :) Please take a moment to review our [**community guidelines**](https://github.com/AniTrend/support-query-builder/blob/develop/CONTRIBUTING.md) to make the contribution process easy and effective for everyone involved."
69 changes: 69 additions & 0 deletions .github/workflows/gradle-dokka-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: gradle-dokka-preview

on:
pull_request:
branches: [ develop ]
types: [ opened, synchronize, reopened, closed ]
paths:
- 'annotations/src/main/**/*.kt'
- 'core/src/main/**/*.kt'
- 'core/ext/src/main/**/*.kt'
- 'processor/src/main/**/*.kt'
- 'build.gradle.kts'
- 'buildSrc/src/main/**/*.kt'

permissions:
contents: read

jobs:
dokka-preview:
name: Build Dokka Snapshot
if: github.event.action != 'closed'
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: set up JDK 21
uses: actions/setup-java@v5
with:
java-version: 21
distribution: 'adopt'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
with:
cache-read-only: true
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Generate docs with dokka
run: ./gradlew dokkaGenerate
- name: Deploy snapshot to docs branch
uses: JamesIves/github-pages-deploy-action@v4.8.0
with:
branch: docs
folder: dokka-docs
target-folder: pr-preview/${{ github.event.number }}
clean: false

cleanup-preview:
name: Clean Up Dokka Snapshot
if: github.event.action == 'closed'
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: docs
token: ${{ secrets.GITHUB_TOKEN }}
- name: Remove PR snapshot from docs branch
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
if [ -d "pr-preview/${{ github.event.number }}" ]; then
git rm -rf "pr-preview/${{ github.event.number }}"
git commit -m "docs: remove PR #${{ github.event.number }} snapshot"
git push
else
echo "No snapshot found for PR #${{ github.event.number }}, skipping cleanup."
fi
5 changes: 4 additions & 1 deletion .github/workflows/gradle-dokka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:

jobs:
gradle-dokka:
name: Generate Dokka Documentation
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
Expand All @@ -21,7 +24,7 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Generate docs with dokka
run: ./gradlew dokkaHtmlMultiModule
run: ./gradlew dokkaGenerate

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4.8.0
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/gradle-wrapper-validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on: [push, pull_request]

jobs:
validation:
name: Validate Gradle Wrapper
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/release-drafter-autolabeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: release-drafter-autolabeler

on:
pull_request:
types: [opened, reopened, synchronize]
pull_request_target:
types: [opened, reopened, synchronize]

permissions:
contents: read

jobs:
autolabel-pr:
name: Auto Label Pull Request
if: >-
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
||
(github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository)
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter/autolabeler@v7
with:
config-name: release-drafter-config.yml
token: ${{ secrets.GITHUB_TOKEN }}
8 changes: 2 additions & 6 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ on:
push:
branches:
- 'develop'
pull_request_target:
# Only following types are handled by the action, but one can default to all as well
types: [ opened, reopened, synchronize ]

permissions:
contents: read

jobs:
update-draft-release:
name: Update Draft Release
permissions:
contents: write
pull-requests: write
Expand All @@ -22,10 +20,8 @@ jobs:
id: release_drafter
with:
config-name: release-drafter-config.yml
disable-autolabeler: false
commitish: develop
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v4
with:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ on:
- cron: "30 1 * * *"

jobs:
check:
stale-checker:
name: Stale Check
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v10
Expand All @@ -19,4 +20,4 @@ jobs:
days-before-close: 365
exempt-issue-labels: 'awaiting-approval,work-in-progress'
exempt-pr-labels: 'awaiting-approval,work-in-progress'
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
24 changes: 21 additions & 3 deletions .github/workflows/version-updater.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ permissions:

jobs:
version-update:
name: Update version.properties and create PR
permissions:
contents: write
pull-requests: write
Expand All @@ -32,6 +33,24 @@ jobs:
echo "code=$CODE" >> gradle/version.properties
echo "name=v$(cat VERSION)" >> gradle/version.properties

- name: Build PR metadata
id: pr_metadata
run: |
VERSION="$(cat gradle/version.properties | grep '^version=' | cut -d'=' -f2)"
CODE="$(cat gradle/version.properties | grep '^code=' | cut -d'=' -f2)"
NAME="$(cat gradle/version.properties | grep '^name=' | cut -d'=' -f2)"
echo "title=platform: bump version.properties to ${VERSION} (${NAME})" >> "$GITHUB_OUTPUT"
{
echo "body<<EOF"
echo "This PR was automatically generated to update version metadata for ${VERSION}."
echo ""
echo "Updated values in gradle/version.properties:"
echo "- version=${VERSION}"
echo "- code=${CODE}"
echo "- name=${NAME}"
echo "EOF"
} >> "$GITHUB_OUTPUT"

- name: Clean up version information file
run: rm VERSION

Expand All @@ -46,9 +65,8 @@ jobs:
delete-branch: true
commit-message: "automation: update version.properties"
author: "Author <actions@github.com>"
title: "platform: automated version update"
body: |
This PR was automatically generated to update `version.properties`
title: ${{ steps.pr_metadata.outputs.title }}
body: ${{ steps.pr_metadata.outputs.body }}
branch: platform/update-version-meta-data
labels: "skip-changelog"
assignees: "wax911"
Expand Down
3 changes: 0 additions & 3 deletions annotations/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,3 @@ tasks.jar {
}
}

tasks.withType<GenerateModuleMetadata> {
dependsOn(":annotations:classesJar")
}
36 changes: 32 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask
import java.net.URI
import org.jetbrains.dokka.gradle.DokkaExtension

plugins {
id("org.jetbrains.dokka")
Expand All @@ -26,7 +27,34 @@ allprojects {
}
}

tasks.withType(DokkaMultiModuleTask::class.java) {
outputDirectory.set(rootProject.file("dokka-docs"))
failOnWarning.set(false)
dokka {
dokkaPublications.html {
outputDirectory.set(rootProject.file("dokka-docs"))
failOnWarning.set(false)
}
}

subprojects {
plugins.withId("org.jetbrains.dokka") {
extensions.configure(DokkaExtension::class.java) {
val modulePath = project.path.removePrefix(":").replace(":", "/")

dokkaSourceSets.configureEach {
reportUndocumented.set(true)
skipEmptyPackages.set(true)

sourceLink {
localDirectory.set(layout.projectDirectory.dir("src/main/kotlin"))
remoteUrl.set(URI("https://github.com/AniTrend/support-query-builder/tree/develop/$modulePath/src/main/kotlin"))
remoteLineSuffix.set("#L")
}
}
}
}
}

dependencies {
dokka(project(":annotations"))
dokka(project(":core"))
dokka(project(":core:ext"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fun Project.isSampleModule() = name == Modules.App.Main.id
fun Project.isAnnotationModule() = name == Modules.Common.Annotation.id
fun Project.isCoreModule() = name == Modules.Common.Core.id
fun Project.isCoreExtModule() = name == Modules.Common.Ext.id
fun Project.isProcessorModule() = name == Modules.Processor.Kapt.id
fun Project.isProcessorModule() = name == Modules.Processor.Ksp.id

fun Project.isKotlinLibraryGroup() = isProcessorModule() || isAnnotationModule() || isCoreModule()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ internal object Modules {
}

enum class Processor(override val id: String) : Module {
Kapt("processor"),
Ksp("processor")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,20 @@ internal fun Project.configureSources() {
from(mainSourceSets)
}

val classesJar by tasks.register("classesJar", Jar::class.java) {
from("${project.layout.buildDirectory.get()}/intermediates/classes/release")
val classesJar = if (isCoreModule()) {
tasks.register("classesJar", Jar::class.java) {
dependsOn(tasks.named("classes"))
from(layout.buildDirectory.dir("classes/kotlin/main"))
from(layout.buildDirectory.dir("classes/java/main"))
}
} else {
null
}

artifacts {
add("archives", classesJar)
if (classesJar != null) {
add("archives", classesJar)
}
add("archives", sourcesJar)
}

Expand Down
1 change: 1 addition & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ plugins {
tasks.withType<GenerateModuleMetadata> {
dependsOn(":core:classesJar")
}

Loading
Loading