Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
DatL4g committed Dec 8, 2024
1 parent dbf2a60 commit ed2f9c4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import java.io.Serializable as JvmSerializable

@Serializable
@GradleSerializable
sealed class Target(open val name: String, open val sourceSet: String = name) : JvmSerializable, Named {
sealed class Target(open val title: String, open val sourceSet: String = title) : JvmSerializable, Named {

override fun getName(): String = name
override fun getName(): String = title

@GradleSerializable
sealed class Android(
override val name: String,
override val sourceSet: String = name
) : Target(name, sourceSet), JvmSerializable, Named {
override val title: String,
override val sourceSet: String = title
) : Target(title, sourceSet), JvmSerializable, Named {

@GradleSerializable
object NATIVE_32 : Android("androidNativeX86"), JvmSerializable, Named {
Expand Down Expand Up @@ -54,11 +54,11 @@ sealed class Target(open val name: String, open val sourceSet: String = name) :

@GradleSerializable
sealed class Desktop(
override val name: String
) : Target(name), JvmSerializable, Named {
override val title: String
) : Target(title), JvmSerializable, Named {

@GradleSerializable
sealed class Linux(override val name: String) : Desktop(name), JvmSerializable, Named {
sealed class Linux(override val title: String) : Desktop(title), JvmSerializable, Named {

@GradleSerializable
object NATIVE_64 : Linux("linuxX64"), JvmSerializable, Named {
Expand All @@ -72,7 +72,7 @@ sealed class Target(open val name: String, open val sourceSet: String = name) :
}

@GradleSerializable
sealed class Mac(override val name: String) : Desktop(name), Apple, JvmSerializable, Named {
sealed class Mac(override val title: String) : Desktop(title), Apple, JvmSerializable, Named {

@GradleSerializable
object NATIVE_64 : Mac("macosX64"), JvmSerializable, Named {
Expand All @@ -95,7 +95,7 @@ sealed class Target(open val name: String, open val sourceSet: String = name) :
}

@GradleSerializable
sealed class JS(override val name: String) : Target(name), JvmSerializable, Named {
sealed class JS(override val title: String) : Target(title), JvmSerializable, Named {

@GradleSerializable
object Default : JS("js"), JvmSerializable, Named
Expand All @@ -108,7 +108,7 @@ sealed class Target(open val name: String, open val sourceSet: String = name) :
}

@GradleSerializable
sealed class IOS(override val name: String) : Target(name), Apple, JvmSerializable, Named {
sealed class IOS(override val title: String) : Target(title), Apple, JvmSerializable, Named {

@GradleSerializable
object NATIVE_64 : IOS("iosX64"), JvmSerializable, Named {
Expand All @@ -127,7 +127,7 @@ sealed class Target(open val name: String, open val sourceSet: String = name) :
}

@GradleSerializable
sealed class TVOS(override val name: String) : Target(name), Apple, JvmSerializable, Named {
sealed class TVOS(override val title: String) : Target(title), Apple, JvmSerializable, Named {

@GradleSerializable
object NATIVE_64 : TVOS("tvosX64"), JvmSerializable, Named {
Expand All @@ -146,7 +146,7 @@ sealed class Target(open val name: String, open val sourceSet: String = name) :
}

@GradleSerializable
sealed class WATCHOS(override val name: String) : Target(name), Apple, JvmSerializable, Named {
sealed class WATCHOS(override val title: String) : Target(title), Apple, JvmSerializable, Named {

@GradleSerializable
object NATIVE_64 : WATCHOS("watchosX64"), JvmSerializable, Named {
Expand Down Expand Up @@ -212,7 +212,7 @@ sealed class Target(open val name: String, open val sourceSet: String = name) :
get() = this is WATCHOS

fun matchesName(name: String): Boolean {
return this.name.equals(name, true) || this.sourceSet.equals(name, true)
return this.title.equals(name, true) || this.sourceSet.equals(name, true)
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ object BuildFileGenerator {

sourceSets.forEach { target ->
spec = if (target.isNative) {
spec.beginControlFlow(target.name)
spec.beginControlFlow(target.title)
.beginControlFlow("binaries")
.addStatement("sharedLib()")
.endControlFlow()
.endControlFlow()
} else {
if (target is Target.JS.Default) {
spec.addStatement("${target.name}(IR)")
spec.addStatement("${target.title}(IR)")
} else {
spec.addStatement("${target.name}()")
spec.addStatement("${target.title}()")
}
}
}
Expand Down

0 comments on commit ed2f9c4

Please sign in to comment.