KRPC-238: Add proto and protoImport dependency configurations to Gradle plugin#679
KRPC-238: Add proto and protoImport dependency configurations to Gradle plugin#679ai-agent-kxrpc[bot] wants to merge 6 commits into
Conversation
🔒 AI PR Safety: SAFEAll comments on this bot-authored PR are from authorized repository collaborators. |
Internal code reviewAll issues identified by agent reviewers were fixed. |
CI ReportPassed
FailedNone |
Mr3zee
left a comment
There was a problem hiding this comment.
Big problems:
- missing feature: KMP should also have per-source set configs:
kotlin {
sourceSets {
commonMain {
dependencies {
proto("..") // configuration that is available and managed by the gradle plugin
}
}
jvmMain {
dependencies {
proto("..")
}
}
}
}- No tests for android non-main flavours. Must test that all flavoured configs work,
debugProto,releaseProto - No tests on how files from configurations are consumed by
importsandextendsrelations. Must have for KMP and Android
|
Addressed review feedback in 850ac27: 1. KMP per-source-set DSL — Added kotlin.sourceSets {
commonMain {
dependencies {
protoImport(files("dependency-protos.zip"))
}
}
}2. Android non-main flavor tests — Added 3. KMP 230 tests pass (all JVM, KMP, Android including flavors). |
Subsystem
gradle-plugin
Problem
YouTrack: KRPC-238
Solution
Added first-class Gradle dependency configurations for importing proto files from archives (JARs, ZIPs). The plugin now automatically creates two configurations per proto source set:
<name>Proto— proto files included in code generation (e.g.,proto,commonMainProto,debugProto)<name>ProtoImport— proto files available as imports only, no code generation (e.g.,protoImport,commonMainProtoImport)API:
Implementation details:
createProtoExtensions()so Kotlin DSL accessors are availabledisambiguateNameconvention (mainelided:proto, notmainProto)ExtractDependencyProtoImportstask extracts.protofrom resolved archives viaArchiveOperations.zipTree()(CC-compatible)processProtoFiles/processProtoFilesImportstasksdependsOngraph (KMP) andProtoSourceSet.extendsFrom(Android variants)Note
Fully autonomous AI-generated PR — no human reviewed the code before submission.
Problem analysis and root cause details: KRPC-238