Skip to content

Commit a0c82f2

Browse files
RomanPodymovgiginetRyu0118yonaskolbkirillyakimovich
authored
Update master (#1)
* Update CI equipments and drop Xcode 15 support (#1548) * Add validation to ensure that settings.configs values are dictionaries, in order to prevent misuse (#1547) * Add validation to ensure settings.configs values are dictionaries to prevent misuse * Add tests for invalid settings.configs value formats * Replaced with filter and split into a function * Rename invalidConfigsFormat to invalidConfigsMappingFormat * Add comments to explain invalid fixture * Rename test fixture * Update CHANGELOG.md * Correct grammer * Use KeyPath instead of closure * Rename validateMappingStyleInConfig to extractValidConfigs * Add a document comment for extractValidConfigs(from:) * Use old testing api and remove EquatableErrorBox * Rename test case to use "mapping" instead of "dictionary" * Add ValidSettingsExtractor to encapsulate the logic for converting a dictionary to Settings * Add settings validation for both Target and AggregateTarget * Add tests for invalid settings.configs in Target and AggregateTarget * Add document comments for ValidSettingsExtractor * Rename ValidSettingsExtractor to BuildSettingsExtractor * Add settings validation for settingGroups * Add tests for settingGroups * Rename extract to parse * Refactor * Update Tests/ProjectSpecTests/InvalidConfigsFormatTests.swift --------- Co-authored-by: Yonas Kolb <yonaskolb@users.noreply.github.com> * Synced folders (#1541) * update xcodeproj to 8.27.7 * add syncedFolder source type * drop xcode 15 support * Rely on fileReference instead of adding new synchronizedRootGroup (#1557) * fix: don't include untracked children in cache --------- Co-authored-by: Kirill Yakimovich <kirill.yakimovich@gmail.com> * Use USER env var instead of LOGNAME (#1559) During user switch with su/sudo in system LOGNAME may not be initialised, but USER env var is always exist. * Address Sanitizer options in run/test schemes (#1550) * Expose address sanitizer flags in run and test BuildActions in Schemes * Update testJSONEncodable to test the new fields * Also test the asan setting values for run scheme * Update changelog --------- Co-authored-by: Yonas Kolb <yonaskolb@users.noreply.github.com> * Update to 2.44.0 # Conflicts: # CHANGELOG.md --------- Co-authored-by: Kohki Miki <giginet.net@gmail.com> Co-authored-by: Ryu <87907656+Ryu0118@users.noreply.github.com> Co-authored-by: Yonas Kolb <yonaskolb@users.noreply.github.com> Co-authored-by: Kirill Yakimovich <kirill.yakimovich@gmail.com> Co-authored-by: Kanstantsin Shautsou <kanstantsin.sha@gmail.com> Co-authored-by: Himanshu Kumar <7786778+hi-kumar@users.noreply.github.com>
1 parent 2d4a094 commit a0c82f2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+469
-61
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,11 @@ on:
44
pull_request: {}
55
jobs:
66
run:
7-
runs-on: ${{ matrix.macos }}
7+
runs-on: macos-15
88
name: Xcode ${{ matrix.xcode }}
99
strategy:
1010
matrix:
11-
xcode: ["15.4", "16.0"]
12-
include:
13-
- xcode: "15.4"
14-
macos: macos-15
15-
- xcode: "16.0"
16-
macos: macos-15
11+
xcode: ["16.0", "16.3"]
1712
env:
1813
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
1914
steps:

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
## Next Version
44

5+
## 2.44.0
6+
7+
### Added
8+
- Basic support for Xcode 16's synchronized folders #1541 @yonaskolb
9+
- `TargetSource.type` can now be `syncedFolder`
10+
- `Options.defaultSourceDirectoryType` can be set to `syncedFolder` for the default type in all sources in the project (defaults to `group`)
11+
- Benefits include faster generation and no cache invalidation or need to regenerate when files are added or removed from these folders
12+
- Note that not all TargetSource options like excludes are supported, just a simple path. Please test and see what is missing in your projects
13+
- Added sanitizer options to run and test actions in Scheme #1550 @hi-kumar
14+
15+
### Fixed
16+
- Added validation to ensure that all values in `settings.configs` are mappings. Previously, passing non-mapping values did not raise an error, making it difficult to detect misconfigurations. Now, `SpecParsingError.invalidConfigsMappingFormat` is thrown if misused. #1547 @Ryu0118
17+
- Use `USER` instead of `LOGNAME` for XCUserData #1559 @KostyaSha
18+
519
## 2.43.0
620

721
### Added

Docs/ProjectSpec.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ Note that target names can also be changed by adding a `name` property to a targ
153153
- [ ] **postGenCommand**: **String** - A bash command to run after the project has been generated. If the project isn't generated due to no changes when using the cache then this won't run. This is useful for running things like `pod install` only if the project is actually regenerated.
154154
- [ ] **useBaseInternationalization**: **Bool** If this is `false` and your project does not include resources located in a **Base.lproj** directory then `Base` will not be included in the projects 'known regions'. The default value is `true`.
155155
- [ ] **schemePathPrefix**: **String** - A path prefix for relative paths in schemes, such as StoreKitConfiguration. The default is `"../../"`, which is suitable for non-workspace projects. For use in workspaces, use `"../"`.
156+
- [ ] **defaultSourceDirectoryType**: **String** - When a [Target source](#target-source) doesn't specify a type and is a directory, this is the type that will be used. If nothing is specified for either then `group` will be used.
157+
- `group` (default)
158+
- `folder`
159+
- `syncedFolder`
156160

157161
```yaml
158162
options:
@@ -542,6 +546,7 @@ A source can be provided via a string (the path) or an object of the form:
542546
- `file`: a file reference with a parent group will be created (Default for files or directories with extensions)
543547
- `group`: a group with all it's containing files. (Default for directories without extensions)
544548
- `folder`: a folder reference.
549+
- `syncedFolder`: Xcode 16's synchronized folders, also knows as buildable folders
545550
- [ ] **headerVisibility**: **String** - The visibility of any headers. This defaults to `public`, but can be either:
546551
- `public`
547552
- `private`

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
TOOL_NAME = XcodeGen
22
export EXECUTABLE_NAME = xcodegen
3-
VERSION = 2.43.0
3+
VERSION = 2.44.0
44

55
PREFIX = /usr/local
66
INSTALL_PATH = $(PREFIX)/bin/$(EXECUTABLE_NAME)

Package.resolved

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ let package = Package(
1616
.package(url: "https://github.com/yonaskolb/JSONUtilities.git", from: "4.2.0"),
1717
.package(url: "https://github.com/kylef/Spectre.git", from: "0.9.2"),
1818
.package(url: "https://github.com/onevcat/Rainbow.git", from: "4.0.0"),
19-
.package(url: "https://github.com/tuist/XcodeProj.git", exact: "8.24.3"),
19+
.package(url: "https://github.com/tuist/XcodeProj.git", exact: "8.27.7"),
2020
.package(url: "https://github.com/jakeheis/SwiftCLI.git", from: "6.0.3"),
2121
.package(url: "https://github.com/mxcl/Version", from: "2.0.0"),
2222
.package(url: "https://github.com/freddi-kit/ArtifactBundleGen", exact: "0.0.6")

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ swift run xcodegen
112112
Add the following to your Package.swift file's dependencies:
113113

114114
```swift
115-
.package(url: "https://github.com/yonaskolb/XcodeGen.git", from: "2.43.0"),
115+
.package(url: "https://github.com/yonaskolb/XcodeGen.git", from: "2.44.0"),
116116
```
117117

118118
And then import wherever needed: `import XcodeGenKit`

Sources/ProjectSpec/AggregateTarget.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ extension AggregateTarget: NamedJSONDictionaryConvertible {
6060
public init(name: String, jsonDictionary: JSONDictionary) throws {
6161
self.name = jsonDictionary.json(atKeyPath: "name") ?? name
6262
targets = jsonDictionary.json(atKeyPath: "targets") ?? []
63-
settings = jsonDictionary.json(atKeyPath: "settings") ?? .empty
63+
settings = try BuildSettingsParser(jsonDictionary: jsonDictionary).parse()
6464
configFiles = jsonDictionary.json(atKeyPath: "configFiles") ?? [:]
6565
buildScripts = jsonDictionary.json(atKeyPath: "buildScripts") ?? []
6666
buildToolPlugins = jsonDictionary.json(atKeyPath: "buildToolPlugins") ?? []
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import Foundation
2+
import JSONUtilities
3+
4+
/// A helper for extracting and validating the `Settings` object from a JSON dictionary.
5+
struct BuildSettingsParser {
6+
let jsonDictionary: JSONDictionary
7+
8+
/// Attempts to extract and parse the `Settings` from the dictionary.
9+
///
10+
/// - Returns: A valid `Settings` object
11+
func parse() throws -> Settings {
12+
do {
13+
return try jsonDictionary.json(atKeyPath: "settings")
14+
} catch let specParsingError as SpecParsingError {
15+
// Re-throw `SpecParsingError` to prevent the misuse of settings.configs.
16+
throw specParsingError
17+
} catch {
18+
// Ignore all errors except `SpecParsingError`
19+
return .empty
20+
}
21+
}
22+
23+
/// Attempts to extract and parse setting groups from the dictionary with fallback defaults.
24+
///
25+
/// - Returns: Parsed setting groups or default groups if parsing fails
26+
func parseSettingGroups() throws -> [String: Settings] {
27+
do {
28+
return try jsonDictionary.json(atKeyPath: "settingGroups", invalidItemBehaviour: .fail)
29+
} catch let specParsingError as SpecParsingError {
30+
// Re-throw `SpecParsingError` to prevent the misuse of settingGroups.
31+
throw specParsingError
32+
} catch {
33+
// Ignore all errors except `SpecParsingError`
34+
return jsonDictionary.json(atKeyPath: "settingPresets") ?? [:]
35+
}
36+
}
37+
}

Sources/ProjectSpec/CacheFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class CacheFile {
1010

1111
guard #available(OSX 10.13, *) else { return nil }
1212

13-
let files = Set(project.allFiles)
13+
let files = Set(project.allTrackedFiles)
1414
.map { ((try? $0.relativePath(from: project.basePath)) ?? $0).string }
1515
.sorted { $0.localizedStandardCompare($1) == .orderedAscending }
1616
.joined(separator: "\n")

0 commit comments

Comments
 (0)