diff --git a/skipstone/Sources/SkipBuild/Commands/SkipstoneCommand.swift b/skipstone/Sources/SkipBuild/Commands/SkipstoneCommand.swift index 5fbdb63a..4d6e370b 100644 --- a/skipstone/Sources/SkipBuild/Commands/SkipstoneCommand.swift +++ b/skipstone/Sources/SkipBuild/Commands/SkipstoneCommand.swift @@ -951,6 +951,12 @@ struct SkipstoneCommand: BuildPluginOptionsCommand, StreamingCommand { .init("testImplementation(project(\":\(moduleName)\"))"), .init("androidTestImplementation(project(\":\(moduleName)\"))") ] + if configMap[moduleName]?.skip?.testFixtures == true { + moduleDependencyBlocks += [ + .init("testImplementation(testFixtures(project(\":\(moduleName)\")))"), + .init("androidTestImplementation(testFixtures(project(\":\(moduleName)\")))") + ] + } } else { moduleDependencyBlocks += [ .init("api(project(\":\(moduleName)\"))"), @@ -1049,7 +1055,13 @@ struct SkipstoneCommand: BuildPluginOptionsCommand, StreamingCommand { if fs.isDirectory(sourcePath) { // make recursive folders for sub-linked resources - let subPaths = try linkSkipFolder(sourcePath, to: outputPath, topLevel: false) + let destination: AbsolutePath + if topLevel, fileName == "testFixtures", baseSkipConfig.skip?.testFixtures == true { + destination = try AbsolutePath(outputFolderPath, validating: "../testFixtures/kotlin") + } else { + destination = outputPath + } + let subPaths = try linkSkipFolder(sourcePath, to: destination, topLevel: false) copiedFiles.formUnion(subPaths) } else { if let outputFilePath = try sourceFileOutputPath(for: sourcePath.basename, in: topLevel ? nil : outputFilePath) { diff --git a/skipstone/Sources/SkipBuild/SkipConfig.swift b/skipstone/Sources/SkipBuild/SkipConfig.swift index 856f8470..d9d977e7 100644 --- a/skipstone/Sources/SkipBuild/SkipConfig.swift +++ b/skipstone/Sources/SkipBuild/SkipConfig.swift @@ -22,6 +22,8 @@ struct SkipConfig : Codable { struct TranspilationConfig : Codable { /// The name of the package this module should be set to var package: String? + /// Publish shared test support from the Skip/testFixtures directory. + var testFixtures: Bool? /// Skip mode: `native|transpiled` var mode: String? /// Whether/how to bridge this module