Commit Graph

28 Commits

Author SHA1 Message Date
Yonas Kolb 25841ee60d Validate empty source paths to prevent project root inclusion (#1601)
* Add .context to .gitignore

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Validate empty source paths to prevent project root inclusion (#1595)

Empty/null source entries (e.g. bare `-` in YAML) resolve to the project
root, causing extreme memory usage. Add validation to reject them with a
clear error message.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 17:07:57 +11:00
Tatsuki Otsuka 274ce7342c Disallow the "watchOS" supported destination for multiplatform apps (#1470)
* Reject multiplatform apps that support the watchOS destination

This commit also fixes existing test cases.

* Add test cases

* Update docs

* Update changelog
2024-05-17 23:00:09 +10:00
Wolfgang Lutz d935e41846 Update SpecValidationError.swift (#1439)
fix a typo
2024-02-13 19:08:01 +11: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
Bartosz Kosiorek 9766326dcd Display absolute path for invalidBuildScriptPath and invalidTargetConfigFile error print. (#1353)
* Display absolute path in invalidBuildScriptPath error print.

With previous implementation, the error message was not clear for end user:
  Spec validation error: Target "Project" has a script "SwiftLint" which has a path that doesn't exist "../../wrong-dir/scripts/run_swiftlint_in_xcode_wrapper.sh"

With new implementation with absolute path, it is easier to validate what is wrong with path:
  Spec validation error: Target "Project" has a script "SwiftLint" which has a path that doesn't exist "/Users/SomeUser/dev/fancy-project/wrong-dir/scripts/run_swiftlint_in_xcode_wrapper.sh"

* Display absolute path for invalidTargetConfigFile error print.

Without patch:
  2 Spec validations errors:
	- Target "MM" has invalid config file "../../xcodegen/MM/Build/xcconfig/conan_config.xcconfig" for config "Debug"
	- Target "MM" has invalid config file "../../xcodegen/MM/Build/xcconfig/conan_config.xcconfig" for config "Release"

After fix:
  2 Spec validations errors:
	- Target "MM" has invalid config file path "/Users/MyUser/dev/myproject/xcodegen/MM/Build/xcconfig/conan_config.xcconfig" for config "Release"
	- Target "MM" has invalid config file path "/Users/MyUser/dev/myproject/xcodegen/MM/Build/xcconfig/conan_config.xcconfig" for config "Debug"
2023-04-28 07:52:06 +10:00
Yonas Kolb fd24307120 add a dependency test case 2022-12-09 21:35:17 +11:00
Aleksei Sapitskii 24572daeb5 Added duplicate dependencies validation (#1234)
**Reason**
 - More strict validation of added dependencies

**Contents**
 - Added changelog entry
 - Added check for duplicates in validation stage
 - Added test
2022-07-24 16:08:33 +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
freddi(Yuki Aki) 245f17117a Support test target for local Swift Package (#1169)
* support local Swift Package test case into test scheme

* update test

* add test

* update CHABGELOG.md

* Update CHANGELOG.md

* revert resolved package test

* Update Sources/XcodeGenKit/SchemeGenerator.swift

Co-authored-by: Kohki Miki <giginet.net@gmail.com>

* make TargetReference convert from new JSON format

* add .package for location of target reference

* receive target reference format at target of scheme

* update test

* update XcodeProj

* add test and fix small bugs

* update docs

* support multiple style of coverageTargets

* add edge case of parsing test targets

* fix docs

* Update Docs/ProjectSpec.md

Co-authored-by: Yonas Kolb <yonaskolb@users.noreply.github.com>

* create TestableTargetReference for not making API complex

* fix code format

* fix parameter name to Testable Target Reference

* support directly writing key of Testable Target Reference

* fix compile error in build

Co-authored-by: Kohki Miki <giginet.net@gmail.com>
Co-authored-by: Yonas Kolb <yonaskolb@users.noreply.github.com>
2022-03-20 14:27:29 +11:00
yonaskolb ce787d9e40 use mxcl/Version to fix parsing 2020-02-07 10:49:28 +11:00
Liam Nichols d69b028294 Update SpecValidation to validate TargetReference definitions in the Scheme.Test action. Add additional coverate to ProjectSpectTests 2020-02-06 10:45:21 +00:00
Yuta Saito 8fe5c0cd16 Validate project reference path 2020-01-06 20:51:58 +09: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
Yuta Saito c4305dd02e Add validation for project reference 2019-10-27 09:00:21 +09:00
yonaskolb e9193cfb29 add support for localPackages 2019-09-27 21:36:07 +10:00
yonaskolb fe693c7160 add package validation 2019-09-27 17:10:55 +10: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
Yonas Kolb 7e92db5346 add sdk dependency type 2018-11-04 21:38:07 +11:00
Yonas Kolb 3eaed1ec7c validate incorrect config settings definitions 2018-11-02 18:50:13 +11:00
Brentley Jones 96ac557b96 Refactor minimumXcodeGenVersion to be less pervasive 2018-08-02 07:19:37 -05:00
Brentley Jones 76192fb944 Add minimumXcodeGenVersion option
If XcodeGen's version is less than this version validation will fail.
2018-08-02 07:19:37 -05:00
Keith Smiley 6f95e57f45 Rename to defaultConfig 2018-03-19 15:18:46 -07:00
Keith Smiley e636664aaa Add defaultConfigurationName to options
This allows users to set the defaultConfigurationName project wide. This
setting corresponds to the drop down in the project settings that says
"Use CONFIG for command line builds". This affects which configuration
Xcode looks in for some settings, even if you pass `-configuration FOO`.
2018-03-19 13:47:02 -07:00
Yonas Kolb 0bc2f3415e minor 2017-12-26 22:46:36 +08:00
Yonas Kolb 75e0644b99 wrap long lines 2017-12-26 18:47:18 +08:00
Yonas Kolb 0c1325cc5f remove header comments 2017-11-22 13:01:17 +01:00
Yonas Kolb f8b4b5792e move and rename files 2017-10-29 22:15:02 +01:00