Automate creation of dependent library in swift module

Hi.. i am creating a swift module/package . my swift module/package is dependent on some github repo code .for using my library first , i have to clone dependent git repo and then create a .dylib file of the dependent repo and paste it at desired location within module.
For example :
Swift package (World) -> Dependent (Hello - .dylib)

For cloning repo , creating .dylib and pasting .dylib at desired location i have created a Make . Make file creates and paste .dylib at desired location within swift module but issue is that user have to run it manually after adding swift package(World) to project in Xcode .

Question :
Is there any way i can automate creation of .dylib file when module gets downloaded from GitHub using Xcode ?
for example npm modules have package.json file have option to run preinstall , install and post script .use these script we can automate creation of some task . i am looking for similar solution if possible .

Can the dependency be built with SwiftPM by adding a manifest and declaring its product .dynamic? Then you could make the dependency on it explicit in your manifest and everything would just work.

Otherwise you’ll have to wait for binary dependencies or extensible build tools.

1 Like
Terms of Service

Privacy Policy

Cookie Policy