Skip to content

Commit

Permalink
Fix room ksp warning
Browse files Browse the repository at this point in the history
+ Delete StubModulePlugin
  • Loading branch information
massivemadness committed Nov 19, 2023
1 parent 8c93ecc commit 9ce2f5e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 19 deletions.
4 changes: 0 additions & 4 deletions build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,5 @@ gradlePlugin {
id = "com.blacksquircle.publish"
implementationClass = "com.blacksquircle.ui.PublishModulePlugin"
}
register("com.blacksquircle.stub") {
id = "com.blacksquircle.stub"
implementationClass = "com.blacksquircle.ui.StubModulePlugin"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,19 @@

package com.blacksquircle.ui

import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.tasks.InputDirectory
import org.gradle.api.tasks.PathSensitive
import org.gradle.api.tasks.PathSensitivity
import org.gradle.process.CommandLineArgumentProvider
import java.io.File

class StubModulePlugin : Plugin<Project> {
override fun apply(target: Project) = Unit
class RoomSchemaArgProvider(
@get:InputDirectory
@get:PathSensitive(PathSensitivity.RELATIVE)
val schemaDir: File
) : CommandLineArgumentProvider {

override fun asArguments(): Iterable<String> {
return listOf("room.schemaLocation=${schemaDir.path}")
}
}
15 changes: 6 additions & 9 deletions common-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,15 @@
* limitations under the License.
*/

import com.blacksquircle.ui.RoomSchemaArgProvider

plugins {
id("com.blacksquircle.common")
}

android {
namespace = "com.blacksquircle.ui.core"

defaultConfig {
javaCompileOptions {
annotationProcessorOptions {
argument("room.schemaLocation", "$projectDir/schemas")
argument("room.incremental", "true")
argument("room.expandProjection", "true")
}
}
}
sourceSets {
named("androidTest") {
assets.srcDir(files("$projectDir/schemas"))
Expand All @@ -40,6 +33,10 @@ android {
}
}

ksp {
arg(RoomSchemaArgProvider(File(projectDir, "schemas")))
}

dependencies {

// Core
Expand Down
3 changes: 1 addition & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ android.useAndroidX=true
android.enableJetifier=false
android.nonTransitiveRClass=true

kotlin.code.style=official
kapt.incremental.apt=true
kotlin.code.style=official

0 comments on commit 9ce2f5e

Please sign in to comment.