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 support for generating variant groups without Base.lproj #157

Merged
merged 4 commits into from
Nov 15, 2017

Conversation

ryohey
Copy link
Collaborator

@ryohey ryohey commented Nov 15, 2017

  • fix reading developmentLanguage from yaml
  • use developmentLanguage to generate variant groups
    • find Base Language lproj directory in these order. Base -> developmentLanguage -> en
  • add languages found in getGroupSources() to knownRegions

fixes #143

Copy link
Owner

@yonaskolb yonaskolb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, nice one @ryohey! Looks good, just some minor comments

@@ -168,5 +170,6 @@ extension ProjectSpec.Options: JSONObjectConvertible {
bundleIdPrefix = jsonDictionary.json(atKeyPath: "bundleIdPrefix")
settingPresets = jsonDictionary.json(atKeyPath: "settingPresets") ?? .all
createIntermediateGroups = jsonDictionary.json(atKeyPath: "createIntermediateGroups") ?? false
developmentLanguage = jsonDictionary.json(atKeyPath: "developmentLanguage")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙈

let projectAttributes: [String: Any] = ["LastUpgradeCheck": currentXcodeVersion].merged(spec.attributes)
let root = PBXProject(name: spec.name,
reference: proj.rootObject,
buildConfigurationList: buildConfigList.reference,
compatibilityVersion: "Xcode 3.2",
mainGroup: mainGroup.reference,
developmentRegion: spec.options.developmentLanguage ?? "en",
knownRegions: knownRegions,
knownRegions: sourceGenerator.knownRegions,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we sort these, otherwise might get diffs later due to how Set is used

findLocalisedDirectory(by: NSLocale.canonicalLanguageIdentifier(from: spec.options.developmentLanguage ?? "en"))
}()

knownRegions = Array(Set(knownRegions + localisedDirectories.map { $0.lastComponentWithoutExtension }))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can just make knownRegions a Set itself

@yonaskolb yonaskolb merged commit ca55fd2 into yonaskolb:master Nov 15, 2017
@yonaskolb
Copy link
Owner

@ryohey I'll fix those minor things in master

@ryohey
Copy link
Collaborator Author

ryohey commented Nov 16, 2017

@yonaskolb OK Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug .lproj is broken if Base.lproj is missing
2 participants