Commit Graph

877 Commits

Author SHA1 Message Date
Pedro Piñera Buendía dfbf829982
Update the linter to work with the graph traverser (#2129)
* Update the Graph linter to use the value graph model instead

* Fix test

* Precompile framework

* Fix Swiftlint issue

* Some style fixes

* Pass macOS deployment target

* Fix acceptance tests
2020-12-20 11:11:36 +01:00
Kas 51ed4838fa
Fix "Embed Frameworks" build phase parameters (#2156)
* Fix "Embed Frameworks" build phase parameters

Resolves: https://github.com/tuist/tuist/issues/2153

- Generated projects had a missing empty `dstPath` parameter for the "Embed Frameowkrs" build phase
- This was discovered while comparing projects where the same phase was added by Xcode (via the UI when embedding frameworks)
- This small mismatch in parmeters results in build failures when linking against Swift Package binary dependencies
- Adding a new fixture that depends on a binary dependency (FirebaseAnalytics)

Test Plan:

- Run `swift build && swift run tuist generate --path fixtures/ios_app_with_remote_binary_swift_package`
- Verify the generated project builds

* Switch fixture to local package with binary target

* Update change log
2020-12-17 12:36:22 +01:00
Pedro Piñera Buendía ace1326f5c
Add Playground sources as playgrounds (#2132)
* Add Playground sources as playgrounds

* Update CHANGELOG

* Update documentation

* Make regex more generic and revert Package.resolved changes

* Address comments

* Filter out the playgrounds from the resources too

* Fix linting issues

* Set the riht xcLanguageSpecificationIdentifier attribute to playgrounds
2020-12-16 14:54:08 +01:00
Kas 1a2c744960
Fix default generated scheme arguments (#2128)
* Fix default generated scheme arguments

- Default profile scheme actions were manually inheriting the run action arguments
- There is a built in mechanism for doing so in Xcode alleviating the need to manually copy them across
- The default run action arguments were always specified even when empty, this produces a scheme with empty list of arguments (which is different from no arguments)

Test Plan:

- Run `swift build && swift run tuist generate --path fixtures/ios_app_with_tests`
- Inspect the generated Project schemes
- Verify the profile action for App has the "Use the Run action's arguments and environment" checked
- Verify the raw `.xcscheme` doesn't contain any commandline arguments nor environment variable entries

* Update changelog
2020-12-09 19:15:56 +01:00
Pedro Piñera 1d37362189 Some style fixes 2020-12-09 13:54:47 +01:00
Daniel Jankowski f79aa689c7
Missing required module 'XXX' when building project with cached dependencies (#2051)
* Missing required module 'XXX' when running unit tests with cached dependencies

* Gather precompiled libraries and frameworks by reusing optimised graph traversing method

* Fix formatting

* Fix formatting

* Add an acceptance test ios_app_with_transitive_project

* Restore 'recursivePrecompiledDependencies' implementation

* Add unit tests to a Graph for linkable and embeddable dependencies (warning: some tests are failing)

* Fix an order of the check for linkable assertion in GraphTests unit test

* Fix the unit tests

* Add more linkableDependencies unit tests

* Add unit tests to ValueGraphTraverser (warning: one test is failing)

* Fix linting and unit tests

* Add more unit tests

* Update unit tests

* Improve comparing the results in unit tests

* Fix formatting

* Add a changelog entry
2020-12-09 13:54:09 +01:00
Pedro Piñera Buendía de2331b9e8
Update generators to use the traverser (#2110)
* Update generators to use the traverser

* Update CHANGELOG

* Fix tests

* Add few missing sorts

* Fix an issue that resulted in not all the nodes being traversed through
2020-12-09 10:44:38 +01:00
Kamil Harasimowicz 80ff34f34e
Init `TuistLintCode` target. (#2079)
* [init_target] add - init `TuistLintCode` target

* [init_target] change - run ` bundle exec rake style_correct`

* [init_target] remove - `TuistLintCodeIntegrationTests` target

* [init_target] remove - `TuistDependenciesIntegrationTests` target

* Rename from TuistLintCode to TuistLinting

Co-authored-by: Pedro Piñera <pepibumur@gmail.com>
2020-12-08 10:51:33 +01:00
Luis Padron 54900f2640
Project Plugins: Add GitHandler Service (#2107)
* Project Plugins: Add GitHandler Service

* Update Sources/TuistSupport/Utils/GitHandler.swift

* Fix linting issues

Co-authored-by: Pedro Piñera <pepibumur@gmail.com>
2020-12-07 17:42:03 +01:00
Kas 46be137dc8
Fix `ValueGraphTraverser.directTargetDependencies` to return local targets only (#2111)
- The equivalent method of `directTargetDependencies` in the reference Graph used to return local targets only
- Updated the value graph traverser to behave in a similar fashion
- Updated unit tests to include a scenario that could catch this

- **Note:** This fixes an issue that previously allowed extension targets to be defined in a separate project (which isn't a supported dependency type)

Test Plan:

- Verify unit tests pass
2020-12-07 17:03:33 +01:00
Luis Padron 441e154426
Project Plugins: Add TuistCore Plugin Models (#2103)
* Project Plugins: Add TuistCore Plugin Models

* Address PR comments
2020-12-05 08:50:27 +01:00
Pedro Piñera Buendía 211dd8a50b
Merge pull request #2077 from hebertialmeida/copy-files
Add support for copy files phase
2020-12-05 08:48:27 +01:00
Pedro Piñera 47bbc00f52 Define all graph methods in the traverser protocol and provide an implementation for the value graph traverser 2020-12-04 10:29:00 +01:00
Heberti Almeida 1312545433
Moved cleanPackages to ManifestMapper
Moved cleanPackages to ManifestMapper to avoid inconsistency  between `ProjectFileElements` and `BuildPhaseGenerator` as per @kwridan’s suggestion
2020-12-03 22:01:09 -05:00
Pedro Piñera Buendía 92c01ce34c
Merge pull request #2097 from bloomberg/fixes/framework-search-path-dir
Fix framework search paths for SDK dependencies
2020-12-03 10:08:50 +01:00
Pedro Piñera Buendía 11b611983b
Merge pull request #2095 from tuist/plugins/add-plugin-manifest
Project Plugins: Add Plugin.swift manifest.
2020-12-03 09:56:15 +01:00
Kassem Wridan bf5f7ca428 Fix framework search paths for SDK dependencies
Resolves: https://github.com/tuist/tuist/issues/1937

- System & Developer SDK nodes were accidentally swaped in the graph loading logic
    - `.xctest` is a developer SDK vs others are system
- System SDKs do not require any special additional framework search paths as such this has now been removed

Test Plan:

- Run `swift build && swift run tuist generate --path fixtures/ios_app_with_sdk`
- Inspect the generated project
- Verify framework search paths are not added for system SDKs
- Verify `MyTestFramework` continues to build successfully
2020-12-03 07:24:43 +00:00
David Harris e66df79a40 fix: make watch targets runnable to fix schemes in Xcode 12 2020-12-02 16:59:21 -05:00
Heberti Almeida 727e399586
Add tests for targetFiles 2020-12-01 20:23:05 -05:00
Luis Padron 2116af8841 Project Plugins: Add Plugin manifest. 2020-12-01 11:26:33 -05:00
Heberti Almeida 8b176d7c5e
Adding test for copy files action phases generation 2020-12-01 02:04:01 -05:00
Marek Fořt efc7df8500 Generate more project schemes if there are multiple platforms. 2020-11-28 16:42:16 +01:00
Heberti Almeida d0e0a96dcd
Reuse the AbsolutePath check for package 2020-11-27 15:11:36 -05:00
Heberti Almeida dc651b2a2b
Fixed most linter warnings 2020-11-27 14:56:32 -05:00
Heberti Almeida 46d3e68680
Fixed contentHashing integration test 2020-11-27 13:55:13 -05:00
Heberti Almeida 9cbfeb607b
Draft implementation for copy files action 2020-11-27 13:26:00 -05:00
David Harris e7d4923740
feature: add DeploymentTarget cases for watchOS (#2029) 2020-11-26 22:36:17 +01:00
Łukasz 9f94c3c9e1
Skip linting for target with bundle identifier derived from build settings (#2031)
* Check if bundle id matches build setting pattern

* Update changelog

* Improved regex

* Modify ios_app_with_signing fixture

* Update changelog

* Code format
2020-11-26 22:32:25 +01:00
Marek Fořt 851999f132 Fix hashing of preaction when it has no path. 2020-11-25 15:48:00 +01:00
Pedro Piñera 50b3a4072c Add tests 2020-11-22 18:06:09 +01:00
Pedro Piñera Buendía 4207aeb2fe
Merge pull request #2058 from tuist/ignore-other-directories
Add Package.swift to subdirectories
2020-11-22 13:25:07 +01:00
Pedro Piñera 868c48e8a5 Fixes 2020-11-22 09:45:57 +01:00
ferologics 668f821c61 Merge remote-tracking branch 'upstream/main' into main 2020-11-21 22:06:15 +01:00
ferologics 429336ac21 Add test for macOS test target TEST_HOST 2020-11-21 22:02:25 +01:00
Pedro Piñera cb43053930 Fix style 2020-11-21 19:27:18 +01:00
Pedro Piñera cb91a6c824 Fix compilation errors 2020-11-21 19:22:31 +01:00
Pedro Piñera 79e14bdedc Style fixes 2020-11-21 18:44:10 +01:00
Jakub Olejnik d55827cd5b Run swiftformat 2020-11-18 17:42:40 +01:00
Jakub Olejnik aa58a7fe34 Internally fix deprecated APIs 2020-11-18 16:53:26 +01:00
Jakub Olejnik 3141a94169 Remove `TuistCore.Arguments` init with launchArguments dictionary 2020-11-18 16:16:18 +01:00
Jakub Olejnik c7335dc775 Correct style 2020-11-18 00:04:38 +01:00
Jakub Olejnik 0cde5cdc7f Add tests for scheme launch arguments order 2020-11-17 23:34:42 +01:00
Jakub Olejnik 9eae364a50 Add `LaunchArgument` struct 2020-11-17 18:53:43 +01:00
Peter Weishapl 114bfa7869 add basic support for test plans 2020-11-16 08:38:05 +01:00
kodiakhq[bot] eead4911f2
Add GenerationOption to enable code coverage (#2020)
Resolves [no ticket]

### Short description 📝

Code coverage is not enabled when schemes are automatically generated. To enable it, one needs to define a scheme manually to enable `Coverage` and set `codeCoverageTargets`. 

This change introduces a new `generationOption` case: `enableCodeCoverage` that will enable code coverage for automatically generated schemes.

### Solution 📦

I started by attempting to update Project.swift with a manually-defined scheme to enable code coverage, but there are a lot of projects in our workspace and it seemed like a broader solution would be more useful than one that would require touching each project (and potentially ensuring the stand-in schemes are kept up-to-date).

I started with my colleague @kalkwarf's PR #1782 and used that as a guide to make similar changes in what seemed like appropriate places including the generator code, tests, and documentation.

This change doesn't introduce any breaking changes and hopefully avoids any unnecessary complexity, while making it possible to enable code coverage with one line: 
```
let config = Config(
  generationOptions: [
    // your options here
    .enableCodeCoverage,     <-- this one :-)
  ]
)
```

### Implementation 👩‍💻👨‍💻

- [x] Extend `GenerationOptions` enum with `enableCodeCoverage` case.
- [x] Update `AutogeneratedSchemesProjectMapper` to initialize with `TuistCore.Config` .
- [x] Check config to to enable code coverage and generate code coverage targets.
- [x] Update `AutogeneratedSchemesProjectMapperTests` to verify new behavior.
- [x] Checked that existing tests would fail if the they were run with the new option.
- [x] Added new case to `docs/usage/config.mdx`.


### **One more thing™** 
~This is a draft since I am not sure the test configuration this produces is correct, but I wanted to get eyes on the changes to the project in general.~ Looks like the coverage config is good to go! Thanks for reading!!
2020-11-12 16:40:16 +00:00
Ian Meyer 125c36af71 Add parameter name to AutogeneratedSchemesProjectMapper init to improve clarity. 2020-11-12 09:52:09 -05:00
Ian Meyer e5548b9be9 Clean up test setup and remove ProjectDescription dependency. 2020-11-12 09:50:25 -05:00
Ian Meyer 6b37cd6274 Corrected test to generate test with code coverage 2020-11-11 13:05:35 -05:00
Ian Meyer 8f02636ad3 Pass code coverage preference to AutogeneratedSchemesProjectMapper directly instead of entire TuistCore.Config 2020-11-11 09:59:50 -05:00
Jakub Olejnik d9d4d7374a Merge branch 'main' into cli_tool 2020-11-11 12:12:13 +01:00