Skip to content

Commit 1edb800

Browse files
committed
Use the target instead of the product to infer the jextract output path
The plugin runs on a target and the output path is according to the target name. However currently jextract emits the LIB_NAME assuming it will match the target name, which is not necessaraly true, so changing the target name still produces a runtime failure.
1 parent 28de286 commit 1edb800

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

BuildLogic/src/main/kotlin/utilities/SwiftPMTarget.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import kotlinx.serialization.Serializable
1919

2020
@Serializable
2121
internal data class SwiftPMTarget(
22+
val name: String,
2223
@SerialName("product_dependencies")
2324
val productDependencies: List<String> = emptyList(),
2425
@SerialName("product_memberships")

BuildLogic/src/main/kotlin/utilities/registerJextractTask.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import java.nio.file.Files
2323

2424
private fun Project.swiftProductsWithJExtractPlugin(): List<String> = swiftPMPackage().targets.filter {
2525
it.productDependencies.contains("JExtractSwiftPlugin")
26-
}.flatMap {
27-
it.productMemberships
26+
}.map {
27+
it.name
2828
}
2929

3030
private fun Project.registerSwiftCheckValidTask(): TaskProvider<*> = tasks.register<Exec>("swift-check-valid") {

0 commit comments

Comments
 (0)