Commit Graph

76 Commits

Author SHA1 Message Date
Yonas Kolb 8cfdf30a9f Fix folder source PBXFileReference path regression with createIntermediateGroups (#1605)
Skip makePathRelative for folder-type sources since they use sourceTree
.sourceRoot and need the full project-relative path preserved. The call
was inadvertently added for all source types in #1596 but only synced
folders (.syncedFolder) need it.

Fixes #1603
2026-03-11 00:44:51 +11:00
Bruno Coelho acd366f089 Fix issue 1602 - Synced folders: includes silently ignored + no deduplication across targets (#1604)
* Fix issue 1602 - Synced folders: includes silently ignored + no deduplication across targets

* Add more tests
2026-03-10 10:25:07 +11:00
Max Seelemann 167d11998a Various synced folder enhancements (#1596)
* Add explicitFolders support to syncedFolder

Adds an `explicitFolders` property to `TargetSource` that is expanded from Glob patterns and passed through to `PBXFileSystemSynchronizedRootGroup`.

* Fix syncedFolder sources ignoring createIntermediateGroups

When createIntermediateGroups was enabled and a syncedFolder source had a
multi-component path (e.g. SyncedParent/SyncedChild), two things went wrong:

1. The synced folder was unconditionally added to rootGroups, causing it
   to appear both at the project root and inside the correct intermediate
   parent group.

2. The synced folder kept its full project-relative path instead of being
   made relative to its parent group, so Xcode concatenated them into a
   wrong path (e.g. SyncedParent/SyncedParent/SyncedChild).

* Enhance PBXFileElement to recognize synced folders as groups that can be sorted

* Fix membership exceptions for nested synced folder with intermediate groups

* Update Changelog
2026-03-05 13:22:29 +11:00
mirkokg a0afcefaed Handle membership exceptions for synchronized root groups (#1587)
* Handle membership exceptions for synchronized root groups

Adds logic to detect and register membership exceptions for PBXFileSystemSynchronizedRootGroup objects, specifically excluding Info.plist files from group membership when necessary. Also ensures resources build phase is added if synchronized root groups are present.

* Refactor synced folder membership exceptions with glob support

Extract configureMembershipExceptions into its own method, use Set for
dedup, resolve excludes via glob expansion, and add a no-op test case.
Incorporates glob support and tests from macguru@baf1108.

* Update UUID

* Comment out excludes in project.yml

Comment out excludes for ExcludedFile.swift due to CI issue.

* Clean up project.pbxproj by removing exception set

Removed PBXFileSystemSynchronizedBuildFileExceptionSet section and its references.

* Remove comment

* Update SourceGeneratorTests.swift

* Update project.pbxproj

* Retrigger CI

* Add info.plist exclusion
2026-03-04 08:22:27 +11:00
Yonas Kolb a904543801 update to xcodeproj 9.10.1 (#1597) 2026-03-03 22:43:05 +11:00
Yonas Kolb c32aa4cc94 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>
2025-07-17 15:15:43 +10:00
Marcos Griselli a51a548a83 Skip failing test on Linux until upstream fix (#1517)
* Skip failing test on Linux

* Skip more tests

* Skip more tests

* One more skip
2024-10-27 20:34:50 +11:00
nicolasbosi95 2881fcc8fb Support for Strings Catalogs (Xcode 15) (#1421)
* Support for xcode 15 string catalogs

* Add sample string catalog to Test Fixture and basic test to check that asset catalogs are added in the resources build phase

* Restore unintended changes

* Update Pull Request number for 'Support for Strings Catalogs' in changelog

* Update fixture yml generator

* Detect knownRegions based on locales in string catalogs
2024-02-14 20:07:04 +11:00
Aaron Farnham 808aa25f51 Add support for .mlpackage bundles (#1398) 2023-09-03 00:00:56 +10:00
Shaun Harrison 3a7e75f1fb Fix issue with includes not working when no matches are found (#1337)
* Fix issue where an includes pattern without matches prevented includes from working

* Add new test to handle includes with no matches
2023-08-17 13:58:50 +10:00
antonsergeev88 ff552f3880 Handle mlmodelc as a single unit (#1237)
* Handle mlmodelc as a single unit

* Add mlmodelc support in changelog
2022-07-31 18:33:20 +10:00
Yuya Hirayama 047e9968d6 Fix docc support (#1202)
* Update FileType.swift

* Update SourceGeneratorTests.swift

* Update fixture

* Update CHANGELOG.md
2022-04-05 14:08:02 +10:00
Bruce Evans b8af21d12f Add Support for DocC in Xcode 13 (#1091)
* Add support for DocC

DocC "files" are actually folders `.docc` appended to the name, but Xcode 13 treats them differently. Therefore, we need to exclude them from the normal BuildPhase.

Resolves #1089

* Add tests for DocC

Expanded an existing test to include .docc support.

Also added a .docc catalog to the Test Project.

* Update changelog.md

* Update changelog.md to get the correct PR Link
2021-06-16 10:12:01 +10:00
Liam Nichols 1b57ba5c75 Improve INFOPLIST_FILE handling to only omit used Info.plist's from Copy Bundle Resources Build Phase (#1027)
* Update TestProject Fixture to include GoogleService-Info.plist resource bsaed on 2.18.0 generator

* Update TestProject fixture to include an Info.plist file named 'App-Info.plist' to simulate scenario in #945

* Resolve INFOPLIST_FILE values upfront ahead of resolving all source files for a target

* fixup! Resolve INFOPLIST_FILE values upfront ahead of resolving all source files for a target

* fixup! Resolve INFOPLIST_FILE values upfront ahead of resolving all source files for a target

* Refactor SourceGenerator to remove some redundant arguments on internal methods when generating source files in a target

* Update SourceGenerator to accept '[Path: BuildPhaseSpec]' of preferred build phases in order to prioritise over 'default' value. Remove explicit Info.plist check from SourceGenerator. Update PBXProjGenerator to inject hash of build phases for resolved INFOPLIST_FILE values. Update SourceGeneratorTests to comply with change where only the FIRST Info.plist is excluded from copy bundle resources build phase, additionally resolve absolute path

* Ensure project.basePath is always absolute when resolving Info.plist path relative to project

* Add test coverage in SourceGeneratorTests.swift

* Update CHANGELOG.md

* Reword CHANGELOG.md
2021-04-08 15:38:21 +10:00
Joseph Colicchio 05ea968f70 Bugfix/StoreKitConfiguration BuildPhase (#1026)
* Copy storekit to bundle resources by default

* Fix tests

* Update changelog
2021-02-24 08:33:54 +11:00
Samuel Giddins c8b24acbdd Allow creating intermediary groups outside of the project directory (#892) 2020-09-02 14:45:27 -07:00
Yonas Kolb 20a99e5018 Add FileTypes for cross project file options (#914)
* move BuildPhase

* add fileTypes

* update changelog
2020-08-04 09:14:32 +10:00
Yonas Kolb 7da953a488 swift format 2020-06-17 18:12:34 +10:00
Joseph Colicchio 1f95a41b85 Compile xcmappingmodel files instead of copying them (#834)
* Compile xcmappingmodel files instead of copying them

* Add test for xcmappingmodel

* Update changelog

* Fix xcmappingmodel reference to avoid folder containing xml

* Fix xcmappingmodel contents to avoid test failure

* Tweak yaml to fix compiler flag on xcmappingmodel

avoid `-Werror` added to xcmappingmodel compiler flags, which was preventing compilation
2020-06-04 15:22:33 +10:00
Jeff Lett aaae84f883 Feature/catch xcode test failures (#851)
* Adding pipefail to CI tests so xcpretty doesn't eat test failures

* Resolving test issues
2020-04-29 08:34:25 -05:00
Sam Kirchmeier aeb65969d4 Automatically include bundles in the Copy Bundle Resources build phase (#838) 2020-04-22 07:59:43 -05:00
Asif 400c19ee9a Bugfix: Consider folders with dot in it when generating projects (#826)
* Bug fix in SourceGenerator

Folders which would have a dot in it, would be added to Copy Bundle Resources even though it contained swift files. This commit, updates the if checks to check if the extension is not of type lproj or xcassets or bundle. This would let Xcodegen handle paths with dots in it

* Refactor SourceGenerator.swift getGroupSources function

* Add FolderWithDot2.0 to TestProject/App_iOS

* Update TestProject fixture with SwiftFileInDotPath and FolderWithDot2.0 changes

* Update test to assert bundles are included in resources

* Remove intentDefinition from whitelistedDirectoryExtensions because it's not a directory, it's always a file so the check is not required
2020-04-09 07:47:54 -05:00
Christopher Rogers 5966e294e7 Stabilize sorting of groups with duplicate names/paths (#671)
* Stabilize sorting of groups with duplicate names/paths

For example, previously a group with (name: nil, path: "Sources") would be considered equal to (name: "Sources", path: "../Sources"), even though they are distinct groups.

* Remove Comparable conformance from PBXFileElement

...as it isn't compatible with its Equatable conformance.

Renamed localizedStandardCompare to reflect the fact that PBXFileElement no longer has an inherent order.

* Update changelog
2020-02-02 09:46:17 +11:00
sipao 3a9131a21a Add support On Demand Resources (#753)
* added on-demand-resources setting to project.yml

* update documents

* Apply suggestions from code review

fixed docs

Co-Authored-By: Yonas Kolb <yonaskolb@users.noreply.github.com>

* Make it possible to resourceTags convert to json

* Use sorted() instead of Array initializer

* Avoid merge assetTags if it is empty

* Changed access to resourceTags to inline

* Don't add resourceTags other than chosenBuildPhase is .resources

* update CHANGELOG.md

* update spec loading test

* add a new "generates resource tags" test case

* add resourceTags in Test Fixture and update

Co-authored-by: Yonas Kolb <yonaskolb@users.noreply.github.com>
2020-01-21 08:47:31 +11:00
yonaskolb 66ba10c3c6 print group hierarchy on source generator test failure 2019-11-20 22:18:32 +11:00
Romuald CARI 0df37029cc Fix TargetSource group behavior
When targeting a file, a folder should not be created for its directory,
only the file should appear in the specified custom group.
Moreover, if the custom groups contains actual filesystem folders, they
should map to these.
2019-11-19 15:56:24 -05:00
Romuald CARI de9c15ea1d Fix @sroebert PR based on @yonaskolb comments 2019-11-19 15:56:23 -05:00
Steven Roebert 15e615300e Added new group parameter to target sources, allowing to add them to a custom parent group (resolving #478) 2019-11-19 15:56:23 -05:00
Kohki Miki cad36baa6d Update SourceGeneratorTests.swift 2019-11-19 04:38:05 +09:00
giginet 5e9a2a9651 Add test case with buildPhase 2019-11-19 04:34:28 +09:00
giginet e24fa881da Tweak 2019-11-19 03:35:51 +09:00
giginet c5e9f07a53 Add tests to add intentdefinition to build source phases 2019-11-19 03:00:08 +09:00
yonaskolb 865ad156b2 use custom unwrap function 2019-11-10 12:18:04 +11:00
yonaskolb 66569d3670 use XCTUnwrap 2019-11-10 12:09:37 +11:00
yonaskolb 0e4e08bfc4 run swift format for Swift 5.1 2019-11-10 11:56:23 +11:00
Kohki Miki 03076f40eb Support Static Frameworks for Carthage dependencies (#688) 2019-11-07 11:03:26 -06:00
yonaskolb d0d509c1a5 swiftformat 2019-10-27 22:37:41 +11:00
Nikita Ivanchikov 974bf8ac5f Add source generator tests 2019-10-08 01:40:56 +03:00
Brian Clymer e4204e51ee Tweak an includes test. 2019-09-01 15:33:15 -05:00
Brian Clymer 582193e482 Merge branch 'master' into BC-IncludesOnly 2019-09-01 15:23:24 -05:00
yonaskolb d921d14259 make format_code 2019-09-01 22:02:53 +10:00
Brian Clymer fbac8af327 Include path even if it's only a relative of the included file. 2019-08-28 15:48:47 -05:00
Brian Clymer f918bf54ea Add support for explicit includes on sources.
They are overridden by excludes.
2019-08-28 14:22:35 -05:00
Brian Clymer bcdbad4a10 Add recursive glob support. 2019-08-28 13:39:05 -05:00
Keith Smiley acb56f8866 Ignore files with orig extension
This is useful for multi-developer projects where you don't want to
delete these files for everyone, since they might actually want them,
but they still aren't useful to show in Xcode.

Fixes https://github.com/yonaskolb/XcodeGen/issues/310
2019-08-24 11:57:10 -07:00
yonaskolb 401df4042a fix swift 5.1 warnings 2019-06-26 17:02:42 +10:00
yonaskolb 745be5fc1d update import name 2019-06-26 16:49:10 +10:00
min efb5951d13 Allow more flexibility by accepting an [String] for attributes 2019-05-11 08:36:24 -07:00
min 60a0f64416 Add support for no_codegen settings ATTRIBUTE 2019-05-07 20:42:44 -07:00
Steven Roebert d12bd0a426 Added unit test for testing the flattening of relative paths #(550) 2019-04-07 13:05:01 +02:00