Skip to content

Commit

Permalink
Release 2.7.0 (#642)
Browse files Browse the repository at this point in the history
Release 2.7.0
  • Loading branch information
yonaskolb authored Sep 1, 2019
2 parents 573466b + d921d14 commit 367c6bd
Show file tree
Hide file tree
Showing 29 changed files with 106 additions and 110 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

## Next Version

## 2.7.0

#### Added

- Added Bash 4 style recursive globbing (`**/*`) when excluding files from target sources. [#636](https://github.com/yonaskolb/XcodeGen/pull/636) @bclymer
- Added ability to disable main thread checker on Run and Test schemes and TargetSchemes [#601](https://github.com/yonaskolb/XcodeGen/pull/601) @wag-miles
- Added Bash 4 style recursive globbing (`**/*`) in target sources `excludes` [#636](https://github.com/yonaskolb/XcodeGen/pull/636) @bclymer
- Added ability to disable main thread checker in Schemes [#601](https://github.com/yonaskolb/XcodeGen/pull/601) @wag-miles

#### Fixed
- Fixed included specs that were referenced multiple times from duplicating content [#599](https://github.com/yonaskolb/XcodeGen/pull/599) @haritowa
Expand All @@ -14,6 +16,8 @@
#### Changed
- Allow linking of dependencies into static libraries when `link` is set to true [#635](https://github.com/yonaskolb/XcodeGen/pull/635) @kateinoigakukun

[Commits](https://github.com/yonaskolb/XcodeGen/compare/2.6.0...2.7.0)

## 2.6.0

#### Added
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TOOL_NAME = XcodeGen
export EXECUTABLE_NAME = xcodegen
VERSION = 2.6.0
VERSION = 2.7.0

PREFIX = /usr/local
INSTALL_PATH = $(PREFIX)/bin/$(EXECUTABLE_NAME)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ swift run xcodegen
Add the following to your Package.swift file's dependencies:

```swift
.package(url: "https://github.com/yonaskolb/XcodeGen.git", from: "2.6.0"),
.package(url: "https://github.com/yonaskolb/XcodeGen.git", from: "2.7.0"),
```

And then import wherever needed: `import XcodeGenKit`
Expand Down
2 changes: 1 addition & 1 deletion Sources/ProjectSpec/AggregateTarget.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ extension AggregateTarget: JSONEncodable {
"configFiles": configFiles,
"attributes": attributes,
"buildScripts": buildScripts.map { $0.toJSONValue() },
"scheme": scheme?.toJSONValue()
"scheme": scheme?.toJSONValue(),
] as [String: Any?]
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/ProjectSpec/BuildRule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ extension BuildRule: JSONEncodable {
var dict: [String: Any?] = [
"outputFiles": outputFiles,
"outputFilesCompilerFlags": outputFilesCompilerFlags,
"name": name
"name": name,
]

switch fileType {
Expand Down
3 changes: 2 additions & 1 deletion Sources/ProjectSpec/BuildScript.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ extension BuildScript: JSONObjectConvertible {
showEnvVars = jsonDictionary.json(atKeyPath: "showEnvVars") ?? BuildScript.showEnvVarsDefault
}
}

extension BuildScript: JSONEncodable {
public func toJSONValue() -> Any {
var dict: [String: Any?] = [
Expand All @@ -72,7 +73,7 @@ extension BuildScript: JSONEncodable {
"outputFileLists": outputFileLists,
"runOnlyWhenInstalling": runOnlyWhenInstalling,
"name": name,
"shell": shell
"shell": shell,
]

if showEnvVars != BuildScript.showEnvVarsDefault {
Expand Down
2 changes: 1 addition & 1 deletion Sources/ProjectSpec/Dependency.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ extension Dependency: JSONEncodable {
var dict: [String: Any?] = [
"embed": embed,
"codeSign": codeSign,
"link": link
"link": link,
]

if removeHeaders != Dependency.removeHeadersDefault {
Expand Down
2 changes: 1 addition & 1 deletion Sources/ProjectSpec/Plist.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ extension Plist: JSONEncodable {
public func toJSONValue() -> Any {
return [
"path": path,
"properties": properties
"properties": properties,
]
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/ProjectSpec/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ extension Project: JSONEncodable {
"configs": Dictionary(uniqueKeysWithValues: configsPairs),
"aggregateTargets": Dictionary(uniqueKeysWithValues: aggregateTargetsPairs),
"schemes": Dictionary(uniqueKeysWithValues: schemesPairs),
"settingGroups": settingGroups.mapValues { $0.toJSONValue() }
"settingGroups": settingGroups.mapValues { $0.toJSONValue() },
]
}
}
16 changes: 8 additions & 8 deletions Sources/ProjectSpec/Scheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public struct Scheme: Equatable {

public struct Archive: BuildAction {
public static let revealArchiveInOrganizerDefault = true

public var config: String?
public var customArchiveName: String?
public var revealArchiveInOrganizer: Bool
Expand Down Expand Up @@ -247,7 +247,7 @@ extension Scheme.ExecutionAction: JSONEncodable {
return [
"script": script,
"name": name,
"settingsTarget": settingsTarget
"settingsTarget": settingsTarget,
]
}
}
Expand All @@ -271,7 +271,7 @@ extension Scheme.Run: JSONEncodable {
"preActions": preActions.map { $0.toJSONValue() },
"postActions": postActions.map { $0.toJSONValue() },
"environmentVariables": environmentVariables.map { $0.toJSONValue() },
"config": config
"config": config,
]

if disableMainThreadChecker != Scheme.Run.disableMainThreadCheckerDefault {
Expand Down Expand Up @@ -316,7 +316,7 @@ extension Scheme.Test: JSONEncodable {
"preActions": preActions.map { $0.toJSONValue() },
"postActions": postActions.map { $0.toJSONValue() },
"environmentVariables": environmentVariables.map { $0.toJSONValue() },
"config": config
"config": config,
]

if gatherCoverageData != Scheme.Test.gatherCoverageDataDefault {
Expand Down Expand Up @@ -348,7 +348,7 @@ extension Scheme.Test.TestTarget: JSONEncodable {
}

var dict: JSONDictionary = [
"name": name
"name": name,
]

if randomExecutionOrder != Scheme.Test.TestTarget.randomExecutionOrderDefault {
Expand Down Expand Up @@ -380,7 +380,7 @@ extension Scheme.Profile: JSONEncodable {
"preActions": preActions.map { $0.toJSONValue() },
"postActions": postActions.map { $0.toJSONValue() },
"environmentVariables": environmentVariables.map { $0.toJSONValue() },
"config": config
"config": config,
] as [String: Any?]
}
}
Expand All @@ -395,7 +395,7 @@ extension Scheme.Analyze: JSONObjectConvertible {
extension Scheme.Analyze: JSONEncodable {
public func toJSONValue() -> Any {
return [
"config": config
"config": config,
]
}
}
Expand Down Expand Up @@ -581,7 +581,7 @@ extension XCScheme.EnvironmentVariable: JSONEncodable {
public func toJSONValue() -> Any {
var dict: [String: Any] = [
"variable": variable,
"value": value
"value": value,
]

if enabled != XCScheme.EnvironmentVariable.enabledDefault {
Expand Down
2 changes: 1 addition & 1 deletion Sources/ProjectSpec/Settings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ extension Settings: JSONEncodable {
return [
"base": buildSettings,
"groups": groups,
"configs": configSettings.mapValues { $0.toJSONValue() }
"configs": configSettings.mapValues { $0.toJSONValue() },
]
}
return buildSettings
Expand Down
20 changes: 10 additions & 10 deletions Sources/ProjectSpec/SpecFile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public struct SpecFile {
public let subSpecs: [SpecFile]

private let filename: String

fileprivate struct Include {
let path: Path
let relativePaths: Bool
Expand Down Expand Up @@ -92,27 +92,27 @@ public struct SpecFile {

private func resolvedDictionaryWithUniqueTargets() -> JSONDictionary {
let resolvedSpec = resolvingPaths()

var value = Set<String>()
return resolvedSpec.mergedDictionary(set: &value)
}

private func substitute(variables: [String: String], in mergedDictionary: JSONDictionary) -> JSONDictionary {
var resolvedSpec = mergedDictionary

for (key, value) in variables {
resolvedSpec = resolvedSpec.replaceString("${\(key)}", with: value)
}

return resolvedSpec
}

func mergedDictionary(set mergedTargets: inout Set<String>) -> JSONDictionary {
let name = (basePath + relativePath + Path(filename)).description

guard !mergedTargets.contains(name) else { return [:] }
mergedTargets.insert(name)

return jsonDictionary.merged(onto:
subSpecs
.map { $0.mergedDictionary(set: &mergedTargets) }
Expand All @@ -137,14 +137,14 @@ public struct SpecFile {

extension Dictionary where Key == String, Value: Any {

func merged(onto other: Dictionary<Key, Value>) -> Dictionary<Key, Value> {
func merged(onto other: [Key: Value]) -> [Key: Value] {
var merged = other

for (key, value) in self {
if key.hasSuffix(":REPLACE") {
let newKey = key[key.startIndex..<key.index(key.endIndex, offsetBy: -8)]
merged[Key(newKey)] = value
} else if let dictionary = value as? Dictionary<Key, Value>, let base = merged[key] as? Dictionary<Key, Value> {
} else if let dictionary = value as? [Key: Value], let base = merged[key] as? [Key: Value] {
merged[key] = dictionary.merged(onto: base) as? Value
} else if let array = value as? [Any], let base = merged[key] as? [Any] {
merged[key] = (base + array) as? Value
Expand Down
9 changes: 4 additions & 5 deletions Sources/ProjectSpec/Target.swift
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,6 @@ extension Target: NamedJSONDictionaryConvertible {
}
}


extension Target: JSONEncodable {
public func toJSONValue() -> Any {
var dict: [String: Any?] = [
Expand All @@ -372,10 +371,10 @@ extension Target: JSONEncodable {
"attributes": attributes,
"sources": sources.map { $0.toJSONValue() },
"dependencies": dependencies.map { $0.toJSONValue() },
"postCompileScripts": postCompileScripts.map{ $0.toJSONValue() },
"prebuildScripts": preBuildScripts.map{ $0.toJSONValue() },
"postbuildScripts": postBuildScripts.map{ $0.toJSONValue() },
"buildRules": buildRules.map{ $0.toJSONValue() },
"postCompileScripts": postCompileScripts.map { $0.toJSONValue() },
"prebuildScripts": preBuildScripts.map { $0.toJSONValue() },
"postbuildScripts": postBuildScripts.map { $0.toJSONValue() },
"buildRules": buildRules.map { $0.toJSONValue() },
"deploymentTarget": deploymentTarget?.deploymentTarget,
"info": info?.toJSONValue(),
"entitlements": entitlements?.toJSONValue(),
Expand Down
2 changes: 1 addition & 1 deletion Sources/ProjectSpec/TargetScheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ extension TargetScheme: JSONEncodable {
"preActions": preActions.map { $0.toJSONValue() },
"postActions": postActions.map { $0.toJSONValue() },
]

if gatherCoverageData != TargetScheme.gatherCoverageDataDefault {
dict["gatherCoverageData"] = gatherCoverageData
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/ProjectSpec/TargetSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ extension TargetSource.BuildPhase.CopyFilesSettings: JSONEncodable {
public func toJSONValue() -> Any {
return [
"destination": destination.rawValue,
"subpath": subpath
"subpath": subpath,
]
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGen/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import Foundation
import ProjectSpec
import XcodeGenCLI

let version = Version("2.6.0")
let version = Version("2.7.0")
let cli = XcodeGenCLI(version: version)
cli.execute()
8 changes: 2 additions & 6 deletions Sources/XcodeGenKit/Glob.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
// Adapted from https://gist.github.com/blakemerryman/76312e1cbf8aec248167
// Adapted from https://gist.github.com/efirestone/ce01ae109e08772647eb061b3bb387c3


import Foundation


public let GlobBehaviorBashV3 = Glob.Behavior(
supportsGlobstar: false,
includesFilesFromRootOfGlobstar: false,
Expand All @@ -29,7 +27,6 @@ public let GlobBehaviorGradle = Glob.Behavior(
includesFilesInResultsIfTrailingSlash: true
)


/**
Finds files on the file system using pattern matching.
*/
Expand Down Expand Up @@ -66,7 +63,7 @@ public class Glob: Collection {
public let blacklistedDirectories: [String]
var paths = [String]()
public var startIndex: Int { return paths.startIndex }
public var endIndex: Int { return paths.endIndex }
public var endIndex: Int { return paths.endIndex }

/// Initialize a glob
///
Expand Down Expand Up @@ -126,7 +123,7 @@ public class Glob: Collection {
private var globalFlags = GLOB_TILDE | GLOB_BRACE | GLOB_MARK

private func executeGlob(pattern: UnsafePointer<CChar>, gt: UnsafeMutablePointer<glob_t>) -> Bool {
return 0 == glob(pattern, globalFlags, nil, gt)
return glob(pattern, globalFlags, nil, gt) == 0
}

private func expandGlobstar(pattern: String) -> [String] {
Expand Down Expand Up @@ -234,4 +231,3 @@ private extension Sequence {
return Array(self)
}
}

Loading

0 comments on commit 367c6bd

Please sign in to comment.