Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to control scheme generation modes #458

Closed
kwridan opened this issue Jul 23, 2019 · 6 comments
Closed

Add ability to control scheme generation modes #458

kwridan opened this issue Jul 23, 2019 · 6 comments
Labels
type:enhancement New feature or request

Comments

@kwridan
Copy link
Collaborator

kwridan commented Jul 23, 2019

Need/problem

In a large project, generating the entire workspace can yield several schemes, one for each target. Often times projects contain one primary target and a few supporting targets such as a test targets.

Tuist has the ability to generate custom schemes which allows developers to specify a scheme to group all targets, however currently this is additive (i.e. Tuist default scheme per target + custom schemes).

To reduce the noise this may generate it would be great to have a mechanism to control the behavior of those default schemes.

Ideas

Changing schemes type

let project = Project(name: "App"
                      targets: [ 
                        // ...
                      ]
                      schemes: .defaults)

let project = Project(name: "App"
                      targets: [ 
                        // ...
                      ]
                      schemes: .defaults(with: [schemeA, schemeB]))

let project = Project(name: "App"
                      targets: [ 
                        // ...
                      ]
                      schemes: .custom([schemeA, schemeB]))

// Possibly restore the project scheme from #55 
// That includes all targets in one scheme
let project = Project(name: "App"
                      targets: [ 
                        // ...
                      ]
                      schemes: .combinedScheme)

Adding a separate configuration option

let config = TuistConfig(generationOptions: .options(
    schemes: .defaultsWithCustom // there must be a better name for this one :p 
))

let config = TuistConfig(generationOptions: .options(
    schemes: .customOnly
))

let config = TuistConfig(generationOptions: .options(
    schemes: .none
))

// Possibly this option, though if a project manifest specifies schemes 
// should this be additive? or instead of?
let config = TuistConfig(generationOptions: .options(
    schemes: .combined
))

Still needs some more thought on how how best to achieve this and which options are most useful.

Alternatives

Manually specify each of the target un-desired schemes, mark them as non-shared and add xcuserdata to .gitignore

e.g.

let testScheme = Scheme(name: "AppTests", shared: false)

Sadly those schemes will still be visible in Xcode

Previous use cases

@kwridan kwridan added the type:enhancement New feature or request label Jul 23, 2019
@pepicrft
Copy link
Contributor

What about something along the lines of:

let config = TuistConfig(generationOptions: [
  .schemes([
    .all: .none,
    .project("FrameworkX"): .custom,
    .project("MyApp"): .custom
  ])
])

That way the schemes generation could be configured in a per-project basis. I think the type that we create to indicate which projects configuration applies can be reused by other configuration options:

enum TuistConfigurationProject: Hashable {
  case all
  case project(String)
}

@pepicrft pepicrft added this to the 0.17.0 milestone Aug 3, 2019
@sgrgrsn
Copy link
Collaborator

sgrgrsn commented Aug 6, 2019

Would be really nice to get something like this! I don't really have an opinion about how it should be specified, but I think it would be nice if Tuist will create a combined scheme for frameworks, so we don't have a FrameworkScheme and FrameworkTestsScheme for each and every framework in the workspace.

@kwridan kwridan modified the milestones: 0.17.0, 0.18 Aug 21, 2019
@pepicrft pepicrft added this to To do in Next version Oct 10, 2019
@kwridan kwridan added this to To do in 1.0.0 Oct 12, 2019
@sgrgrsn
Copy link
Collaborator

sgrgrsn commented Nov 28, 2019

I would like to contribute on this one, but I have only been playing around with Tuist for now. Do you have any suggestion on how I could get started contributing to this feature?

@kwridan
Copy link
Collaborator Author

kwridan commented Nov 29, 2019

Hi @sgrgrsn!

I'm glad to hear you're interested in contributing to Tuist!

@pepibumur has put together a fantastic contributors guide to help them get started which you can find on https://docs.tuist.io/contribution-tuist

Once you've got Tuist up and running locally you can have browse through the source code. There have been a few PRs to update schemes recently, those should help show cases the components that would need modifications to support such feature:

The primary component is the SchemeGenerator and the associated model & manifest types.

Feel free to ask questions either here or on Slack (https://slack.tuist.io).

@sgrgrsn
Copy link
Collaborator

sgrgrsn commented Nov 29, 2019

Thanks - I'll have a look at it as soon as possible 👍

@pepicrft pepicrft removed this from the 0.18.0 milestone Dec 28, 2019
@kwridan kwridan added the schemes label Feb 3, 2021
@danieleformichelli
Copy link
Collaborator

Implemented in 3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement New feature or request
Projects
No open projects
1.0.0
  
To do
Next version
  
To do
Development

No branches or pull requests

4 participants