mirror of
https://github.com/vector-im/riotX-android
synced 2025-10-06 00:02:48 +02:00
Workaround to have KSP generated Kotlin code available in the IDE (for code completion)
Ref: https://github.com/airbnb/epoxy/releases/tag/5.0.0beta02
This commit is contained in:
committed by
Benoit Marty
parent
cba920f3e5
commit
9f68d9d803
28
build.gradle
28
build.gradle
@@ -329,3 +329,31 @@ ext.initScreenshotTests = { project ->
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Workaround to have KSP generated Kotlin code available in the IDE (for code completion)
|
||||||
|
// Ref: https://github.com/airbnb/epoxy/releases/tag/5.0.0beta02
|
||||||
|
subprojects { project ->
|
||||||
|
afterEvaluate {
|
||||||
|
if (project.hasProperty("android")) {
|
||||||
|
android {
|
||||||
|
if (it instanceof com.android.build.gradle.LibraryExtension) {
|
||||||
|
libraryVariants.all { variant ->
|
||||||
|
def outputFolder = new File("build/generated/ksp/${variant.name}/kotlin")
|
||||||
|
variant.addJavaSourceFoldersToModel(outputFolder)
|
||||||
|
android.sourceSets.getAt(variant.name).java {
|
||||||
|
srcDir(outputFolder)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (it instanceof com.android.build.gradle.AppExtension) {
|
||||||
|
applicationVariants.all { variant ->
|
||||||
|
def outputFolder = new File("build/generated/ksp/${variant.name}/kotlin")
|
||||||
|
variant.addJavaSourceFoldersToModel(outputFolder)
|
||||||
|
android.sourceSets.getAt(variant.name).java {
|
||||||
|
srcDir(outputFolder)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user