Commit Graph
64 Commits
Author SHA1 Message Date
Mathieu Olivari e7f753785e Fix includes related issues and improve their performances (#1275)
* Fix recursive include path when relativePath is not set

If relativePath is not set on a particular include, the first level of
include will currently work, but starting at the second level of
iteration, the computed include path will fail as relativePath will be
appended over and over onto the filePath. We're fixing that recursion
problem here and adding the corresponding tests to make sure it doesn't
happen again.

* Include projectRoot in include paths

The projectRoot setting (when specified) is currently ignored when
computing the include paths. We're fixing that in that commit.

* Use memoization during recursive SpecFiles creation

SpecFile objects are created by recursive through includes. On a large
project with programatically generated SpecFile, it is not rare to have
hundreds of SpecFiles, creating a large web of include dependencies.
In such a case, it is not rare either for a particular SpecFile to be
included by multiple other SpecFiles. When that happens, XcodeGen
currently creates a SpecFile object every time a SpecFile gets included,
which can lead to an exponential growth of includes.

I have seen hundreds of files being turned into hundred of thousands of
SpecFile object creations, which leads to an impractical XcodeGen run of
tens of minutes.

This change adds memoization during SpecFile recursion, in order to
reuse the previously created SpecFiles, if available, instead of
re-creating them.

* Update CHANGELOG.md

Add the following changes to the changelog:
* b97bdc4 - Use memoization during recursive SpecFiles creation
* a6b96ad - Include projectRoot in include paths
* 557b074 - Fix recursive include path when relativePath is not set
2022-11-03 19:05:46 +11:00
Yonas KolbandOta Mares 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
John Connolly be0c3c3926 Added ability to use custom location for local Swift packages (#1175)
* Added xcodePath functionality

* Added xcodePath functionality

* Renamed Xcode path to group

* Updated change log and added fixture tests
2022-03-25 11:26:06 +11:00
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
Yonas Kolb 7da953a488 swift format 2020-06-17 18:12:34 +10:00
Maciej Piotrowski d741d77159 Fixes dumping project references in Project.swift (#840)
* Update Project.swift

* Update CHANGELOG.md
2020-04-23 12:06:49 +10:00
Michael Eisel c3693d4098 Optimize bottlenecks (#803) 2020-04-03 11:31:48 -05:00
freddi af3a7e0596 Resolve local package name from abstract path
- Also, added Comment
2020-03-19 23:58:52 +09:00
freddi 6bbd90ce4b Removed new style of localPackages implemented at #796 2020-03-19 23:37:07 +09:00
freddi 550df76722 Make SwiftPackage itself as enum 2020-03-19 23:29:46 +09:00
freddi ca8136b62d Removed localPackages variable 2020-03-18 21:32:24 +09:00
freddi d184a9d2b6 Changed how to use reduce at localPackages 2020-03-04 23:01:06 +09:00
freddi b351d592b7 Fixed Test 2020-03-03 22:34:09 +09:00
freddi 0b5585f122 Support Swift Package in local by localPackages 2020-03-03 21:33:18 +09:00
Yuta Saito ce92dd69b4 Replace projectReference.path as relativePath correctly 2019-12-11 20:05:17 +09:00
yonaskolb 0e4e08bfc4 run swift format for Swift 5.1 2019-11-10 11:56:23 +11:00
Yuta Saito d978cf4df2 Rename ExternalProject -> ProjectReference 2019-10-15 15:10:01 +09:00
Yuta Saito 0a43435af3 Merge branch 'master' into external-target-ref 2019-10-10 23:38:45 +09:00
Brian Clymer 7152d6aa9f Address CR. 2019-10-06 15:33:27 -05:00
Brian Clymer 30e1a84566 Working support for scheme templates. 2019-10-02 08:52:22 -05:00
Yuta Saito b96d077252 Merge branch 'master' into external-target-ref 2019-09-30 17:09:04 +09:00
yonaskolb e9193cfb29 add support for localPackages 2019-09-27 21:36:07 +10:00
yonaskolb fa5bd83049 add packages to project spec 2019-09-27 17:10:55 +10:00
Yuta Saito 30fc642b04 Introduce ProjectName/Target syntax to reference target 2019-09-23 00:23:11 +09:00
yonaskolb d921d14259 make format_code 2019-09-01 22:02:53 +10: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
yonaskolb c9de565641 make sure to still handle platform specific templates 2019-03-24 17:24:55 +11:00
Yonas Kolb 94e08a78b5 Fix multi-platform target templates 2019-03-24 17:17:55 +11:00
yonaskolb 32b3d8c362 fix relative paths in included target templates 2019-03-17 19:38:36 +11:00
Yonas Kolb a6ca395033 remove basePath init requirement 2019-01-28 21:51:17 +11:00
Yonas Kolb 862b19aa1a refactor Spec 2019-01-28 21:51:17 +11:00
Yonas Kolb 6f4c7d79ac replace $target_name in target templates 2019-01-28 15:54:56 +11:00
Ell Neal 060aca8327 Rename Project.Spec --> Spec 2019-01-27 15:23:23 +00:00
Ell Neal 71a7ec0588 Move path expansion logic into the spec file 2019-01-27 12:34:17 +00:00
Ell Neal 25a4d48b83 Remove deprecations 2019-01-27 12:24:16 +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 ccf002f8bf Consistent default value and guard check 2019-01-15 12:27:13 +00:00
Ell Neal 8f4c0953b3 Add back deleted public functions and deprecate (prevent breaking public API) 2019-01-15 12:26:47 +00:00
Ell Neal a7e1554115 Expand paths when initializing the Project model from a Spec 2019-01-13 18:22:56 +00:00
Ell Neal 98aeef46dc Implement PathContaining on relevant models 2019-01-13 18:22:34 +00:00
Ell Neal 8928088dfe Use the Spec struct rather than dictionaries directly 2019-01-13 18:14:52 +00:00
Yonas Kolb f04c3e0496 format code 2018-12-18 22:37:22 +11:00
Yonas Kolb 20eaafd246 Merge master into lockfile 2018-11-12 23:07:29 +11:00
Yonas Kolb b438c5e491 remove some emoji from output 2018-11-11 13:25:07 +11:00
Yonas Kolb e30aeee957 add lockfile 2018-11-08 21:35:38 +11:00
Yonas Kolb e7ef30a241 refactoring 2018-11-03 21:33:27 +11:00
Yonas Kolb ea2d38ecdd tweak project description 2018-11-03 20:09:46 +11:00