xxfast
12/22/2022, 1:57 AM:app
⎿:feature-1
⎿:feature-2
:app
is the only module I'm depending on from iOS, but I am exporting my feature modules. I can export sealed types from :app
just fine
sealed class AppSealedType {
object AppTypeA: AppSealedType()
object AppTypeB: AppSealedType()
}
And they do show up on the swift side. However, when I define a seal type on one of the :feature-x
modules
sealed class FeatureSealedType {
object FeatureTypeA: AppSealedType()
object FeatureTypeB: AppSealedType()
}
Only the top seal interface is exported. I can trick the tooling to "force" export the sealed child types by referencing them in the iosMain
of the :app
as a workaround
val FeatureTypeA = FeatureSealedType.FeatureTypeA
When I do that, the child types are exported
Is this a known bug/limitation? Is there a way export all child types of my sealed types? More details in the 🧵xxfast
12/22/2022, 1:59 AM:app
is the only module I'm depending on from iOS, but I am exporting my feature modules
iosMain {
binaries {
framework {
baseName = "App"
export(project(":feature-1"))
export(project(":feature-2"))
}
}
}
I can export sealed types from :app
just fine
sealed class AppSealedType {
object AppTypeA: AppSealedType()
object AppTypeB: AppSealedType()
}
And they do show up on the swift side
__attribute__((swift_name("AppSealedType")))
@interface AppSealedType : AppBase
@end
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("AppSealedType.AppTypeA")))
@interface AppSealedTypeAppTypeA : AppSealedType
..
@property (class, readonly, getter=shared) AppSealedTypeAppTypeA *shared __attribute__((swift_name("shared")));
@end
However, when I define a seal type on one of the :feature-x
modules
sealed class FeatureSealedType {
object FeatureTypeA: AppSealedType()
object FeatureTypeB: AppSealedType()
}
Only the top seal interface is exported
__attribute__((swift_name("FeatureSealedType")))
@interface FeatureSealedType : PSCBase
@end
I can trick the tooling to "force" export the sealed child types by referencing them in the iosMain
of the :app
as a workaround
val FeatureTypeA = FeatureSealedType.FeatureTypeA
When I do that, the child types are exported
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("FeatureSealedType.FeatureTypeA")))
@interface FeatureSealedTypeFeatureTypeA : FeatureSealedType
@property (class, readonly, getter=shared) FeatureSealedTypeFeatureTypeA *shared __attribute__((swift_name("shared")));
@end
Vitor Hugo Schwaab
12/22/2022, 9:36 AMapi(project(":feature-1"))
instead of implementation(project(":feature-1"))
and drop the export
?Corey
12/22/2022, 12:04 PMexport
should be there, tho you're right if they change it from implementation
to api
it should work. Fixed a similar issue doing this.ayodele
12/22/2022, 6:07 PMdata
module depends on the domain
but none of them was exported.xxfast
12/22/2022, 11:13 PMimplementation
to api
like
sourceSets {
val commonMain by getting {
dependencies {
api(project(":feature-1"))
api(project(":feature-2"))
}
}
}
But I do still run into the same issue 🤔xxfast
12/22/2022, 11:13 PM