Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion skipstone/Sources/SkipBuild/Commands/ExportCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,12 @@ Build and export the Skip modules defined in the Package.swift, with libraries e
let aarOutputFolder = !nested ? outputFolderAbsolute : outputFolderAbsolute.appending(components: [variant.rawValue, "aar"])
try fs.createDirectory(aarOutputFolder, recursive: true)

let depModuleNames = try fs.getDirectoryContents(skipOutputFolder).sorted()
// export only the module and the project modules on its runtime classpath, so test-only
// modules (wired as testImplementation/androidTestImplementation) are not bundled
let runtimeDeps = try await run(with: out, "Resolve runtime modules for \(moduleName)", ["gradle", "-q", ":\(moduleName):dependencies", "--configuration", "\(variant.rawValue)RuntimeClasspath"] + gradleArgs, environment: env).get()
let runtimeModuleNames = Set([moduleName] + runtimeDeps.stdout.matches(of: try Regex(#"project '?:([^'\s]+)"#)).compactMap { $0[1].substring.map(String.init) })

let depModuleNames = try fs.getDirectoryContents(skipOutputFolder).sorted().filter(runtimeModuleNames.contains)
for depModuleName in depModuleNames {
let aarBuildOutputFolder = skipOutputFolder.appending(components: [depModuleName, "build", "outputs", "aar"])
if !fs.isDirectory(aarBuildOutputFolder) {
Expand Down
Loading