94 Commits

Author SHA1 Message Date
Ryu 53cb43cb66 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>
2025-06-07 00:23:21 +10:00
Giovanni Amati 97d36fd1d2 Support for multiple deployment targets with xcode 14 (#1336)
* platformFilters on Dependecies

* platformFilters on sources

* fixed current unit tests

* renamed enum to SupportedPlatforms

* supportedPlatforms field for target

* errors

* renamed errors

* inferPlatformFiltersByPath flag

* changed priority to generate filter

* fixed parsing

* fixed init

* unit test supportedPlatforms

* unit tests for errors

* fixing build settings and unit tests

* added new settingsPresets

* new check errors and unit tests

* case insensitive match

* fixed skipping cross platform target

* json decode

* unit tests inferPlatformFiltersByPath and platformFilters for sources

* mocked files

* fixing unit tests

* first test on dependecies

* unit tests completed

* fixed unit tests

* changelog

* doc changes

* doc changes

* doc changes

* doc changes

* doc changes

* doc changes

* doc changes

* doc changes

* fixed doc

* fixed unti tests style

* fixed regex

* fixed doc

* addressing comments

* Added TestProject, moved unit tests resources in another folder

* Raising error if platform is an array

* unit test on new error

* fixed error enum

* Integrated in TestProject

* committed TestProject

* unit test error

* fixing spm deps in test project

* pushed testProject

* pushed testProject

* pushed testProject fix

* comment on isResolved property

* renameing supportedPlatforms to supportedDestinations

* renameing supportedPlatforms to supportedDestinations

* renameing test app

* checked out old file

* fixing test app

* working on auto baseSDK

* fixed deploymentTarget

* renamed errors

* fixed presets

* remamed index to priority

* small comments

* removed isResolved in target and fixed error check

* added unit tests

* fixed doc

* fixed doc

* fixed doc

* fixed doc

* fixed test app

* add visionOS and more error check and testing

* fixed supported destinations priority and tests

* fixed doc

* solved conflicts

* fixed conflicts

* renamed everything

---------

Co-authored-by: Giovanni Amati <giovanni.amati@sky.uk>
2023-10-31 20:55:38 +11:00
BarredEwe d8d5457f48 Add support for adding build tool plugins to targets (#1374)
* Add support for adding build tool plugins to targets

* Added Plugin validation

* Added some tests

* Limited the minimum version to 5.7 Swift

* Update .gitignore

Co-authored-by: freddi(Yuki Aki) <freddi-kit@users.noreply.github.com>

* Update CHANGELOG.md

Co-authored-by: freddi(Yuki Aki) <freddi-kit@users.noreply.github.com>

* Update CHANGELOG.md

Co-authored-by: freddi(Yuki Aki) <freddi-kit@users.noreply.github.com>

* Update Docs/ProjectSpec.md

Co-authored-by: freddi(Yuki Aki) <freddi-kit@users.noreply.github.com>

* Added a fixture for testing plugins

* Update CHANGELOG.md

* Installed the release version of XcodeProj

---------

Co-authored-by: freddi(Yuki Aki) <freddi-kit@users.noreply.github.com>
2023-08-16 22:22:16 +10:00
mat1th 8256008778 Add possiblity to add resources before the sources build phase (#1351)
* feat: Add possiblity to add resources before the sources build phase;

* feat(ios): Add change to Docs + CHANGELOG;

* fix: rename resourcesBeforeSourcesBuildPhase to putResourcesBeforeSourcesBuildPhase to make it more clear;

* Update CHANGELOG.md

---------

Co-authored-by: Yonas Kolb <yonaskolb@users.noreply.github.com>
2023-04-25 11:57:44 +10:00
Yonas Kolb e35f7df14d Add Test Plans (#716)
* upgrade scheme and project versions

* parse test plans

* remove xctestplan from resources

* generate test plan references in schemes

* add test plan to fixture

* non-mutable way of creating [XCScheme.TestPlanReference]

* update fixture version

* Add documentation

* Add default test plan option

# Conflicts:
#	Sources/ProjectSpec/Scheme.swift
#	Tests/Fixtures/paths_test/included_paths_test.yml
#	Tests/ProjectSpecTests/SpecLoadingTests.swift

* Add test plan validation

# Conflicts:
#	Tests/ProjectSpecTests/ProjectSpecTests.swift

* Check for multiple default test plans

* set first plan as default default plan

* small tweaks

* fix test plan path properties

* add test plants to target scheme

* docs

* fix fixture test plan path

* update changelog

* added ability to disable test plan path validation

Co-authored-by: Ota Mares <ota@rebuy.com>
2022-05-10 13:27:31 +10:00
Dalton Claybrook 81bd52be4b Add support for conditionally linking dependencies based on platform (#1087)
* Add initial support for conditional platform dependencies

* Add tests for conditional platforms

* Update docs and changelog

* Respond to PR feedback

* Change name of field from 'conditionalPlatforms' to 'platforms'

Co-authored-by: Yonas Kolb <yonaskolb@users.noreply.github.com>
2021-06-20 20:19:02 +10:00
Joseph Colicchio 0eeb6369ec Legacy / Settings Relative Paths (#981)
* Adjust header search paths and legacy working directory for relative included projects

* Undo change to HEADER_SEARCH_PATHS

* Add test

* Update changelog

* Fix test

* Undo test changes

* Fix tests
2021-01-14 16:59:59 +11:00
Jared Sorge 331c3da0ef Add Target option for copying frameworks when installing (#912)
* Add copy files on install option

* Add documentation

* Add tests

* Add to the target’s JSON if true

* Add changelog entry

* Add test for outputted pbxproj file
2020-07-26 22:15:42 +10:00
Ian Leitch 7ff577911d Prefix static library target filenames with 'lib' to match Xcode. (#831)
* Prefix static library target filenames with 'lib' to match Xcode.

Given a target named 'MyTarget', Xcode automatically prefixes the filename with 'lib', resulting in the filename 'libMyTarget.a'.

* Update CHANGELOG.md

Co-authored-by: Yonas Kolb <yonaskolb@users.noreply.github.com>
2020-04-13 21:49:17 +10:00
yonaskolb ce787d9e40 use mxcl/Version to fix parsing 2020-02-07 10:49:28 +11:00
yonaskolb 0e4e08bfc4 run swift format for Swift 5.1 2019-11-10 11:56:23 +11:00
Romuald Cari 06a6616b88 Improving variable expansion runtime (#704)
* Improving variable expansion runtime

The current implementation of variable expansion is O(n x m) with n being the
number of strings in the project spec and m being the number of project variables.

This implementation is now O(n).

Also, this effectively deprecates the support for $legacy_variables in favor of the
${new_variables} making this whole patch possible.

* Adding option to disable variable expansion

* Adding performance test for spec loading

* Updating changelog
2019-11-06 08:33:54 -06:00
Brian Clymer 7152d6aa9f Address CR. 2019-10-06 15:33:27 -05:00
Brian Clymer 682f188288 Refactor to make scheme and target templates use the same code. 2019-10-02 09:06:15 -05:00
Brian Clymer 30e1a84566 Working support for scheme templates. 2019-10-02 08:52:22 -05:00
yonaskolb d921d14259 make format_code 2019-09-01 22:02:53 +10:00
yonaskolb 745be5fc1d update import name 2019-06-26 16:49:10 +10:00
ryohey 65dec6b652 Define default property values 2019-04-20 12:13:25 +09:00
ryohey d5649a1bd3 Allow nil values 2019-04-20 12:12:26 +09:00
ryohey 117b90d13f Don't omit empty arrays
https://github.com/yonaskolb/XcodeGen/pull/545#discussion_r271688539
2019-04-20 12:12:26 +09:00
ryohey b27f71eac1 Unify encoding protocols into JSONEncodable
https://github.com/yonaskolb/XcodeGen/pull/545#discussion_r271690085
2019-04-20 12:12:26 +09:00
ryohey 010b1c3804 Implement encoding to JSON 2019-04-20 12:12:26 +09:00
Tom Quist aaae772d0e Add ability to define templateAttributes within a target
This allows parameterizing templates. Also change
placeholder syntax to `${placeholderName}` also for
existing placeholders `$target_name`and `$platform`
and generate warnings when using the old placeholder
syntax.
2019-03-17 14:55:15 +01:00
Tom Quist 0c2554db2b Add support for nested templates
It would be convenient if templates could be nested, which means
a template can be based on another template.

This change implements support for nested templates. It avoids
cycles by just ignoring templates that have already been visited
when collecting the set of templates to use.
2019-03-17 11:29:50 +01:00
ainopara 520db0eb08 Make multi platform targets parse deployment target per platform. 2019-03-04 10:24:51 +08:00
Yonas Kolb 6f4c7d79ac replace $target_name in target templates 2019-01-28 15:54:56 +11:00
Ell Neal 8eadc2f96c Remove some imports that are no longer necessary 2019-01-27 15:34:41 +00:00
Ell Neal d2579bfe43 Refactor the PathContainer protocol to be a bit more expressive 2019-01-24 12:50:34 +00:00
Ell Neal 151d78ef98 Rename PathContaining -> PathContainer 2019-01-21 13:32:13 +00:00
Ell Neal 05a564c324 Use normal imports 2019-01-21 13:12:14 +00:00
Ell Neal 98aeef46dc Implement PathContaining on relevant models 2019-01-13 18:22:34 +00:00
Ell Neal a2684a96a4 Replace global merge function with extension on Dictionary 2019-01-13 18:16:17 +00:00
Brentley Jones ef0c87ecb5 Merge branch 'master' into copy-files-ordering 2018-11-05 10:38:21 -06:00
Yonas Kolb 1631236b7a format_code 2018-11-04 22:30:34 +11:00
Yonas Kolb ea2d38ecdd tweak project description 2018-11-03 20:09:46 +11:00
Yonas Kolb 3d87c61342 plist error handling 2018-10-30 22:22:51 +11:00
Yonas Kolb 228ab6620b generate info plist and entitlements 2018-10-30 00:44:12 +11:00
Yonas Kolb b1b7901f1e don't generate duplicate product file references for cross platform targets 2018-10-14 21:58:19 +11:00
Yonas Kolb e97b002655 upgrade to xcodeproj 5 2018-09-25 21:08:11 +10:00
Brentley Jones 296b938e82 Rename prebuildScripts and postbuildScripts
Also cleanup the documentation and add more tests for the newly added `postCompileScripts`.
2018-09-19 09:24:55 -05:00
Brentley Jones ffc6b92f88 Allow specifying run scripts to run right after compilation
With Xcode 10 dependent targets won't start compiling until compilation and all run scripts are done for the target. This means that your run script should run before Copy Files (and Copy Resources, etc.) phases unless it needs to run later, to allow dependent targets to compile faster.
2018-09-19 08:58:49 -05:00
Brentley Jones 8ebf27a122 Add directlyEmbedCarthageDependencies to Target
Allows for choice on if `copy-frameworks` or an `Embed Frameworks` build phase should be used to embed Carthage framworks. Defaults to `true` for macOS targets to match current behavior.
2018-07-24 19:56:08 -05:00
Brentley Jones 15af4fd1d9 Add requiresObjCLinking to Target
Allows a Target to indicate that any target that links to it needs to set `-ObjC` in `OTHER_LDFLAGS`.
2018-07-24 08:03:03 -05:00
Yonas Kolb 3b17164bbf add aggregate targets 2018-07-24 22:05:29 +10:00
Yonas Kolb c9ab3af76e merge target onto templates 2018-07-23 20:27:50 +10:00
Yonas Kolb 1741d69c3c seperate target resolvers 2018-07-23 20:08:55 +10:00
Yonas Kolb c50d1dd157 add target templates 2018-07-22 21:49:39 +10:00
Brentley Jones b7ba3628e9 Fix typo "transient" -> "transitive" 2018-07-03 13:34:20 -05:00
Yonas Kolb 01815e7e4e Update to 1.10.0 2018-07-03 21:45:00 +10:00
Brentley Jones 55b0ed1eeb Add option to turn off transiently linking dependencies 2018-06-29 14:04:31 -05:00