calidion
01/29/2025, 8:08 AMMichael Paus
01/29/2025, 8:44 AMMikolaj
01/29/2025, 8:54 AMcalidion
01/29/2025, 11:11 AMcalidion
01/29/2025, 11:14 AMcalidion
01/29/2025, 11:14 AMMikolaj
01/29/2025, 11:14 AMMikolaj
01/29/2025, 11:15 AMcalidion
01/29/2025, 11:19 AMMikolaj
01/29/2025, 11:22 AMbuild.grade
(like androidTarget() and such). Declaring them creates the sourcesets
bu you do not have to keep the directories for the sourcesets if they are empty (ergo all your code resides in commonMain
). As for platform dependent packages, if You moved your code to commonMain
and it does not compile (depends on some platform specific stuff) you have two options
1. Write expect/actual classes and provide implementation on each supported platform
2. Write your own implementation in commonMainMikolaj
01/29/2025, 11:23 AMcommonMain
sourceset as the wrapper/umbrella module for all the targets that your library support. It should contain the code that is common for all platforms.Mikolaj
01/29/2025, 11:31 AMcalidion
01/29/2025, 11:39 AMMikolaj
01/29/2025, 11:42 AMcalidion
01/29/2025, 11:50 AMcalidion
01/29/2025, 11:52 AMMikolaj
01/29/2025, 11:54 AMcalidion
01/29/2025, 11:55 AMMikolaj
01/29/2025, 11:55 AMI am currently developing a library, but I don't know if libraries I included are Platform independent.You can just put your code in commonMain and if it lights up red then it is not platform independent 😇
calidion
01/29/2025, 11:56 AM