Context: SkipFuse app, native mode with bridging. We keep mock factories for SwiftUI/Compose previews in shared Swift behind conditional compilation. On iOS, #if DEBUG strips them from release builds. On Android there is no equivalent: the bridge generator evaluates #if DEBUG as false in every configuration, including skip export --debug.
Repro: given a bridged entity with a debug-only mock factory:
// Sources/AppData/EEvent.swift
// SKIP @bridge
public struct EEvent {
public let id: String
public let title: String
}
#if DEBUG
// SKIP @bridge
extension EEvent {
public static func mock(id: String = "mock_id") -> EEvent {
EEvent(id: id, title: "Mock event")
}
}
#endif
the generated Kotlin facade omits the extension even in a debug export — the output under .build/plugins/outputs/.../skipstone/.../EEvent.kt contains the EEvent bridge but no mock(), so this Compose preview fails with Unresolved reference 'mock':
@Preview
@Composable
fun EventCellPreview() {
CUIEventCell(event = EEvent.mock()) // e: Unresolved reference 'mock'
}
which works, but means every mock factory — implementations, fake-data string literals, and their Kotlin bridge classes — ships in release Android builds. R8 can strip the unreferenced bridge classes from the DEX, but the native implementations and strings still ship in the production .so. On iOS the same code is correctly stripped from release, so the two platforms can't be given parity here.
Request: a way for skip export --release to exclude blocks from bridge generation and native compilation that --debug includes. Either honoring DEBUG to match SwiftPM's debug-configuration behavior
Context: SkipFuse app, native mode with bridging. We keep mock factories for SwiftUI/Compose previews in shared Swift behind conditional compilation. On iOS,
#if DEBUGstrips them from release builds. On Android there is no equivalent: the bridge generator evaluates#if DEBUGas false in every configuration, includingskip export --debug.Repro: given a bridged entity with a debug-only mock factory:
the generated Kotlin facade omits the extension even in a debug export — the output under
.build/plugins/outputs/.../skipstone/.../EEvent.ktcontains theEEventbridge but nomock(), so this Compose preview fails withUnresolved reference 'mock':which works, but means every mock factory — implementations, fake-data string literals, and their Kotlin bridge classes — ships in release Android builds. R8 can strip the unreferenced bridge classes from the DEX, but the native implementations and strings still ship in the production
.so. On iOS the same code is correctly stripped from release, so the two platforms can't be given parity here.Request: a way for
skip export --releaseto exclude blocks from bridge generation and native compilation that--debugincludes. Either honoringDEBUGto match SwiftPM's debug-configuration behavior