Commit Graph

521 Commits

Author SHA1 Message Date
Marek Fořt 29b683c1e2
Search manifests only in current directory when passed (#3097) 2021-06-25 11:15:16 +02:00
Wojciech Kulik 0d41afa378
Added disableBundleAccessors config generation option (#3088)
* Added disableBundleAccessors config generation option

* Code review changes

* Fixed formatting
2021-06-22 08:30:52 +02:00
Marek Fořt 77ec006674
Rename ValueGraph to Graph (#3083) 2021-06-21 08:30:12 +02:00
Marek Fořt 30482ff513
Fix tuist edit when path has spaces (#3084)
Resolves https://github.com/tuist/tuist/issues/3081

- Wrap paths into quotation marks

Test Plan:

- Create a Project.swift file in a folder with spaces in the path
- `tuist local 1.44.0`
- `tuist bundle`
- `tuist edit`
-  Attempt the build the Manifest project
- Verify it succeeds without errors
2021-06-21 06:42:42 +01:00
Daniel Jankowski 35fa0d1224
Add --skip-ui-tests parameter to tuist test command (#2832)
* Add --skip-ui-tests parameter to tuist test command

* Add changelog entry

* Fix formatting

* Add unit tests target in tests

* Rename PruneUITestsProjectMapperTests to SkipUITestsProjectMapperTests

* Rename skipUiTests to skipUITests

* Restore Package.resolved

* Update documentation

* Get rid of short for skip ui tests flag and update the docs
2021-06-19 21:13:50 +02:00
Marek Fořt e69f70b03f
Tasks plugin (#3013)
* Create Tasks model

* Run custom task

* Create tasks fixture test

* Add task options

* Rename load arguments for Tasks

* Foprmat code

* WIP: Change tasks to work with multiple files

* Run task without options

* Parse options with regex

* Remove optional and required options

* Move Task model to ProjectAutomation

* WIP: Editing tasks

* Editing tasks

* Add task documentation

* WIP tests

* Add tests

* Format code

* Rename task command to exec

* Create PluginTasks

* Add tasks plugin fixture

* Add tests

* Add documentation

* Format code

* Edit CHANGELOG

* Fix typo

* Update projects/docs/docs/plugins/creating-plugins.md

Co-authored-by: Luis Padron <luis.padron@compass.com>

Co-authored-by: Luis Padron <luis.padron@compass.com>
Co-authored-by: Pedro Piñera Buendía <pedro@ppinera.es>
2021-06-01 13:09:38 +02:00
Luis Padron 11ded30e81 Add `tuist run` command 2021-05-29 12:59:57 -04:00
Kamil Harasimowicz 99f095e113
Allow to specify `swift-tools-version` in the `Dependencies.swift` manifest file. (#2998)
* [swift-tools-version] add - `SwiftPackageManagerControlling.setToolsVersion`

* [swift-tools-version] remove - hardcoded `// swift-tools-version:5.3`

* [swift-tools-version] add - `Config.swiftToolsVersion`

* [swift-tools-version] change - move `Config.GenerationOption.swiftToolsVersion` to `Config.swiftToolsVersion`

* [swift-tools-version] change - move `Config.swiftToolsVerstion` to `SwiftPackageManagerDependencies.Options.swiftToolsVersion`

* [swift-tools-version] add - `SwiftPackageManagerDependencies.swiftToolsVersion`

* [swift-tools-version] change - update `swift-tools-version`

* [swift-tools-version] change - update `app_with_framework_and_tests_and_dependencies"

* [swift-tools-version] change - update documentation

* [swift-tools-version] fix - remove unused comments

* [swift-tools-version] fix - run `./fourier format swift --fix`

* [swift-tools-version] change - update changelog

* [swift-tools-version] fix - fixes after updating with `main`

* [swift-tools-version] fix - acceptance tests

* [swift-tools-version] change - move `SwiftPackageManagerDependencies.Options.swiftToolsVersion` to `Config.swiftVersion`

* [swift-tools-version] fix - acceptance tests

* [swift-tools-version] change - update changelog

* [swift-tools-version] change - update documentation

* [swift-tools-version] fix - run `./fourier format swift --fix`
2021-05-27 09:22:57 +02:00
Pedro Piñera Buendía 6e58ef29d6
Cloud to lab (#2993) 2021-05-22 09:58:02 +02:00
Daniele Formichelli 47302ff08f
[Scaffold] Wire plugins to `tuist scaffold list` command (#2958)
* feat: wire plugins to `tuist scaffold list` command

* docs: add changelog entry

* test: add test for `tuist scaffold list` with plugins

* Fix linting issues

Co-authored-by: Pedro Piñera <pedro@ppinera.es>
2021-05-21 15:12:26 +02:00
Marek Fořt 1f776e728f
Tasks (#2816)
* Create Tasks model

* Run custom task

* Create tasks fixture test

* Add task options

* Rename load arguments for Tasks

* Foprmat code

* WIP: Change tasks to work with multiple files

* Run task without options

* Parse options with regex

* Remove optional and required options

* Skip building project description helpers for tasks

* Move Task model to ProjectAutomation

* WIP: Editing tasks

* Editing tasks

* Add task documentation

* WIP tests

* Add tests

* Format code

* Limit file named in step definitions

* Fix ruby code format

* Rename task command to exec

* Trigger CI workflows

Co-authored-by: Pedro Piñera <pedro@ppinera.es>
2021-05-20 12:28:11 +02:00
Luis Padron ae9525f361 Add --build-output-path argument to 'tuist build' 2021-05-07 09:20:32 -04:00
Kamil Harasimowicz 8a926b236c
[Dependencies.swift] Implement `tuist dependencies update` command. (#2819) 2021-05-03 13:33:14 +02:00
Alfredo Delli Bovi 3117deeb0d
Add support for specifying cache directory (#2566) 2021-04-18 17:43:34 +02:00
Marek Fořt 0b47cc400d
Resource synthesizer plugin (#2746)
* Fix unit tests

* Run default resource synthesizer

* Add synthesizer plugin

* Integrate resource synthesizer plugin

* Allow custom initializer

* WIP: Resource synthesizer path

* Load plugin template during mapping

* Add missing parsers

* Add tests

* Add documentation

* Run swiftformat

* Include stencil plugin files in tuist edit

* Address review comments

* Fix tests

* Fix usage of assets

* Move ResourceSynthesizers documentation to new location

* Add Project documentation

* Refactor to use convention for local template files

* Rename ResourceTemplates dir to ResourceSynthesizers

* Fix resources link

* Rename ResourceSynthesizerPlugin to PluginResourceSynthesizer

* Edit CHANGELOG

* Fix build issues

* Format code

* Fix broken link
2021-04-13 19:46:24 +02:00
Kas 45b25b064c
Remove unused `GeneratorModelLoading` protocol (#2798) 2021-04-12 16:40:08 +02:00
Kamil Harasimowicz 19378bb4b6
[Chimera] Fetching SPM dependencies. (#2394) 2021-04-10 21:04:17 +02:00
Daniele Formichelli ff1252621c
[Dump] Fix `tuist dump` when plugins are used (#2700) 2021-03-30 21:11:42 +02:00
Daniele Formichelli e56fb21c51
[Chore] Fix swiftlint warnings (#2705)
* chore: fix swiftlint warnings

* chore: fix swiftformat

* chore: fix swiftformat
2021-03-26 15:14:22 +01:00
Luis fff61db922 Plugins: Add support for templates 2021-03-25 08:49:32 -04:00
Kas 61e387e609
Simplify graph loading process for services (#2692)
- The graph loading process has been split into finer grained components over the past year to accomodate several ehancements to the `generate` command like, concurrent loading, mappers, plugins and more
- This has sadly made loading graphs outside of the generator a bit more verbose and error prone
    - The `tuist graph` command fails in cases where a project has a dependency in another project due to leveraging the incorrect loading sequence
- To address this, a new component `ManifestGraphLoader` has been created in `TuistKit` to allow services that require the graph without any additional features to easily load by specifying a path (i.e. a simplified version of Graph Loader)
- The component ensures that plugins are loaded ahead of the loading process
- The `graph` acceptance tests have been enabled to help catch any future regressions to the graph command

Test Plan:

- Run `swift build && swift run tuist graph --path fixtures/ios_app_with_custom_workspace/App`
- Run `swift build && swift run tuist lint code --path fixtures/ios_app_with_custom_workspace/App`
- Run `swift build && swift run tuist lint project --path fixtures/ios_app_with_custom_workspace/App`
2021-03-25 06:34:32 +00:00
Marek Fořt 1489ae6d7d
Remove reference type Graph (#2689)
* Use ValueGraphLoader where possible

* Remove old graph

* Edit CHANGELOG

* Make SystemFrameworkMetadataProvider a property
2021-03-21 14:05:40 +01:00
Marek Fořt 093f6a5fa9
Value graph mappers (#2683)
* Migrate GraphMapping and Generator to ValueGraph

* Remove deprecated map graph methods

* Edit CHANGELOG
2021-03-19 08:17:33 +01:00
Marek Fořt 9c1db8418d
Migrate TestsCacheGraphMapper to ValueGraph (#2674)
* Migrate TestsCacheGraphMapper to ValueGraph

* Migrate UpdateWorkspaceProjectsGraphMapper
2021-03-17 13:32:06 +01:00
Pedro Piñera Buendía eab5b3e0e2
Tuist support tests (#2648)
* Generate tests and testing

* Add Fourier commands for testing support

* Add focus command

* Update CHANGELOG

* Fix test

* Add missing tests

* Fix formatting issues

* Fix tests

* Some style fixes

* Don't use 12.0
2021-03-16 22:06:28 +01:00
Marek Fořt 9759e885c6
Tuist test derived data (#2563)
* Create DerivedDataLocator.

* Generate projects to the same directory in tuist cache
2021-03-16 18:12:44 +01:00
Luis Padron d46543d3cc
Plugins: Finalize support for tuist edit (#2642) 2021-03-15 10:53:55 +01:00
Shai Mishali 3d7d381933
Support resolving SPM dependencies using system SCM (#2638)
This adds the ability to pass `-scmProvider system` to `xcodebuild -resolveDependencies` so it uses the system's credentials for Git, for example, instead of forcing users to add their Git account to Xcode's Accounts tab.
2021-03-10 14:41:16 +01:00
Jakub Olejník ff10fa1aa2
Add support for file header template (#2568)
When working in teams, various file header templates might apply. This is done by [using `IDETemplateMacros.plist`](https://help.apple.com/xcode/mac/current/#/dev91a7a31fc) inside xcodeproj. This plist might be shared so located under `xcshareddata` and also user-specific. This PR currently addresses shared case.

- A new `fileHeaderTemplate` property is exposed on both `Project` and `Workspace`
    - Users can optionally choose if they'd like to define at the workspace level for larger multi-project setups, or on an individual project for small single project setups
- The header template supports two options, reading from a file on disk via `.file(Path)` or inline in the manifest via `.string(String)`
2021-03-09 06:51:49 +00:00
Kamil Harasimowicz acb030a40f
Renaming `TuistGraph.Dependency` -> `TuistGraph.TargetDependency` (#2614)
* [dependency-models-naming] change - rename `TuistGraph.Dependency` -> `TuistGraph.TargetDependency`

* [dependency-models-naming] change - update changelog
2021-03-08 07:51:04 +01:00
Marek Fořt 09344774cf
Add wrap arguments swiftformat option (#2606)
* Add wrap arguments before-first format option.

* Run style correct.

* Edit CHANGELOG.
2021-03-04 11:54:03 +01:00
Luis Padron 457db0367d
Plugins: Add support for editing plugins. (#2548) 2021-03-03 21:16:06 +01:00
Marek Fořt 89f8016534
GraphViz migration to ValueGraph (#2542)
* Convert build service to use value graph.

* Migrate doc service to use value graph.

* Build migrate BuildGraphInspector.

* Edit CHANGELOG.

* Remove TargetNodeGraphMapper.

* Migrate GraphViz to ValueGraph.

* Fix style attributes for target.

* Run style correct.

* Edit CHANGELOG.

* Fix depends on XCTest.

* Do not include external dependencies if they should be skipped.

* Rename directTargetDependencies to directLocalTargetDependencies.

* Implement directTargetDependencies.

* Run style correct.
2021-02-24 20:21:13 +01:00
Kas 37510e8eca
Add dedicated ConfigLoader component (#2550)
- To aid the migration from `Graph` to `ValueGraph`, a new `ConfigLoader` component is being added
- This will allow decoupling config loading from graph loading (configs are not tied to graph, they are standalone manifests/models)
- Replaced all usages where config loading was required to leverage the dedicated component instead of the graph loader or the model loader

Test Plan:

- Verify all unit tests pass
- Smoke test running the generation process on a few fixtures where configs are defined
2021-02-24 06:38:59 +00:00
Kamil Harasimowicz 31f3aba514
Dependencies.swift - Add XCFramework option for Carthage (#2532)
* [carthage-xcframeworks] add - `CarthageController`

* [carthage-xcframeworks] add - `MockCarthageController`

* [carthage-xcframeworks] change - use `TusitSupport.CarthageController` in `TuistDependencies.CarthageInteractor`

* [carthage-xcframeworks] add - `produceXCFrameworks` argument to `CarthageCommandGenerating.command` method

* [carthage-xcframeworks] change - redesign `Depedencies` model (ProjectDescription&TuistGraph)

* [carthage-xcframeworks] change - adapt `app_with_framework_and_tests_and_dependencies` to changes

* [carthage-xcframeworks] change - update docs

* [carthage-xcframeworks] change - produce XCFrameworks when required

* [carthage-xcframeworks] add - more logs

* [carthage-xcframeworks] fix - acceptance test

* [carthage-xcframeworks] add - documentation

* [carthage-xcframeworks] change - typos

* [carthage-xcframeworks] change - run `bundle exec rake style_correct`

* [carthage-xcframeworks] fix - swiftlint violations

* [carthage-xcframeworks] change - update changelog

* [carthage-xcframeworks] change - redesign `ProjectDescription.Dependencies` model

* [carthage-xcframeworks] fix - acceptance tests

* [carthage-xcframeworks] change - update documentation

* [carthage-xcframeworks] change - run `bundle exec rake style_correct`

* [carthage-xcframeworks] fix - typos

* [carthage-xcframeworks] change - update docs

* [carthage-xcframeworks] change - run `bundle exec rake style_correct`

* [carthage-xcframeworks] fix - typos
2021-02-23 10:38:57 +01:00
Josh Holtz 5c7ea50729
Add --strict to 'lint code' command (#2534)
* Add --strict to 'lint code' command

* Updated CHANGELOG

* Update tests

* Added tests

* Tests

* This works

Co-authored-by: Pedro Piñera Buendía <pepibumur@gmail.com>
2021-02-18 11:46:20 +01:00
Mauro Bolis 89d3ecf2c3
Fix graph command when plugins are involved (#2507)
* Fix graph command when plugins are involved

* Add plugin in microfeature architecture fixture

* Fix CHANGELOG
2021-02-17 17:41:31 +01:00
Marek Fořt 5c0d9efe01
ValueGraph BuildGraphInspector (#2527)
* Convert build service to use value graph.

* Migrate doc service to use value graph.

* Build migrate BuildGraphInspector.

* Edit CHANGELOG.

* Remove TargetNodeGraphMapper.
2021-02-17 17:40:51 +01:00
Marek Fořt b4b8dab8ac
Selective tests hash (#2422)
* Add derived data path to test command.

* Hash all tests targets files.

* Use temporary tests cache directory and save it after successul run.

* Fix path locations.

* Fix no test schemes found.

* Remove debug paths.

* Save hashes only if all project schemes are run.

* Prepend input paths with $(SRCROOT).

* Add SourceRootPathProjectMapper.

* Add tests for derivedDataPath.

* Rewrite tests hashing to ValueGraph.

* Add tests for TestsGraphContentHasher.

* Add TestsCacheGraphMapperTests.

* Revert back to using old Graph.

* Add tests for TestsCacheGraphMapper.

* Add tests for TestService.

* Add automation path option.

* Add tests cache acceptance test.

* Add caching documentation.

* Minor changes.

* Fix tests that had PROJECT_DIR.

* Fix SRCROOT for script paths.

* Fix embed script generator.

* Fix target generator tests.

* Add decision record.

* Edit CHANGELOG.

* Fix project scheme not found.

* Refactor GraphContentHasher to be agnostic to cache.

* Adjust decision record.

* Add testsCacheTemporaryDirectory to tearDown.

* Fix test acceptance test.

* Fix ContenthashingIntegrationTests.

* Add additionalStrings parameter.

* Move automation path to env variables.

* Create interface for generating Generator.

* Fix hashing of derived info plist.
2021-02-16 17:10:10 +01:00
Andrea Cipriani ab82a8c94c
Set _superCommandName in all sub-commands (#2508) 2021-02-14 21:13:00 +01:00
Daniel Jankowski 40f449fa07
Introduce caching profiles (#2431)
* Introduce cache profiles

* Add changelog entry

* Fix unit tests for content hashing

* Apply review feedback

* Move cache options to a separate file

* Fix unit tests after merge conflicts

* Cleanup the docs after main rebase
2021-02-11 10:17:27 +01:00
Alfredo Delli Bovi 5ac7fedf3b
Enable coverage for Project scheme when setting enableCodeCoverage (#2493) 2021-02-10 18:38:10 +01:00
Alfredo Delli Bovi e1db040d4a
Add support for tuist cache warm to cache a subset of targets (#2393) 2021-02-10 08:52:57 +01:00
Pedro Piñera Buendía e4e8fe8cf1
Update post-generation interactors to use the graph traverser (#2451) 2021-02-06 13:01:19 +01:00
Alfredo Delli Bovi e34c5baea4
Add support for tuist graph to show a subset of targets (#2434) 2021-02-05 20:22:47 +01:00
David Harris 7b36b99842
fix: update brew list commands for graphviz (#2446)
* fix: update brew list commands for graphviz

* Update CHANGELOG for brew list fix
2021-02-05 20:05:09 +01:00
Luis Padron 14844ded3f
Project Plugins: Integrate plugins service. (#2327)
- Add logic for loading Plugin manifests.
- Add build step for building helper plugins as part of
ProjectDescriptionHelpers.
- Update tests
- Add fixture to test plugins workflow.
2021-02-03 17:38:26 +01:00
Daniele Formichelli dedf5bb507
Fix: read configuration from project if Target.settings is nil (#2399)
* fix: fix reading configuration from project if target.settings is nil

Fix for https://github.com/tuist/tuist/issues/2370

* docs: add changelog entry

* fix: compilation error

* chore: fix formatting

Co-authored-by: Marek Fořt <marekfort@me.com>
2021-02-02 21:34:53 +01:00
Andrea Cipriani 74f1390628
Send Analytics events to stats.tuist.io (#2331)
* Send events to https://stats.tuist.io/

* Update TuistComand to send event

* Update AsyncQueue tests to reflect changes in API

* Add CommandEventFactoryTests

* Fix trackable command tests

* Swift format/lint

* Format

* Removed unused class

* Update documentation comment

* Update Changelog

* Allow opt-out via TUIST_STATS_OPT_OUT env variable

* Make duration in ms

* Clean Environment.shared.isStatsEnabled

* Make async queue completion more explicit

* Add AsyncExit
2021-02-02 13:58:43 -05:00
Daniel Jankowski 8404aaf268
Add 'profile' option to 'cache warm' command (#2221) 2021-02-02 08:20:40 +01:00