yonaskolb / yonaskolb/XcodeGen

Create interactive specs

Open
#273 13 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Swift
Stars
8.8k
Forks
908
Avg merge
17d 14h
Merged PRs (30d)
2

Description

One use case I would have for XcodeGen would be to generate brand new projects when starting a new contract.

(For now we use liftoff for that but as it's not maintained anymore, we want to migrate to something else like XcodeGen)

The idea would be to create a project.yml with a magic syntax for values which, when encountered, would (1) interactively ask for the value to give to that setting (2) or allow for it to be specified via command line parameters (3) and once the project has been generated once, replace the values in the project.yml with the new ones

So, for example we could have a template.yml file like this:

name: "?name|App Name"
options: 
  createIntermediateGroups: true
  bundleIdPrefix: "?id|Bundle ID prefix"
  developmentLanguage: "en"
  usesTabs: false
  indentWidth: 2
  tabWidth: 2
  deploymentTarget:
    watchOS: "2.0"
    tvOS: "10.0"
    iOS: "?ios|Deployment Target|9.0"
settings:
    GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED: YES
    GCC_WARN_MISSING_PARENTHESES: YES
    GCC_WARN_ABOUT_RETURN_TYPE: YES
    GCC_WARN_CHECK_SWITCH_STATEMENTS: YES
    GCC_WARN_UNUSED_FUNCTION: YES
    GCC_WARN_UNUSED_LABEL: YES

targets:
  "?name":
    type: application
    
  UnitTests:
    type: bundle.unit-test

And then we could run the command, where we can provide values for all "?…" magic values, either using arguments via the command lines (using the parameter name provided next to the "?") or/and be interactively queried for others (using the second parameter provided after the "?…|" for the prompt, and the optional third part for the default value):

$ xcodegen --template="template.yml" --name=Foo
Bundle ID Prefix: com.mycompany
Deployment Target [9.0]: 9.3
> Generating project.yml from template.yml and the provided values…
> Generating Xcodeproj…

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No implementation files, tests, or entry points are named in the issue. Start by tracing XcodeGen’s existing command-line and YAML specification handling; done would mean supporting interactive and argument-provided template values and generating the requested project reliably.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift, yaml
Domain
build-system, cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.