Brisk icon indicating copy to clipboard operation
Brisk copied to clipboard

Use a formal Swift Package Manager library format

Open maxbritto opened this issue 4 years ago • 6 comments

By using the official SPM format we can embed Brisk in any new project without having to install Brisk locally (or a Brisk command line tool). Also this allows the user to have access to the library without putting Brisk code inside his own project. If you accept this proposal, we would gain :

  • an easier installation (it's like any other Swift dependency)
  • a cleaner separation of the user script code with the Brisk code
  • compliance to the official format Let me know what you think :)

maxbritto avatar Jun 11 '20 08:06 maxbritto

Hello! While I'm open to the idea of finding ways to integrate Brisk into an existing project, I don't think this change goes in the right direction – I feel like it kind of misses why I created Brisk in the first place. It was designed for "I want to write a script in Swift", not "I want to add its functionality to an existing project."

Generally speaking, if something is important enough for someone to create a new project they might want to consider skipping Brisk entirely and using all the built-in safety of Swift.

twostraws avatar Jun 11 '20 09:06 twostraws

Hi, thanks for your quick answer. I am not trying to integrate Brisk into existing projects, my main goal is to avoid having Brisk code hard-copied inside each project. This leads to many issues when using Brisk in multiple projects (updating, project specific changes, etc.). Since SPM already has a dependency system, using Brisk as a library fixes all those issues.

The current implementation already creates a new project, it is a pre-created project, stored in the repository, that is copied to a different location by changing the folder name.

If you prefer, I could update brisk.sh so that it is still useful by making it create the blank project, add the library and open XCode. Would that be an acceptable solution ?

maxbritto avatar Jun 11 '20 13:06 maxbritto

I'm happy to find a way to make Brisk integrate into SPM, but it is paramount that it retains its existing functionality of creating copies of its as a new project – it removes the SPM step entirely for me.

twostraws avatar Jun 14 '20 11:06 twostraws

ok, if hard copying the sources in every new project is essential to you then I agree with you : there is no way/need to make Brisk compliant with SPM :( Feel free to close the PR.

maxbritto avatar Jun 14 '20 17:06 maxbritto

If there's a way to get both behaviors – to retain this as a standalone scripting system while also allowing folks to use SPM at the same time – I'd be happy to adopt it.

twostraws avatar Jul 02 '20 13:07 twostraws

What if we'd use SPM but with a local copy of the package instead of downloading it from GitHub for every project ? I am not sure to know what is the part you want to keep : 1- being able to create a new project without an Internet access or 2- hard copying the brisk files into each project as if they were form the project itself

?

maxbritto avatar Jul 09 '20 08:07 maxbritto