Commit Graph

521 Commits

Author SHA1 Message Date
Pedro Piñera Buendía 2a69479a7f
Add secret command (#1471)
* Add command for generating a secret

* Document secret command

* Update CHANGELOG

* Rename to edit your projects

* Some style fixes

Co-authored-by: Pedro Piñera <pedro@ppinera.es>
2020-06-23 18:28:47 +02:00
Kas ac502072bc
Migrate info plist generator to a project mapper (#1469)
- The info plist generator is now a project mapper
- This helps keeps project modifications and side effects consistent to some of the others introduced
- Updated `Constants` to create a nested hierarchy for `DerivedDirectory` to allow grouping all related constants
- Updated side effect descriptions such that they are all `CustomStringContvertible` to allow using them in verbose logs

Test Plan:

- Run `tuist generate` within `fixtures/ios_app_with_watchapp2`
- Verify the Info.plist files continue to be generated to the `Derived/InfoPlists` directory
2020-06-22 06:43:22 +01:00
Marek Fořt 154f22b1f3
Add autogenerate schemes mapper to edit. (#1467)
* Add autogenerate schemes mapper to edit.

* Edit changelog.
2020-06-19 08:01:17 +02:00
Marek Fořt 3d369d1717
Runpaths (#1463)
* Use @rpath for dynamic frameworks in tests.

* Remove case-insensitive handler.

* Add @rpath tests.

* Run swiftformat.

* Move isDynamicAndLinkable to PrecompiledNode.

* Fix build issues.

* Edit changelog.
2020-06-19 08:00:41 +02:00
Pedro Piñera Buendía 61c9443f8e
Use the given clean argument when building a single target (#1458)
* Fix build cleaning when it shouldn't

* Update CHANGELOG

Co-authored-by: Pedro Piñera <pedro@ppinera.es>
2020-06-16 12:05:02 +03:00
Marek Fořt d7f167ffa4
Signing install (#1186)
* Install provisioning profile.

* Import signing cert.

* Add SigningInstallerTests.

* Add SecurityControllerTests.

* Add keepFiles option.

* Fix SigningInstaller tests.

* Encrypt files only when necessary.

* Install signing on generate.

* Install signing only when signing dir exists.

* Run swiftformat.

* Make finding signing dir optional.

* Fix typo in keepFiles.

* Name variable in zip.

* Install certs and profiles in SigningMapper.

* Install certs into new keychain.

* Setup signing settings.

* Add signing linting.

* Do not create git changes on generate from reencryption.

* Run SigningInteractor.

* Create keychain at Derived.

* Restrict mutability of TuistCore models.

* Add errors to certificateparser.

* Better error handling.

* Build tests.

* Add Certificate test data.

* Add SigningInteractor tests.

* SigningMatcher tests.

* Add signing mapper tests.

* Fix finding certificate and privateKey.

* Add signing integration tests.

* Minor changes.

* Run swiftformat.

* Fix SecurityControllerTests.

* Edit changelog.

* Fix Xcode 11.3.1 compiler error.

* Fix generate when root dir not found.

* Refactor SigningMapper to be a ProjectMapper.

* Generate keychain into project derived directory.

* Change certificate naming convention.

* Code review changes, fix wildcard support.

* Fix tests.

* Added signing fixture.

* Change handling of duplicate keychain.

* Remove provision profiles from .gitignore.

* Add signing documentation.

* Fix signing section.
2020-06-15 20:59:51 +02:00
Marek Fořt 036fa7559b
Generate tuist generated file into workspace to solve ambiguity. (#1427)
* Generate tuist generated file into workspace to solve ambiguity.

* Edit changelog.

* Move generating tuist-generated file to TuistKit.

* Fix BuildGraphInspector tests.

* Add test for no tuist workspace present.

* Add loadProjectWorkspace method to add tuist-generated to project workspace.

* Run swiftformat.
2020-06-11 20:32:32 +02:00
Pedro Piñera Buendía 168c32ba96
Add support for specifying the build configuration (#1442)
* Add support for specifying the build configuration

* Update CHANGELOG

* Fix tests

Co-authored-by: Pedro Piñera <pedro@ppinera.es>
2020-06-11 01:54:13 +02:00
Romain Boulay cbb01b97e7
Add CacheRemoteStorage foundations (#1420)
* Add client

* [remote_cache] Add the userConfig in the CacheStoraging protocol

* [remote_cache] Rename Storaging to Storing

* [remote_cache] Add MockCloudClienting

* [remote_cache] Updates to ease unit testing

* [remote_cache] Add CloudCacheResponse

* [remote_cache] Silence warning

* [remote_cache] Add CacheRemoteStorage and tests

* [remote_cache] Linting and formatting

* [remote_cache] Fix structural issues

* [remote_cache] Move CloudClienting to the Cloud directory

* [remote_cache] Rename userConfig to config

* [remote_cache] Remove loadConfig function

* [remote_cache] Move resources functions into their respective response classes

* [remote_cache] Propagate errors up

* [remote_cache] Improve type readability in CloudCacheResponse

* [remote_cache] Linting

* [remote_cache] Formatting

* [remote_cache] Fix tests

* [remote_cache] Remove bad import to fix unit test compilation

* [remote_cache] Address comments

* [remote_cache] Rollback throw additions

Co-authored-by: Pedro Piñera <pedro@ppinera.es>
2020-06-10 11:43:17 +02:00
Pedro Piñera Buendía 689a698392
Add support for specifying whether it should clean or not (#1421)
* Add support for specifying whether it should clean or not

* Update CHANGELOG

* Revert change to the Package.resolved

* Fix some issues

Co-authored-by: Pedro Piñera <pedro@ppinera.es>
2020-06-09 10:51:15 +02:00
Marek Fořt 3a245e728b
Edit project in a new temp directory. (#1424)
* Edit project in a new temp directory.

* Edit changelog.
2020-06-07 12:32:44 +02:00
Marek Fořt 5cb6543063
Fix argument parser error with missing CodingKey. (#1425)
* Fix argument parser error with missing CodingKey.

* Fix coding keys error for ScaffoldCommand.

* Edit changelog.

* Run swiftformat.

* Fix running tuistenv.
2020-06-07 11:26:48 +02:00
Pedro Piñera Buendía 11fc74ff38
Build command (#1412)
* Implement the build command

* Fix swiftformat issue

* Require minitest/assertions

* Fix typo

* Pin swift-argument-parser to 0.0.4

Co-authored-by: Pedro Piñera <pedro@ppinera.es>
2020-06-05 13:30:13 +02:00
Pedro Piñera Buendía 5dc8b7ab92
Move the auto-generation of schemes to a mapper (#1357)
* Add empty AutogeneratedSchemesGraphMapper

* Don't generate the schemes at generation time

* Implement AutogeneratedSchemesGraphMapper

* Update CHANGELOG

* Remove unnecessary method

* Turn the graph mapper into a project mapper

* Address some comments

Co-authored-by: Pedro Piñera <pedro@ppinera.es>
2020-06-03 17:41:36 +02:00
Kas c74e3a0e48
Model Mappers (#1378)
(Based on https://github.com/tuist/tuist/pull/1227)

### Short description 

Applying modifications to the `Project` and `Target` models within `GraphMappers` may not always be possible due to the current `Graph` structure. To create a mapper that can generate info plists for example, the both the `Target` and the hosting `Project` needs to be modified. 

e.g.

- #1357 
- #1206

### Solution 

Add "model mappers" that map `TuistCore` models ahead of converting them to a `Graph` representation.

### Implementation
- [x] Add model mappers
- [x] Add recursive manifest loader (loads all manifests without converting them)
- [x] Modify loading process to accommodate model mappers
  - [x] Load all manifests upfront without conversion
  - [x] Lint manifests
  - [x] Convert manifests concurrently to models
  - [x] Apply model mappers

### Test Plan 

- Run `tuist generate` within any of the fixtures
- Verify projects can still be generated as before
- Verify acceptance tests pass
2020-06-02 10:25:36 +01:00
Kas ba279914b7
Add `CachedManifestLoader` (#1341)
Part of: https://github.com/tuist/tuist/issues/1042

- Adding a new caching implementation of the manifest loader
- It works by wrapping the existing manifest loader and adds a caching layer ontop of it
- It attempts to first load a cached JSON representation of the manifest from `~/.tuist/Cache/Manifests` and then falls back to loading the manifest using the default implementation
- The hashes of the manifest content as well the helpers (`ProjectDescriptionHelpers`) are included with the cached manifest
- This allows comparing those hashes during the loading process and ensure the cache is updated from source when needed
- Overall this helps speed up the manifest loading process significantly as loading JSON from disk is much faster than compiling and running Swift manifest
- This approach ensures Swift manifests continue to be the source of truth while offering an optimization for the cases where the manifest doesn't change
- Caching can be enabled / disabled via `TUIST_CACHE_MANIFESTS=1` or `TUIST_CACHE_MANIFESTS=0`
- By default its enabled however this can be changed if we find any issues with this feature

Test Plan:

Modifying manifests:
- Run `tuist generate` on any of the fixtures
- Inspect the generation time
- Re-run `tuist generate`
- Inspect the generation time, which should be faster
  - Note: most gains will be seen in larger projects with several manifests
- Modify any the project manifest (e.g. update the name)
- Re-run `tuist generate`
- Verify the updates are reflected in the generated project (i.e. the cache isn't incorrectly being used)

Modifying helpers:
- Repeat the test using a `fixture/ios_app_with_helpers`
- This time modify `Tuist/ProjectDescriptionHelpers`
- Re-run `tuist generate`
- Verify the updates are reflected in the generated project

Disabling caching:
- Remove the contents of `~/.tuist/Cache/Manifests`
- Run `TUIST_CACHE_MANIFESTS=0 tuist generate` on any of the fixtures
- Inspect the generation time
- Verify no cached manifests are added to `~/.tuist/Cache/Manifests`
2020-05-27 21:27:22 +01:00
Pedro Piñera Buendía dac7cb4659
Add the option to enable/disable the main thread checker from the generated schemes (#1382)
* Update the models in ProjectDescription to add support for enabling the main thread checker

* Set disableMainThreadChecker depending on the given diagnostic options

* Fix tests

* Add unit tests

* Update documentation

* Update CHANGELOG

Co-authored-by: Pedro Piñera <pedro@ppinera.es>
2020-05-27 19:18:51 +02:00
Pedro Piñera Buendía 351982105a
Wait when editing the project (#1356)
* Wait when editing the project

* Update CHANGELOG

Co-authored-by: Pedro Piñera <pedro@ppinera.es>
2020-05-18 17:47:18 +02:00
Pedro Piñera Buendía 62cdcae95c
Add mapper to add build phases that collect and report insights to the cloud (#1335)
* Add commands

* Add cloud options

* Test CloudInsightsGraphMapper

* Return GraphMapperProvider if insights is enabled

* Update CHANGELOG
2020-05-13 13:14:51 +02:00
Pedro Piñera Buendía 142ed6ebfe
Read the Swift version from the system (#1317)
* Read the Swift version from the system

* Update CHANGELOG

* Output a warning when SWIFT_VERSION is set automatically

* Remove warning
2020-05-06 13:38:38 +02:00
Natan Rolnik 6d33025fa9
Make --project-only a Flag again (#1253)
Instead of an Option, in GenerateCommand
2020-04-22 19:34:49 +03:00
Marek Fořt 5c03406d05
Fix clean exit. (#1250)
* Fix clean exit.

* Edit changelog.
2020-04-21 21:56:55 +02:00
Julian e5047ab0aa
Tuist edit locating all manifests under given folder (#1231)
* tuist eidt - added all manifest on tuist edit

* tuist edit - test project editor mapped with more than one Manifest

* tuist edit - updated project editor mapper, added ManifestFileLocatorTest

* tuist edit - updated aceptance test to check all schemes are building

* tuist edit - updated doc about now you can edit all the project manifests

* tuist edit - fix mock ManifestFileLocator.locateAll returning stubs

* fix - swift format

* changelog - updated with new tuist edit behaviour

* Update CHANGELOG.md

Co-Authored-By: Natan Rolnik <natanrolnik@gmail.com>

* tuist edit - fix unit tests

* swift format

* tuist edit - fix TuistKitTests

Co-authored-by: Natan Rolnik <natanrolnik@gmail.com>
2020-04-21 14:08:12 +02:00
Pedro Piñera Buendía b015607b51
Some cloud-related fixes (#1247)
* Use Swift 5.1 build tools

* Support passing the project id when configuring the cloud

* Update CHANGELOG
2020-04-21 12:24:45 +02:00
Natan Rolnik b52424a76b
Settings dictionary improvements (#1229)
* Add SettingsDictionary typealias for [String: SettingValue]

* Add SettingsDictionary functions to avoid using typed strings

* Add new SettingsDictionary functions to Changelog

* Improve changelog with links to PRs and usernames

(of contributors with 3+ PRs)

* Link also to PRs in Changelog

* Add documentation for SettingsDictionary

* Minor update to a SettingsDictionary transformer

* Update Changelog PR number

* Apply PR comments - part 1

* Apply more PR comments - part 2:

- Make SettingValue conform to ExpressibleByBooleanLiteral
- Add tests
- Change code signing methods

* Fix linting in SettingsTests

* Update Docs and Changelog

* Remove some of the SettingsDictionary functions

* Add SettingsDictionary functions table to website docs
2020-04-20 18:29:39 +03:00
Marek Fořt 8337c02bc9
Move from SPM libs to TSC (#1230)
* Convert from SPM libs to TSC.

* Edit changelog.

* Fix flaky duplicate configuration name test.

* Fix lint project duplicate config names.
2020-04-17 08:24:24 +02:00
Marek Fořt 12c87d111e
Argument parser (#1154)
* Implement GenerateCommand and TuistCommand.

* Handle verbose.

* Add GenerateService tests.

* Remove service protocol.

* Revert parser changes.

* Fix swiftlint issues.

* Readd GenerateService.

* Run swiftformat.

* Adopt ArgumentParser library for Up command

* Fix formatting

* Rewrite ScaffoldCommand.

* Rewrite scaffold and list tests.

* Fix running list subcommand.

* Convert InitCommand.

* Add InitService tests.

* Fix double optional.

* Run swiftformat.

* Rewrite Focus command.

* Migrate edit command.

* Migrate dump command.

* Migrate graph command.

* Migrate lint command.

* Migrate Version command.

* Revert "Migrate Version command."

This reverts commit b4a69d89da.

* Migrate Version command.

* Migrate build command.

* Migrate cache command.

* Migrate CreateIssue command.

* Migrate cloud commands.

* Migrate signing command.

* Migrate local command.

* Rewrite env commands.

* Remove env CommandRegistry.

* Fix install tests.

* Fix editor tests.

* Fix processing tuist command.

* Change options to flag.

* Edit changelog.

Co-authored-by: Daniel Jankowski <daniell.jankowskii@gmail.com>
2020-04-13 10:11:12 +02:00
Pedro Piñera Buendía 238d25aca0
Extend GraphMapping protocol to support returning SideEffectDescriptors (#1201)
* Add support for returning side effect descriptors from mappers

* Implement GraphMapperProvider to provide the mapper to be used depending on the config

* Add GraphMapperProviderTests

* Update CHANGELOG

* Test if the descriptors are concatenated in the right order

* Fix CHANGELOG. Some updates showed up in the wrong section
2020-04-09 14:07:20 +02:00
Marek Fořt c1fcfed17b
SwiftUI Template (#1180)
* Change templatePath from String to Path.

* Refactor template content into .stencil files.

* Move shared templates out of default directory.

* Add swiftui template.

* Add fixture for swiftui template.

* Fix SceneDelegate issues.

* Fix macos init.

* Run swiftformat.

* Address minor changes.

* Edit changelog.
2020-04-08 13:27:32 +02:00
Kas c78d68d0f5
Add `TargetNodeGraphMapper` (#1158)
* Add GraphTargetNodeMapper

- Introduce a new component to allow mapping the graph without modifying the original (the graph and models are all reference types)
- The new component also ensures orphaned nodes are removed

Test Plan:

- Verify the tests pass

* Adopt `GraphMapping`
2020-04-06 19:05:19 +02:00
Pedro Piñera Buendía b17192aa98
Update Sources/TuistKit/Commands/Cloud/CloudSessionCommand.swift
Co-Authored-By: Andrea Cipriani <andreacipriani89@gmail.com>
2020-04-03 19:45:21 +02:00
Pedro Piñera Buendía eef7b48b4f
Update Sources/TuistKit/Commands/Cloud/CloudLogoutCommand.swift
Co-Authored-By: Andrea Cipriani <andreacipriani89@gmail.com>
2020-04-03 19:45:14 +02:00
Pedro Piñera 3916ca421b Implement cloud auth, session, and session commands 2020-04-03 17:27:41 +02:00
Pedro Piñera 862ad763b4 Use the cache from the focus command 2020-04-03 14:54:21 +02:00
Pedro Piñera Buendía 15ed9d7f57
Merge branch 'master' into map-graph 2020-04-01 20:26:38 +02:00
Pedro Piñera 794d71b47c Add tests 2020-04-01 19:23:33 +02:00
Pedro Piñera 923a290fb7 Define ProjectGeneratorGraphMapping and some utility classes that conform the protocol 2020-04-01 19:13:17 +02:00
Pedro Piñera 9b016b07a7 Implement authentication logic 2020-04-01 18:21:37 +02:00
Marek Fořt e0607884b0 Expand SigningCommand overview. 2020-03-31 21:29:37 +02:00
Marek Fořt 8a4649c41b Merge branch 'master' into ciphering 2020-03-30 18:53:04 +02:00
Pedro Piñera Buendía 183304963b
Merge pull request #1146 from tuist/graph-without-cache
Decouple Graph from the cache
2020-03-26 07:54:34 +01:00
Pedro Piñera 6c60ee233d Make attributes in Graph normal arrays 2020-03-26 05:27:34 +01:00
Pedro Piñera 9dff608c40 Use WeakArrays 2020-03-25 19:47:26 +01:00
Marek Fořt 49105e2667 Fix scaffold parse function signature. 2020-03-25 17:39:39 +01:00
Pedro Piñera ad49cc95fc Make projects a WeakArray 2020-03-25 11:26:18 +01:00
Pedro Piñera 4f030ab2b0 Make packages a weak array 2020-03-25 09:34:32 +01:00
Pedro Piñera 9cae66bb67 Make precompiled a weak array 2020-03-25 09:16:13 +01:00
Pedro Piñera 437879c428 Make cocoapods a weak array 2020-03-25 09:11:10 +01:00
Marek Fořt cb273f90f0 Merge remote-tracking branch 'origin/master' into ciphering 2020-03-24 22:29:54 +01:00
Marek Fořt 3859f0f539 Fix GeneratorPathsTests. 2020-03-24 22:12:33 +01:00
Marek Fořt 31e7ada595 Error logging, change master.key location. 2020-03-24 21:57:33 +01:00
Marek Fořt 2d307f244d
Merge pull request #1129 from tuist/scaffold_init
Scaffold init
2020-03-24 21:02:41 +01:00
Pedro Piñera 6dccd9700e Fix tests 2020-03-24 20:01:23 +01:00
Pedro Piñera 36e9c5ff88 Move Packages to the Graph object 2020-03-24 20:01:23 +01:00
Pedro Piñera 1a9b2a840d Make projects an attribute of Graph 2020-03-24 20:01:22 +01:00
Pedro Piñera Buendía a59953c086
Merge pull request #1128 from tuist/remove-graphing
Remove the Graphing protocol
2020-03-23 10:59:55 +01:00
Marek Fořt d87f7dca88 Fix argument being registered twice. 2020-03-22 17:39:06 +01:00
Marek Fořt 32ec0e6b88 Merge remote-tracking branch 'origin/master' into scaffold_init 2020-03-22 17:22:01 +01:00
Marek Fořt a6c20539e0 Convert InitCommand to leverage scaffold. 2020-03-22 16:27:34 +01:00
Marek Fořt ea20b63532 Run swiftformat. 2020-03-21 21:10:12 +01:00
Marek Fořt 17f1be6a84 Add example template. 2020-03-21 21:09:52 +01:00
Pedro Piñera c12ea86ff7 Remove Graphing 2020-03-21 19:11:49 +01:00
Marek Fořt ed5532101b Add path arguments. 2020-03-21 16:59:09 +01:00
Marek Fořt 07aac1b99d Merge remote-tracking branch 'origin/master' into signing 2020-03-21 16:46:15 +01:00
Marek Fořt 0b4f14fb83 Run swiftformat. 2020-03-21 13:02:13 +01:00
Marek Fořt c5dfa7e46d Fix passing path arguments on first parse. 2020-03-21 12:26:09 +01:00
Marek Fořt 1edfa4d39e Generate content with stencil. 2020-03-20 16:20:47 +01:00
Marek Fořt 79867adb01 Remove warning from ScaffoldCommand. 2020-03-20 14:07:31 +01:00
Marek Fořt 2bfe16aba4 Rename locateCustom templates method. 2020-03-20 13:56:43 +01:00
Marek Fořt 3701930458 Extend template not found error sentence. 2020-03-20 13:52:59 +01:00
Marek Fořt 224bb7c3f7 Run swiftformat. 2020-03-17 09:49:47 +01:00
Marek Fořt 74ab15d04d Merge remote-tracking branch 'origin/master' into signing 2020-03-16 21:22:11 +01:00
Marek Fořt 9b4de08ef1 Add run code for SigningCommand. 2020-03-16 21:20:26 +01:00
Marek Fořt 944d9feb9d Rename TuistTemplate to TuistScaffold. 2020-03-16 19:11:52 +01:00
Marek Fořt 53a3585290 Support subcommands for SigningCommand. 2020-03-15 17:36:02 +01:00
Marek Fořt ca2cf491c2 Lower macOS version. 2020-03-15 10:07:59 +01:00
Marek Fořt 19d5f1343e Merge remote-tracking branch 'origin/master' into scaffold_load 2020-03-14 21:15:59 +01:00
Marek Fořt 614e37f62a Add documentation, remove unused code. 2020-03-14 21:05:35 +01:00
Marek Fořt 3b3ca1a408 Add tests for custom parsing. 2020-03-14 20:55:12 +01:00
Marek Fořt 9d45a69d42 Refactoring. 2020-03-14 20:21:29 +01:00
Marek Fořt 6eb7bdeb18 Merge branch 'scaffold_models' into scaffold_load 2020-03-14 20:06:34 +01:00
Marek Fořt 28b02d1e3c Custom parse for ScaffoldCommand. 2020-03-12 19:06:50 +01:00
Marek Fořt 111807087d Strip changes to template loading. 2020-03-12 16:42:41 +01:00
Kas ef3071df1e
Generator update - leveraging intermediate descriptors (#1007)
### Short description

When using `TuistGenerator` as a library, the generator component performs several actions:

- Loading of the graph
- Linting the graph
- XcodeProj generation
- Writing generation artifacts to disk
- Post generation actions
 
While convenient it doesn't offer flexibility to perform any custom linting or post processing on the generated XcodeProj representations or to selectively leverage some of those actions without the others.

### Solution

Based on a few early prototyping rounds on [tuist-labs](https://github.com/tuist/tuist-labs/tree/prototype/pipelines) and discussions on modularising Tuist even further, we can split the responsibilities of the generator to provide more flexibility and simplicity.

- Update the generator to return descriptors (it doesn't directly perform any operations - it's side effect free)
- Create a dedicated component to write those descriptions to disk as well as perform any required side effects
- Move some of the interactors that performed side effects out of the xcodeproj generation to help group them (e.g. CocoaPods / Swift PM)
- Create a new top level component to orchestrate all those steps to achieve the previous behaviour

_**Note:** These changes should have no impact on end users of Tuist_

### Implementation

- [x] Prototype `Descriptors` by having existing components return descriptors instead of performing actions (initially as duplicate methods for testing/prototyping)
- [x] Integrate a prototype of a high level `ProjectGenerator` that performs all the previous tasks with the `tuist generate` command
- [x] Verify acceptance tests don't flag any regressions
- [x] Delete duplicate methods (the non-descriptor) variants and update their corresponding unit tests
- [x] Integrate the updated generator with the other tuist commands
- [x] Come up with better component names to clarify their purpose _(current names were temporary to avoid name collisions however could be confusing)_
- [x] Update change log

### Test Plan

- Verify all acceptance tests pass
- Test out running `tuist generate` on any of the fixtures
2020-03-11 15:45:52 +00:00
Pedro Piñera 756c2b8f32 Update the init command to generate the file in the new directory 2020-03-10 18:18:59 +01:00
Pedro Piñera 14124b8422 Rename TuistConfig to Config 2020-03-10 17:28:16 +01:00
Marek Fořt 6a6d40ba68 Strip changes to ProjectDescription models. 2020-03-09 18:49:44 +01:00
Oliver Atkinson b07fa01705 Add Collection+isNotEmpty and remve erronous ')' 2020-03-08 22:08:23 +00:00
Oliver Atkinson 8b459052f6 swiftformat . 2020-03-05 21:48:10 +00:00
Oliver Atkinson 489b5b66b1 Create logger.pretty and use PrintableString 2020-03-05 21:45:40 +00:00
Marek Fořt df5d14b9a0 Decipher signing files. 2020-03-05 22:21:27 +01:00
Marek Fořt 064f55a0bf Add SigningCipher. 2020-03-05 21:55:30 +01:00
Oliver Atkinson f0871503da refactor to use metadata, address code review comments 2020-03-05 19:59:26 +00:00
Oliver Atkinson 52fe8fd119 Merge remote-tracking branch 'origin/master' into verbose-logging 2020-03-05 18:01:17 +00:00
Marek Fořt 3d12aad34f Add success print for Scaffold. 2020-03-03 22:27:20 +01:00
Marek Fořt f8c4d4a7ba Run swiftformat. 2020-03-03 20:05:25 +01:00
Marek Fořt 8222372ece Fix swiftlint issues. 2020-03-03 20:05:02 +01:00
Marek Fořt a47c43dca3 Merge remote-tracking branch 'origin/master' into scaffold 2020-03-03 18:07:18 +01:00
Marek Fořt 1c102a7e1b Fix scaffold fixture. 2020-03-03 18:04:24 +01:00
Marek Fořt ee38f21d6a Remove Playground generator. 2020-03-03 16:26:38 +01:00
Marek Fořt 1f07c30b39 Merge TemplateDescription and ProjectDescription. 2020-03-03 16:17:24 +01:00
Pedro Piñera 8370f38cf0 Add command to lint the projects 2020-03-02 19:30:12 +01:00
Marek Fořt 59209f844a Fix scaffold using swift run. 2020-03-01 16:52:01 +01:00
Marek Fořt 47a1ff62fd Add TuistTemplate tests. 2020-03-01 15:29:01 +01:00
Marek Fořt cd5988308c Add InitCommand and ScaffoldCommandTests. 2020-02-29 21:20:49 +01:00
Marek Fořt f5f7d1dad6 Run templategenerator from init command. 2020-02-29 17:11:57 +01:00
Marek Fořt a80c0a0eae Remove redundat try. 2020-02-29 12:28:38 +01:00
Marek Fořt f2f152aa78 Add path argument for scaffold command. 2020-02-29 11:43:21 +01:00
Pedro Piñera 5e0af454d1 Test the CacheController 2020-02-28 09:47:29 +01:00
Marek Fořt d7df6762a7 Separate template loader to appropriate components, documentation. 2020-02-27 20:44:14 +01:00
Pedro Piñera a25861b0a5 Change the XCFrameworkBuilder to use XcodeBuildController 2020-02-27 19:04:46 +01:00
Pedro Piñera 22a5e70d82 Implement cacher 2020-02-26 18:43:33 +01:00
Marek Fořt 7f8cbd1303 Build TemplateDescriptionHelpers. 2020-02-25 21:17:34 +01:00
Marek Fořt 1b922f8165 Generate directories with attribute. 2020-02-23 22:45:50 +01:00
Marek Fořt a9907e3caf Change attributes syntax input. 2020-02-23 19:16:46 +01:00
Marek Fořt 2faacdbb62 Generate files with script. 2020-02-22 17:27:16 +01:00
Marek Fořt 6cf242fce6 Load Tuist custom templates in tuist edit. 2020-02-18 21:57:20 +01:00
Marek Fořt 536a1fe1a1 Extract Tuist template logic to its own target. 2020-02-18 21:44:06 +01:00
Marek Fořt e511ab7980 Use required attribute from input. 2020-02-18 15:25:40 +01:00
Vytis 350a53ee08
Generate project when editing (#958)
* Pin XcodeProj to a branch until it's merged

* Add a way to specify PathRunnable in custom scheme

* Make scheme buildable when `tuist edit`-ing

* Added changelog entry

* Style correct

* Update Xcodeproj

* Using same path to tuist executable that was used to invoke the edit command

* Update documentation

* style update
2020-02-17 23:11:04 +01:00
Marek Fořt 9cc42da1cd Load custom templates. 2020-02-16 17:45:47 +01:00
Marek Fořt c9f1748900 Generate directories from Template. 2020-02-16 17:05:41 +01:00
Marek Fořt 9642841e0a Print templates with description. 2020-02-16 16:16:49 +01:00
Marek Fořt e93a2fd3eb Load Template.swift. 2020-02-16 12:24:55 +01:00
Marek Fořt 2fb93d37e2 List template names. 2020-02-12 18:51:53 +01:00
Marek Fořt ad2ed05563 Merge remote-tracking branch 'origin/master' into scaffold 2020-02-11 22:33:49 +01:00
Oliver Atkinson ad2ce30c85 WIP: verbose logging as an environment variable 2020-02-09 21:19:56 +00:00
Oliver Atkinson 2cd5d8a06f WIP: Verbose Logging using swift-log 2020-02-09 19:17:28 +00:00
Marek Fořt b93d864cc3 Add Scaffold command. 2020-01-30 20:16:22 +01:00
Pedro Piñera 189502d4d0 Fix styles 2020-01-30 09:33:28 +01:00
Pedro Piñera 8f42cfe846 Generate the project in the temporary directory 2020-01-30 09:28:34 +01:00
Pedro Piñera 5e3b174d8e Fix the issue with the deeply-nested directories when editing the project 2020-01-30 09:02:38 +01:00
ldindu 891ec9fef1 Auto correct with swiftformat 2020-01-05 23:21:41 +00:00
ldindu 4e288a4009 Fixes swiftlint violations 2020-01-04 18:46:29 +00:00
Pedro Piñera 8c15b5388a Generate the sources with the right class name 2019-12-30 19:57:20 +01:00
Pedro Piñera c01652aae2 Reorganize and fix tests 2019-12-26 11:37:03 +01:00
Pedro Piñera 0f5e61480b Create TuistLoader target 2019-12-26 10:52:05 +01:00
Pedro Piñera 267455de7f Create TuistGalaxy & TuistAutomation 2019-12-19 15:42:10 +01:00
Vytis 5c5d260eb0 Using exclude files glob to not include files in the target 2019-12-18 13:25:04 +01:00
ldindu 881ddfdf47
Merge branch 'master' into feature/introduction-xcframework-dependency-type 2019-12-11 20:41:31 +00:00
Adam Khazi 021a6ed3fa
Workspace Schemes (#752)
Resolves https://github.com/tuist/tuist/issues/667

### Short description 📝

A follow up to https://github.com/tuist/tuist/pull/730 where workspace schemes are exposed in the `ProjectDescription`. This is the final step of the steps included in the issue.

### Solution 📦

Expose `TargetReference` for both project and workspace schemes. Users can use `.project(path: "sometime/somepath", name: "targetname")` to reference targets within custom workspace schemes.

Due to how the generation process works (especially how `generatedProjects` are populated in the `ProjectGenerator`), `.project(path: .., name: ..)` we cannot reference remote targets in project schemes yet without some changes in the `ProjectGenerator`. This is not a problem for workspace schemes. Since the `ProjectDescription` `Scheme` is shared by both workspaces and projects, I've added a scheme linting rule to check that targets defined in custom project schemes are within the current project i.e., not referencing remote targets in other projects.

### Implementation 👩‍💻👨‍💻

- [X] Update `ProjectDescription` to support `TargetReference`
- [X] Add Project scheme linter for the referencing remote targets invalid case
- [X] Update fixture `ios_app_with_custom_scheme` to add workspace scheme
2019-12-10 16:05:52 +00:00
ldindu cef36f0975 Introduce a xcFramework dependency type 2019-12-09 21:29:47 +00:00
Pedro Piñera 029ed6375e Fix tests 2019-12-08 19:03:03 -05:00
Pedro Piñera 4dcd37e01e Document some methods 2019-12-08 18:40:55 -05:00
Pedro Piñera 06c96a360f Rename GraphManifestLoader to ManifestLoader 2019-12-08 18:40:55 -05:00
Andrea Cipriani f718f0edce Placate Swiftlint 2019-12-07 22:27:03 +01:00
Andrea Cipriani e071b49662 Hash productName, platform and make sure sources are sorted 2019-12-07 19:19:30 +01:00
Andrea Cipriani 8d22ef1dc2 Improve error handling 2019-12-07 18:23:44 +01:00
Andrea Cipriani c850e8d1e2 Implement Content Hashing for source files 2019-12-07 18:18:45 +01:00
Andrea Cipriani a367935bbf Creates ContentHashingError 2019-12-07 18:18:03 +01:00
Pedro Piñera 34d13282e8 Fix tests 2019-12-07 17:14:44 +01:00
Pedro Piñera 01e894f5e7 Add tests 2019-12-07 17:09:47 +01:00
Pedro Piñera a81b104f17 Add CacheLocalStorage 2019-12-07 16:53:47 +01:00
Andrea Cipriani 907ad91240
Merge pull request #761 from andreacipriani/andrea/graph-contenthasher
Introduce GraphContentHasher
2019-12-07 16:53:16 +01:00
Andrea Cipriani ac5484a7be Revert "Rename graphing to graphable"
This reverts commit 539f215f23.
2019-12-07 16:09:15 +01:00
Andrea Cipriani 539f215f23 Rename graphing to graphable 2019-12-07 16:06:55 +01:00
Pedro Piñera d6bc52382e Add utility to compile xcframeworks 2019-12-07 16:05:48 +01:00
Andrea Cipriani c2325741a0 Make hash a String 2019-12-07 16:02:46 +01:00
Pedro Piñera d2338ee7ab Add tests 2019-12-07 14:27:18 +01:00
Pedro Piñera f05aff599c Add the cache command 2019-12-07 14:22:43 +01:00
Andrea Cipriani 2b298bf00d Return fixed hashes only for frameworks 2019-12-07 14:03:52 +01:00
Andrea Cipriani 9d37c59962 Create GraphContentHasher 2019-12-07 13:49:29 +01:00
Pedro Piñera 9433dc9f9a Style fixes 2019-12-07 13:18:55 +01:00
Pedro Piñera bbdc21c180 Change the generation logic to not include the manifest files in the workspace 2019-12-06 18:11:28 +01:00
Pedro Piñera 69aa5fe82e Some style fixes 2019-12-04 18:02:53 +01:00
Pedro Piñera 03aadf6a73 Add SimulatorsController with a method to list the system's runtimes 2019-12-04 18:02:53 +01:00
Pedro Piñera 83d9d692a4 Add SimulatorRuntime enum 2019-12-04 18:02:53 +01:00
Pedro Piñera e19d00c3ac Add SimulatorRuntimeVersion and tests 2019-12-04 18:02:53 +01:00
Adam Khazi 37e44f5a09
Make Scheme Generation Methods More Generic (#730)
Addresses https://github.com/tuist/tuist/issues/667

### Short description 📝

In order to support custom workspace schemes, we need to make the current scheme generation functions more generic and decouple it from the `Project` type. We now make graph look ups in the project scheme generation functions so that in a follow up pull request it will be easy to add custom workspace scheme support.

*Note that this pull request should make no user facing changes.* 

I've pasted the steps listed in #667 below and marked the items completed by this pull request:
- [X] Changing the functions in the SchemeGenerator to use the graph for look ups by default (as this is the main difference between the project and workspace schemes)
- [X] Update the scheme model (in TuistGenerator) to start referencing targets using the .project(...)
- [ ] Expose workspace scheme type in the project manifest (ProjectDescription)

### Solution 📦

I've added a new `TargetReference` type in place of simple target names of type `String`. `TargetReference` has the name of a target and the relative path to its project. This `TargetReference` type works well for both project scheme generation and workspace scheme generation (in the follow up pull request). This new type enables functions in the scheme generator to do graph lookups to any target in the graph. 

### Implementation 👩‍💻👨‍💻

- [X] Add `TargetReference` type to model
- [X] Change instances of simple target `String` types to `TargetReference` within the `Scheme` type in the model
- [X] Update `GeneratorModelLoader` to convert simple target name `String`s into `TargetReference` types by propagating the project path
- [X] Update instances where a simple target `String` type is expected to work with the name property in `TargetReference`
- [X] Update tests in `SchemesGeneratorTests`, `ProjectGeneratorTests`, `GeneratorModelLoaderTests`
2019-12-03 12:37:57 +00:00
Pedro Piñera 958798752c Add Galaxy manifest file 2019-12-03 08:07:57 +01:00
Maksym Prokopchuk f2a72e3382 Add Testable instead of Target in TestAction 2019-12-01 15:41:21 +01:00
Pedro Piñera 09fd8e0c9e Add unit tests 2019-11-27 18:48:15 +01:00
Pedro Piñera c62a5d171b Support defining paths relative to the root 2019-11-27 18:13:45 +01:00
Pedro Piñera 648810d131 Support formatting through interpolation 2019-11-26 18:22:36 +01:00
Pedro Piñera 64a9e9fd88 Delete manifests target generation 2019-11-26 15:49:32 +01:00
Pedro Piñera b428a3e3cd Some linting issues fixed 2019-11-26 13:16:39 +01:00
Pedro Piñera d5f70c400a Add acceptance tests 2019-11-26 13:16:39 +01:00
Pedro Piñera 2ddcb969fe Block the execution passing the -W argument 2019-11-26 13:16:39 +01:00
Pedro Piñera 22fa2b87c5 Implement edit command 2019-11-26 13:16:39 +01:00
Pedro Piñera 31b32c7aa0 Throw an error if the user tries to edit in a directory that has no editable files 2019-11-26 13:16:39 +01:00
Guilherme Souza 4ffb1c4f5e Added support for custom Archive Action when defining scheme 2019-11-25 20:25:17 +01:00
Pedro Piñera 6b670eca67 Add tests 2019-11-22 09:51:01 +01:00
Pedro Piñera a014289635 Add ProjectEditor utility to generate a project to edit the manifest files 2019-11-21 19:33:51 +01:00
Maksym Prokopchuk 1f1e23925c ProjectDescription.Settings provide none case for default settings 2019-11-20 21:40:49 +01:00
Pedro Piñera 53bdf2adbc Address comments 2019-11-19 10:50:18 +01:00
Pedro Piñera b8cc8ae4a8 Add tests 2019-11-19 10:43:20 +01:00
Pedro Piñera 57b98579a5 Cache the helpers module 2019-11-19 10:43:20 +01:00
Pedro Piñera Buendía 863cb8a9b1
Add TuistCore framework (#669)
* Make the project build

* Fix tests

* Fix test

* Update documentation

* Remove duplicated dependency
2019-11-17 16:21:48 +01:00
Pedro Piñera Buendía b1c2fc8042
Support reusing manifest content across multiple projects (#542)
* Support importing helper files from the manifest that are defined in the TuistConfig/ProjectDescriptionHelpers directory

* Remove TuistDirectoryLocator

* Generate a more complet project

* Add acceptance tests

* Test ProjectDescriptionHelpersBuilder

* Use derived Info.plist files instead

* Address some comments
2019-11-14 19:18:48 +01:00
Kas cda08d84be Support ability to locate multiple Tuist directories (#630)
* Support ability to locate multiple Tuist directories

- The logic has been modified to consult the file system and the cache when traversing the hierarchy

Test Plan:

- Verify unit tests continue to pass

* Update changelog

* Correct test to ensure multiple directories are supported
2019-11-11 15:22:07 +01:00
Kas 7bb8ad7ac7
Add support for watchOS apps (#623)
### Short description 

Adds support for watchOS apps.

### Solution 

Add support for watchOS / watchOS Extension products as well as the appropriate dependency rules.

### Implementation

- [x] Add product types
- [x] Add fixture & acceptance test
- [x] Update graph / link rules
- [x] Add embed watch build phase
- [x] Add watch build settings
- [x] Add linter rules for bundle IDs
- [x] Add linter rules for valid product types
- [x] Update changelog
- [x] Update documentation

### Test Plan

- Run `tuist generate` within `fixtures/ios_app_with_watchapp2`
- Verify the generated project contains a Watch App & Watch App Extension
- Compare against a manually created project with a Watch App
2019-11-06 13:36:43 +00:00
Abbas Mousavi 2b40a38500 Adds codeCoverageTargets to TestAction (#619)
* Adds codeCoverageTargets to TestAction

* Adds documents

* extracts the testCoverageTargetReferences method

* Adds a test

* adds lint
2019-11-04 11:12:53 +01:00
Pedro Piñera Buendía f0af7be763
Add a utility to locate the root directory (#622)
* Add a utility to locate the root directory

* Update the CHANGELOG

* Address Kas' comments
2019-11-01 19:17:45 +01:00
Pedro Piñera Buendía 8df4e6464b
Rename Core to Support (#621)
* Rename Core to Support

* Fix acceptance tests
2019-11-01 08:35:06 +01:00
Pedro Piñera Buendía ce68185eb6
Support relative paths from current file and the manifest's directory (#617)
* Add Path struct

* Use Path for paths instead of String

* Add methods to get the current file directory and the manifest directory

* Fix the way we pass the SECRET_KEY

* Use the right syntax

* Simplify the paths implementation

* Update all path types to be Path

* Fix tests

* Update the fixture to use the new API

* Add documentation

* Don't pass the --tuist-manifest-dir argument

* Implement it as suggested on the PR
2019-10-31 17:44:28 +01:00
Alexander Guschin 819034b56e Add support for sticker pack extension & app extension products (#489)
* Add support for sticker pack product

* Add support for extensions & rename sticker product

* Update documentation

* Add package type for app extensions

* Add tests for app extension integration

* Update product tests

* swiftformat

* Add fixture & acceptance tests

* update change log
2019-10-29 19:42:21 +01:00
Oliver Atkinson 190d48e632 [package-api] Refine API for Swift Packages (#578)
* [package-api] Update package API to better handle multiple dependecies per package

* swiftformat .

* resolve unit test querying wrong lint issue

* [package-api] update ios_app_with_static_library_and_package

* swiftformat .

* swiftformat .

* Rename PackageDependencyNode, refactor LinkGenerator, add comment for Package

* wording

* Remove redundant method parameters

* Update documentation & changelog

* Fix tests
2019-10-29 17:13:00 +01:00
Pedro Piñera Buendía 8ea0956e1d
Embed frameworks using a bash script (#610)
* Delete embed logic

* Add methods to read the dsym path & bcsymbolmap paths from a framework

* Place the tests in the right test case

* Implement EmbedScriptGenerator

* Test EmbedScriptGenerator

* Extract methods that interact with the system into metadata provider utilities and fix tests

* Include output paths

* Test FrameworkMetadataProvider

* Test PrecompiledMetadataProvider

* Add more tests

* Create fixture project

* Add acceptance test

* Address comments

* Use Xcode 11.1

* Update Package.resolved

* Update XcodeProj

* Make the tuistenv install test more resilient
2019-10-29 13:34:02 +01:00
Daniel Jankowski 2e04f8c122 Allow setting deployment target devices (#541)
* Create `DeploymentTarget` descriptor

* Add `DeploymentTarget` to `Target` description

* Fix formatting issues

* Add `DeploymentTarget` to `TuistGenerator.Target`

* Update `TARGETED_DEVICE_FAMILY`

* Fix formatting

* Update `*_DEPLOYMENT_TARGET` in Build Settings

* Fix linter issue

* Make sure `platform` and `deploymentTarget` manifest parameters are compatible

* Move updating a deployment target to `updateTargetDervied` method

* Validate os version of deployment target

* Update Changelog

* Add tests to generator models

* Mark a breaking change in a changelog entry

* Move a regex utility function to `TuistCore`

* Make changes in public API of deployment target

* Fix unit tests of string regex

* Expose `version` property on deployment target

* Update Target documenatation

* Update acceptance tests

* Fix formatting

* Support mac device for iOS deployment target

* Fix lint formatting

* Enable catalyst support only if ipad is enabled for iOS deployment target

* Add deployment target tests to `ConfigGenerator`
2019-10-16 11:37:12 +02:00
Marek Fořt 8ff63bf71c Add XCTAssertThrowsSpecific (#535)
* Add XCTAssertThrowsSpecific and add its usage.

* Print expected error.

* Replace more instances with XCTAssertThrowsSpecific.

* Run swiftformat.

* Fix tests compiler error.

* Updated Changelog.

* Run swiftormat.

* Remove redundant swiftlint disable rule.

* Fix swiftlint violation of line length.
2019-10-10 16:53:46 +02:00