Rugby icon indicating copy to clipboard operation
Rugby copied to clipboard

๐Ÿ”ญ Force exclude a dependency from a plan

Open nonameplum opened this issue 2 years ago โ€ข 5 comments

Is your feature request related to a problem? Please describe.

I would like to have the ability to force exclude a specific dependency even though it is included in the plan by

- build
  - command: cache
    include: [Alamofire, SnapKit]

Describe the solution you'd like

ยง rugby --plan build --exclude Alamofire SnapKit
ยง rugby --plan build -e Alamofire SnapKit

nonameplum avatar Dec 30 '21 18:12 nonameplum

@nonameplum Hello! Now you can add exclude to the plan. Like this:

- build
  - command: cache
    include: [Alamofire, SnapKit]
    exclude: [SomePod]

In this solution, there is a problem. Your plan can contain many different commands and also, some of them can be duplicated (like drop command). So, it's not easy to add a common interface for different user plans. And it's not clear how to manage additional flags if command duplicates.

rugby --plan build --exclude Alamofire SnapKit
rugby --plan build -e Alamofire SnapKit

swiftyfinch avatar Dec 30 '21 19:12 swiftyfinch

But anyway, thank you for your request, and feel free to add some more info or implement a draft.

swiftyfinch avatar Dec 30 '21 19:12 swiftyfinch

Feel free to reopen the issue if you have more information

swiftyfinch avatar Feb 02 '22 18:02 swiftyfinch

Yes, I get your point. What if we could do something like:

rugby --plan build --force build.drop.exclude+=[SnapKit]

The idea would be to specify which dependent command we would like to affect.

The main reason why I bring this up is that I have a few plans with very useful reusable commands that I use a lot. So far so good, but the problem is that one of them catches the dependencies that I want including my development frameworks (pods). Currently, every time I work on a thing that requires changing something on one of my frameworks, it forces me to edit the plans.yml file. I need to exclude them from caching because it is much easier to work with as I can edit the files easily both in the main app and the frameworks that I want at the time.

nonameplum avatar Mar 02 '22 11:03 nonameplum

Yeah, I see. Thank you for your answer.

But we can't limit the plan with only one drop command. Someone already can use several drop commands in one plan. So we need a more general solution. The same with other different fields of each command of Rugby. There can be corner cases. But I think I understand your idea.

Right now It looks like a complex feature request for me. So, let's reopen it, but sorry I don't have enough free time to implement any request for now.

Also, maybe you can find these features useful for your needs:

  • You can read all code with such option: https://github.com/swiftyfinch/Rugby/blob/main/Docs/Cache.md#keep-pods-group-in-project
  • Here you can create a base plan and reuse it in your other plans: https://github.com/swiftyfinch/Rugby/blob/main/Docs/Plans.md#-generate-example

swiftyfinch avatar Mar 02 '22 16:03 swiftyfinch