Commit Graph

68 Commits

Author SHA1 Message Date
Maxim Krouk 434dfeca2e Add excludeFromProject option for local packages (#1512) 2025-02-17 16:08:54 +11:00
Juri Pakaste 5644662e5b Respect relativePaths in local package paths (#1498)
* Respect relativePaths in local package paths

Before this a local package defined in an included file would not
respect relativePaths: true.

This fixes #1497.

* Test local package with relative path

* add relative paths support to localPackages syntax

---------

Co-authored-by: Yonas Kolb <yonaskolb@users.noreply.github.com>
2024-12-30 00:41:41 +11:00
Jierong Li d1dd93aac4 Rebase #177 - Shared breakpoints support (#693)
* Resolves #173 - Shared breakpoints support

* Added breakpoints full documentation

* Invalid breakpoint just throw JSONUtilities decoding error.

* Use enumeration types instead of String for extensionIDs

* Remove a necessary line

* Remove unnecessary custom Equatable implementation

* Update CHANGELOG.md

* Ignore empty breakpoints

* Update Docs/ProjectSpec.md

Fix a typo

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

* Change some properties that should be Int to Int

* Create 2 typealiases

* Use BreakpointType where it is missing

* Remove unused Location

* Change some names

* Add Breakpoint.Scope

* Add Breakpoint.StopOnStyle

* Change the type of the raw value to String

* Remove some properties that may cause confusing

* Require filePah and line when the type is .file

* Add tests about decoding breakpoints

* Add Breakpoint.Action.ConveyanceType

* Add default value for waitUntilDone

* Add Breakpoint.Action.SoundName

* Add tests about decoding breakpoint actions

* Fix some issues in ProjectSpec.md

* Improve ProjectSpec.md

* Add missing condition

* Add breakpoints to project.yml

* Use unwarp

* Remove the Breakpoint suffix

* Refactor BreakpointType

* Refactor Breakpoint.Action

* Remove unnecessary properties

* Adjust the line wrapping style for BreakpointGenerator

* Support column breakpoints

---------

Co-authored-by: Alex Rupérez <alejandro.ruperez@intelygenz.com>
Co-authored-by: Yonas Kolb <yonaskolb@users.noreply.github.com>
2023-02-28 22:00:39 +11:00
Craig Siemens 0500db212d Handle imports with same relative path (#1262)
* Added test for when includes contain relative paths with the same name.

* Updated mergedDictionary to handle includes with the same file path.

* Removed the need to multiple places to pass in cachedSpecFiles.

* Converts the projectRoot into a absolute path before loading a project.

* Updated changelog.
2023-01-16 17:57:43 +11:00
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 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
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
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
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