Paul Woitaschek
09/01/2022, 7:51 AMPiotr Romanowicz
09/01/2022, 8:18 AMPaul Woitaschek
09/01/2022, 8:41 AMhfhbd
09/01/2022, 8:45 AMPaul Woitaschek
09/01/2022, 8:56 AMhfhbd
09/01/2022, 9:08 AMPaul Woitaschek
09/01/2022, 11:38 AMThomas
09/01/2022, 12:00 PMPaul Woitaschek
09/01/2022, 12:00 PMThomas
09/01/2022, 12:00 PMThomas
09/01/2022, 12:01 PMPaul Woitaschek
09/01/2022, 12:01 PMThomas
09/01/2022, 12:02 PMThomas
09/01/2022, 12:02 PMClang might fail to compile files bigger than 16Mb (that’s Mach-O format limitation). By passinginstead of-Os
we force Clang to generate smaller code which should help in some cases.-O0
hfhbd
09/01/2022, 12:03 PMThomas
09/01/2022, 12:03 PMPaul Woitaschek
09/01/2022, 12:07 PMhfhbd
09/01/2022, 12:07 PMPaul Woitaschek
09/01/2022, 12:08 PMThomas
09/01/2022, 12:08 PMPaul Woitaschek
09/01/2022, 12:08 PMhfhbd
09/01/2022, 12:09 PMPaul Woitaschek
09/01/2022, 12:09 PMPaul Woitaschek
09/01/2022, 12:09 PM//see: <https://developer.apple.com/forums/thread/666335>
private fun Project.registerAssembleFatForXCFrameworkTask(
xcFrameworkName: String,
buildType: NativeBuildType,
appleTarget: AppleTarget
): TaskProvider<FatFrameworkTask> {
val taskName = lowerCamelCaseName(
"assemble",
buildType.getName(),
appleTarget.targetName,
"FatFrameworkFor",
xcFrameworkName,
"XCFramework"
)
return registerTask(taskName) { task ->
task.destinationDir = XCFrameworkTask.fatFrameworkDir(project, xcFrameworkName, buildType, appleTarget)
task.onlyIf {
task.frameworks.size > 1
}
}
}
hfhbd
09/01/2022, 12:26 PMPaul Woitaschek
09/01/2022, 12:27 PMkpgalligan
09/01/2022, 1:50 PMPaul Woitaschek
09/01/2022, 1:51 PMhfhbd
09/01/2022, 1:57 PMhfhbd
09/01/2022, 3:02 PM./gradlew clean assembleXCFramework
=> ios is always about 9,6 MB, enabling watchos target does not matter.
=> watchos is almost +50% in size, for unknown reasons
=> isStatic results into a huge size
Link to branch: https://github.com/hfhbd/ComposeTodo/compare/main...watchoshfhbd
09/01/2022, 3:04 PMPaul Woitaschek
09/01/2022, 3:09 PMhfhbd
09/01/2022, 3:11 PMPaul Woitaschek
09/01/2022, 3:12 PMSeb Jachec
09/01/2022, 3:12 PMsergey.bogolepov
09/01/2022, 4:45 PM• Move everything into a single gradle module and make everything internal that’s possibleMaybe split your logic into modules instead and use only relevant modules on the watchOS app?
hfhbd
09/01/2022, 4:58 PMPaul Woitaschek
09/01/2022, 5:06 PMhfhbd
09/01/2022, 5:10 PMPaul Woitaschek
09/01/2022, 5:11 PMhfhbd
09/01/2022, 5:13 PMsergey.bogolepov
09/01/2022, 5:23 PMit also needs a proper arm64 watchos target?Why?
the watch and App can’t have a shared layerWhy? Take one set of modules, compile it into watchOS framework. Take its superset, compile in for iOS.
hfhbd
09/01/2022, 5:24 PMsergey.bogolepov
09/01/2022, 5:27 PMPaul Woitaschek
09/01/2022, 5:28 PMPaul Woitaschek
09/01/2022, 5:29 PMhfhbd
09/01/2022, 5:30 PMsergey.bogolepov
09/01/2022, 5:45 PMIf we now have two frameworks - iOS and watch, there can’t be a shared layer no more.I have a feeling that it still should be possible in some form, but need to check first. Anyway, thanks! A proper solution would require multiple namespaces in the generated frameworks, so you could have
shared.h
and ios_specific.h
. Good news: we are working on it. Bad news: the feature is big and amount of pitfalls is enormous 🙃hfhbd
09/01/2022, 6:41 PMPaul Woitaschek
11/08/2022, 3:12 PMhfhbd
11/08/2022, 3:16 PMThomas
11/08/2022, 3:18 PMThomas
11/08/2022, 3:18 PMThomas
11/08/2022, 3:19 PMkpgalligan
11/08/2022, 3:32 PMThomas
11/08/2022, 3:35 PMThomas
11/08/2022, 3:37 PM