Skip to content

Commit

Permalink
fix(stremio-core-protobuf):source dir syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBeastLT committed Oct 24, 2024
1 parent 711ba89 commit 5eda198
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import com.android.build.api.dsl.AndroidSourceSet
import com.google.protobuf.gradle.*
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

Expand Down Expand Up @@ -46,6 +47,14 @@ buildscript {
}
}

fun AndroidSourceSet.proto(action: SourceDirectorySet.() -> Unit) {
(this as? ExtensionAware)
?.extensions
?.getByName("proto")
?.let { it as? SourceDirectorySet }
?.apply(action)
}

kotlin {
android {
// TODO: Adding a "debug" variant here results in failing imports in KMM projects. Figure out why.
Expand All @@ -54,13 +63,6 @@ kotlin {

@Suppress("UNUSED_VARIABLE")
sourceSets {
main {
proto {
// In addition to the default 'src/main/proto' which we don't use
// we add the proto files from stremio-core-protobuf
srcDir 'stremio-core-protobuf/proto'
}
}
val commonMain by getting {
dependencies {
implementation("pro.streem.pbandk:pbandk-runtime:${pbandkVersion}")
Expand All @@ -85,6 +87,9 @@ android {

sourceSets {
getByName("main") {
proto {
srcDirs("stremio-core-protobuf/proto")
}
manifest.srcFile("src/androidMain/AndroidManifest.xml")
}
}
Expand Down

0 comments on commit 5eda198

Please sign in to comment.