Commit Graph

336 Commits

Author SHA1 Message Date
Oliver Atkinson bff3e99d67 [codesign-frameworks] fix broken test after moving the framework signing to after it was copied 2019-06-08 12:03:58 +01:00
Oliver Atkinson 2bfcfd1235 [codesign-frameworks] fix typo 2019-06-08 11:52:56 +01:00
Oliver Atkinson f5a01e8ecd [codesign-frameworks] code review comments and ensure codesigning is done after the framework has been copied 2019-06-08 11:52:56 +01:00
Oliver Atkinson 91f7737197 [codesign-frameworks] if CODE_SIGNING_IDENTITY is defined ensure the framework is signed when embedding 2019-06-08 11:52:36 +01:00
Pedro Piñera Buendía a920a13f54
Support none defaultSettings (#395)
* Support none defaultSettings

* Update changelog

* Document .none default setting

* Use simple quotes
2019-06-07 19:52:45 -07:00
Pedro Piñera Buendía 41c36d507e
Add .d as a valid source extension (#396)
* Add .d as a valid source extension

* Update CHANGELOG
2019-06-07 07:21:02 -07:00
Kas 1f47fc0fdb
Ensuring the correct default settings provider dependency is used (#392)
- The `defaultSettingsProvider` passed to the `Generator` wasn't being passed along to the `ProjectGenerator`
- This led to having 2 different implementations running side by side
- Sadly this got missed in a previous fix https://github.com/tuist/tuist/pull/389

Test Plan:

- Verify unit tests pass via `swift tests`
- Verify acceptance tests pass via `bundle exec rake features`
2019-06-05 18:41:17 +01:00
Pedro Piñera Buendía dc2edcbb31
Handle the scenario where several sources glob patterns match the same paths (#388)
* Handle the scenario where several sources glob patterns match the same paths

* Update changelog

* Reduce verbosity of the tests using sets
2019-06-05 09:01:03 -07:00
Platon Sipsas f0c5b598ff Build settings have the same values repeated multiple times (#391)
Resolves https://github.com/tuist/tuist/issues/390

### Short description 

The `DefaultSettingsProvider` `targetSettings` combines the build settings for the specified build variant with the build settings for variants. If there is a common build setting with `$(inherited)` in its value, the value is appended twice.

### Solution 

In the `SettingsHelper` before combining build settings by appending the new value to the existing one check if the value are equal

### Implementation 

- Change `SettingsHelper` to check if setting values are equal before appending
- Add unit test to cover this case

###  Test Plan 
- Verify unit tests pass via swift tests
2019-06-05 13:44:39 +01:00
Kas e48cf6d75f
Ensuring the correct default settings provider dependency is used (#389)
- The `defaultSettingsProvider` passed to the `WorkspaceGenerator` wasn't being passed along to the `TargetGenerator`
- This led to having 2 different implementations running side by side
- The target generator is now created and injected to the project generator

Test Plan:

- Verify unit tests pass via `swift tests`
- Verify acceptance tests pass via `bundle exec rake features`
2019-06-04 16:41:19 +02:00
Pedro Piñera 26f1a56dfa Version 0.15.0 2019-06-02 08:35:46 -07:00
Pedro Piñera Buendía 67dbef964e
Add support for compiler flags (#386)
* Add support for compiler flags

* Add missing content

* Update changelog
2019-06-02 08:33:16 -07:00
Marcin Iwanicki be27fe8984
Essential and recommended default settings (#378)
Resolves https://github.com/tuist/tuist/issues/350

- Added a new protocol `DefaultSettingsProviding` that allows to control default settings at project and target level with a default implementation. `.recommended` set of settings is exactly the same as what Tuist currently generates so this it's not a breaking change. 
- Moved some of the settings helpers to a separated class `SettingsHelper`.
- Extended `Settings` manifest so the users can control the default set of settings.
2019-05-31 09:30:38 +01:00
Kas 7da4c457fb
Ensure resource bundles in other projects get built (#374)
- Including a resource bundle as one of the elements in the "Copy Bundle Resources" build phase doesn't get it built!
- When within the same project, the solution is to add the resource bundle target as an explicit target dependency
- This is not possible when the dependency is between two different projects
- To workaround this issue, a similar technique currently employed by static products can be used
- The resource bundle is now included in a copy files phase - which get Xcode to build it!
- The logic used for static products has been generalized slightly to allow accommodating the resource bundle targets

Test Plan:

- Run the unit tests via `swift test`

Note: this is not yet exposed via the project description manifests
2019-05-29 10:12:20 +02:00
Pedro Piñera Buendía 974f528a77
Add InfoPlist type (#373)
* Define Info.plist in the ProjectDescription target

* Update infoPlist attribute type

* Update models to use the new type, InfoPlist

* Update changelog
2019-05-27 08:29:57 +02:00
Marcin Iwanicki 34d80af5cc
Fix unstable lists of embedded frameworks and products references (#357)
Resolves https://github.com/tuist/tuist/issues/349

- Update `func embeddableFrameworks(path: AbsolutePath, name: String, system: Systeming)` of `Graph` to return ordered references
- Update method generating products file references so it can generate sorted list of products of the project targets and the dependencies
- Add integration test to make sure the project does not change after regeneration

Test Plan:
- Run unit tests via `swift test`
- Run acceptance tests via `bundle exec rake features`
- Manually generate `fixtures/ios_app_with_frameworks` via `tuist generate` at least two times without making any changes to the project
- Verify the generated workspace and projects are stable (do not change after regeneration)
2019-05-25 20:52:16 +01:00
Marcin Iwanicki 30bd374d25
Fix custom debug variant settings generation (#362)
### Short description

Custom debug settings were populated with release default settings (provided by XcodeProj). The issue was introduced while implementing custom configurations (https://github.com/tuist/tuist/pull/320). It does not affect Tuist users as we still support only `.debug` and `.release` configurations.

### Solution

- Fixed incorrect code converting build configuration into XcodeProj variant in `ConfigGenerator` 
- Added unit and integration tests
2019-05-23 08:39:59 +01:00
Kas 80dc496c8a
Update static dependency lint rule (#360)
Resolves https://github.com/tuist/tuist/issues/337

- The graph linter didn't account for which targets could link static products
- This led to raising an incorrect lint warning
- A `canLinkStaticProducts` method has been added to share rules between the linter and graph during link generation
- `GraphLinter` has been updated to no longer keep state internally

Test Plan:

- Run unit tests via `swift lint`
- Run acceptance tests via `bundle exec rake features`
- Manually generate `fixtures/ios_app_with_static_frameworks` via `tuist generate`
- Verify no lint warnings are displayed
2019-05-21 22:14:21 +01:00
Kas c87a1cda62
Fix duplicate localized resource files (#363)
Resolves https://github.com/tuist/tuist/issues/361

### Short description

Localized resources can up getting duplicated within the resources build phase and the project files elements.

The reason this was occurring:

- Give a path to a resource e.g. `/resources/en.lproj/foo.png`
- `/resources/en.lproj/` is used detected
- All files within `/resources/en.lproj/` are enumerated and added 
- When another path to a resource is encountered e.g. `/resources/en.lproj/bar.png`
- The same process is repeated, resulting in duplicate file elements!

### Solution

- Update project files element logic to better accommodate multiple localized files 
- Add a cache to keep track of which build files were added the resources build phase to prevent adding duplicates.
- Improved file element missing file warnings for directories 

e.g. `resources: ["Resources/en.lproj"]` would yield the following warnings:

```
Warning: 'Resources/en.lproj' is a directory, try using: 'Resources/en.lproj/**' to list its files
``` 

### Test Plan

- Verify unit tests pass via `swift tests`
- Verify acceptance tests pass via `bundle rake exec features`
- Manually generate `fixtures/ios_app_with_framework_and_resources` via `tuist generate`
- Verify the generated project includes the localized string files without any duplicates
2019-05-20 21:42:37 +01:00
Kas 47118ec48f
Fixing header paths including folders and non-header files (#356)
Resolves https://github.com/tuist/tuist/issues/352

- Specifying a permissive glob pattern (e.g. `Headers/**`) for headers would incorrectly include all files and folders as headers
- Limiting the paths to header files resolves this issue
- Adding Objective-C classes to test out headers within the fixtures

Test Plan:

- Verify unit tests pass via `swift build`
- Verify acceptance tests pass via `bundle exec rake features`
- Manually generate `fixtures/ios_app_with_frameworks` via `tuist generate`
- Verify `Framework2` has the appropriate public, private & project headers set
2019-05-17 21:24:29 +01:00
(Alfred) a8eb839705
Support Scheme `shared` flag (#341)
* Support Scheme `shared` flag

* Fix Project generator tests

* Correct scheme write path

* Update tests and change log
2019-05-17 01:55:54 +07:00
Kas a2367179eb
Supporting bundle target dependencies that reside in different projects (#348)
Part of: https://github.com/tuist/tuist/issues/290

- Previously only bundle target dependencies within the same projects worked
- This was due to leveraging `targetDependencies` method on `Graph` which only returns the target dependencies with the same project
- Updating `Graph` to include a new method to return all bundle resource dependencies

Test Plan:

- Run unit tests via `swift test` and verify they pass

Note: bundle resources are not yet exposed to the manifests
2019-05-16 07:08:47 +01:00
Kas 7935c55856
Fixing generation failures due to asset catalog & `**/*.png` glob patterns handling (#346)
Resolves https://github.com/tuist/tuist/issues/345

- Using the `**/*` style patterns are "eager" they will list out files recursively including ones within `.xcassets`
- The order in which the `ProjectFileElements` elements are processes isn't guaranteed
- If a file within the `.xcassets` is encountered first, e.g. `App/Resources/Assets.xcassets/assetCatalogLogo.imageset/tuist.png` before `App/Resources/Assets.xcassets`, `App/Resources/Assets.xcassets` is mistaken for a group and isn't added as a file element
- To mitigate this, the logic that determines if a group or file is added checks for `.xcassets` files

Test Plan:

- Verify unit tests pass
- Verify acceptance tests pass

- Run `tuist generate` within `fixtures/ios_app_with_framework_and_resources`
- Verify the generation passes
- Verify the asset catalog is included in the generated `MainApp` within the workspace
2019-05-11 07:29:22 +01:00
dangthaison91 a481e4c1d0 Update TestAction lauch arguments environments settings 2019-05-07 00:38:39 +07:00
dangthaison91 7564bdf45b Add support launch arguments and environment variables 2019-05-06 00:25:49 +07:00
v.sondt12 dcabea8069 Load Scheme manifest into Generator 2019-05-06 00:25:49 +07:00
v.sondt12 078cbad695 Update Scheme tests 2019-05-06 00:25:49 +07:00
dangthaison91 2e7d9c430c Update tests 2019-05-06 00:25:49 +07:00
v.sondt12 a1f7d5fe9e Keep auto generate scheme for the target that is not defined in manifest 2019-05-06 00:25:49 +07:00
v.sondt12 5cd2e50117 Support Scheme Manifest 2019-05-06 00:25:49 +07:00
Kas 19bc95ca73
Updating init template to avoid warnings (#339)
Resolves https://github.com/tuist/tuist/issues/334

- The path to resources is now commented out and left as an example to aid users get started defining the manifest
- The warnings were caused due to the `Resources`  directory not existing

Test Plan:

- Create a new empty directory
- Run `tuist init`
- Run `tuist focus`
- Verify no warnings are displayed
2019-05-05 11:56:33 +01:00
Kas 3db50ca523
Adding generate command timer (#335)
Resolves https://github.com/tuist/tuist/issues/329

### Short description 📝

To keep an eye on how long the generation process takes as users add more dependencies to their projects and as Tuist developers add more features to Tuist itself, it would be useful to print out the total generation time.

### Solution

Print out the total time taken to generate a project within the generate command.

### Implementation

- Introduce `Clock` and `ClockTimers` to allow obtaining current date and time differences
- Time the generate process within the generate command

### Test Plan

- Verify unit tests and acceptance tests pass
- Run `tuist generate` within any of the fixtures in `fixtures`
- Verify the generation time is displayed in the console output
2019-05-05 09:59:27 +01:00
Kas 940779eb24
Fixing files getting mistaken for folders (#338)
Resolves https://github.com/tuist/tuist/issues/330 and https://github.com/tuist/tuist/issues/322

### Short description:

- This issue can occur when files like `README` without extensions exist within the project
- Additionally another issue can be encountered in the event folders contain a `.` in their name
- To solve this we now only create groups if the file element component being added is a leaf (i.e. `/path/to/a` when `path` and `to` are added, they will be added as groups, and `a` will be added as a file element)


## Test Plan:

- Verify unit tests pass `swift test`
- Verify acceptance tests pass `bundle rake features`
- Manually generate `fixtures/ios_app_with_framework_and_resources` via `tuist generate`
- Verify `resource_without_extension` and `resource.txt` are included as resources within the project
- Manually generate `fixtures/ios_app_with_custom_workspace` via `tuist generate`
- Verify the `CHANGELOG` file appears as a file and not a group
2019-05-04 11:32:49 +01:00
(Alfred) d89da1d290 Set Code Sign On Copy to true for Embed Frameworks (#333)
* Headers build phase should be put on top of Compile build phase

* Add test

* Add changelog

* Set Code Sign On Copy to true for Embbed Frameworks

* Add changelog

* Update CHANGELOG
2019-05-02 18:16:16 +02:00
Pedro Piñera 650dca39f2 Version 0.14.0 2019-04-28 22:44:18 +02:00
(Alfred) 452bb1f8b4 Headers build phase should be put on top of Compile build phase (#332)
* Headers build phase should be put on top of Compile build phase

* Add test

* Add changelog
2019-04-28 11:17:09 +02:00
Kas 481e8bebeb
Ensure generate works on additional disk volumes (#327)
Resolves https://github.com/tuist/tuist/issues/324

- Using `replaceItemAt` has a caveat where it requires the item and its replacement to be on the same volume (see https://developer.apple.com/documentation/foundation/filemanager/2293212-replaceitemat)
- To mitigate this, the documentation suggests creating a temporary file within that volume
- The item can be moved there first
- Then a `replaceItemAt` can be performed

Test Plan:

- Manually create a RAM disk e.g.  `diskutil erasevolume HFS+ “RAMDisk” `hdiutil attach -nomount ram://524288`` (this creates a 250MB RAM disk)
- Create a new folder within that disk
- run `tuist --init`
- run `tuist generate`
- Verify the generation succeeds
2019-04-18 07:09:57 +01:00
Marcin Iwanicki 36d54f3cd4
Add support for multiple configs to TuistGenerator (#320)
Part of https://github.com/tuist/tuist/issues/160

### Short description

As mentioned in https://github.com/tuist/tuist/issues/160, currently, Tuist only supports debug and release build configurations. This can be seen as a limitation for some projects. We'd like to avoid this limitation and allow users to control the configurations themselves and base them on xcconfig files if needed.

### Solution

Added `Settings` property to `Project` and `Target` generator models. `Settings` contains `base` property for settings that are common for all the configurations. `configurations` property stores dictionary mapping `BuildConfiguration` (i.e. Release, Debug, Beta etc.) to `Configuration`. The structure won't preserve the order of the configurations but can help avoid situation when the same configuration is set twice (which would require additional linting). Maintaining the original order would be particularly difficult in cases when the defined configurations orders are different in project and target settings. To keep the ordering stable, the generator sorts the configurations alphabetically. 
To make the implementation backward compatible, `GeneratorModelLoader` always passes `release` and `debug` configurations with the settings defined in the manifest.
```swift
return TuistGenerator.Settings(base: base, configurations: [.debug: debug, .release: release]
```
2019-04-17 21:23:23 +01:00
Kas 96424de07b
Adding `bundle` product type to the generator library (#321)
Part of: https://github.com/tuist/tuist/issues/290

### Short description

Static frameworks & libraries currently can't host resources, one common technique to work around this is by introducing resource bundle targets to host the resources instead.

### Solution 

To aid solving this wholistically, an incremental step is to introduce the bundle product type to `TuistGenerator` (generator library).

### Implementation 

- Add bundle product type
- Add lint rules

### Notes

- The `.bundle` product type is not yet exposed in the manifests - this may be done separately once more foundations are in place to support resources holistically (See #290)
2019-04-15 07:22:28 +01:00
Kas 1dd8ace215
Resolve Swift 5 Warnings (#325)
- Updating SwiftPM dependency
  - `asString` has been renamed to `pathString`
  - `Utility` module has been renamed to `SPMUtility`

Test Plan:

- Verify unit tests pass `swift test`
- Verify acceptance tests pass `bundle exec rake features`
2019-04-14 19:02:56 +01:00
Kas fcbbfb14ac
Ensuring target product names are consistent with Xcode (#323)
Resolves https://github.com/tuist/tuist/issues/254

- When creating new Xcode projects manually from the UI, the product names do not include the extension
- Renaming existing `productName` references to `productNameWithExtension`

Test Plan:

- Ensure unit tests pass via `swift test`
- Ensure acceptance tests pass via `bundle exec rake features`
2019-04-12 19:39:31 +01:00
Pedro Piñera Buendía a03a4e932b
Swift 5 support (#317)
* Support Swift 5

* Fix test

* Don't check if the versions match when both local and remote versions are greater or equal than 5

* Updating fixtures for Swift 5 support

- Included a build script to allow re-creating the pre-built `Framework2` framework
- Updated build script for pre-built static library to require less manual steps

* Updates for Swift 5

- `swift package tools-version --set-current`

* Relaxed error output checks in acceptance tests

* Adding trace for acceptance test (to aid troubleshooting)

* skipping build during error message acceptance test

- Adding a step to build tuist separately ahead of calling run
- When running tuist via `swift run` we now skip the build

* Disable Swiftformat
2019-04-10 08:18:52 +02:00
Kas 4d7dff1827
Fixing graph node equality (#319)
- `GraphNode` subclasses like `TargetNode` that share a common path could mistakenly be identified as equal
- This is due to the static `==` method being called on `GraphNode` rather than the subclass
- To ensure the appropriate method is called, we can create an `isEqual` method to call, and override it in all subclasses
- Additionally we need to perform the equality check twice reversing the sides and ensuring they match - this ensures we call the appropriate subclass implementation

Test Plan:

- Verify unit tests pass

Reference: https://forums.swift.org/t/implement-equatable-protocol-in-a-class-hierarchy/13844/6
2019-04-09 16:28:07 +01:00
Kas 28a879b7bf
Adding support for resource folder references (#318)
Resolves https://github.com/tuist/tuist/issues/202

### Short description 

Resources to include in an application can be in the form of files as well as folder references.

### Solution 

Add support for folder references within target resources. For consistency, we can use `FileElement` which has already been used in `Project` and `Workspace` to define additional files.

e.g.

```swift
import ProjectDescription

let project = Project(
    name: "MainApp",
    targets: [
        Target(
            name: "App",
            platform: .iOS,
            product: .app,
            bundleId: "io.tuist.App",
            infoPlist: "Config/App-Info.plist",
            sources: "Sources/**",
            resources: [
                "Resources/*.png",
                .folderReference(path: "Examples")
            ])
      ]
)
```

### Test Plan 

- Verify unit tests pass via `swift test`
- Verify acceptance tests pass via `bundle exec rake features`

- Run `tuist generate` within `fixtures/ios_app_with_framework_and_resources`
- Inspect the generated workspace
- Verify `MainApp` has a folder reference to `Examples` which is also included in the **Copy Bundle Resources** phase
2019-04-08 10:29:26 +01:00
Kas 8d7f15f8d9
Adding support for project additional files (#314)
Part of https://github.com/tuist/tuist/issues/202

### Short description

Often projects may include additional files or folder references that don't need to be part of any build phase (e.g. design references, documentation etc...)


### Solution

`Workspace.swift` manifest now supports `additionalFiles`, the same concept can be added to the `Project.swift` manifest with the same rules.

- `.glob(pattern: "Documentation/**")`: glob pattern to one or more files
- `.folderReference(path: "Designs")`: single path to a directory that is added as a folder reference

Example:

```swift
let project = Project(name: "App",
                      targets: [
                           // ...
                      ],
                      additionalFiles: [
                         "Dangerfile.swift"
                         "Documentation/**",
                         .folderReference(path: "Designs")
                     ])
```

### Implementation 

- [x] Update `Project` manifest to include `additionalFiles`
- [x] Update models to translate globs to paths
- [x] Update `ProjectFileElements` to include `additionalFiles`
- [x] Include fixture
- [x] Update documentation
- [x] Update changelog

### Test Plan 

- Run `tuist generate` within `fixtures/ios_app_with_custom_workspace/App`
- Open the generated workspace
- Verify `Dangerfile.swift` is included in the project but isn't part of the resource phase
- Verify `Documentation` files are included (with the appropriate group structure that reflects the file system) and that the files aren't copied to resources
- Verify `Server` folder reference is included
2019-04-03 09:43:23 +01:00
Kas 2726304e29
Moving generator related classes to TuistGenerator (#306)
### Short description 

Tuist is a command line tool that offers several useful features related to managing Xcode projects at scale. The generation features are worthy of bundling in a library to enable external tools to leverage it and build on top of it. 

### Solution 

The `TuistGenerator` library has been previously created and several changes have been incrementally made to allow seamlessly migrating all the generation related code to it.

### Test Plan 

- Ensure unit tests continue to pass
  `swift test`

- Ensure acceptance tests continue to pass
  `bundle exec rake features`

- Manually generate any of the projects within `fixtures`
   `tuist generate`
  
### Notes 

`TuistGenerator` is not yet stable - breaking changes will most likely be made.
2019-03-31 15:33:35 +01:00
Kassem Wridan 84526e8d04 [RELEASE] 0.13.0 2019-03-30 12:22:47 +00:00
Oliver Atkinson 2fb9bd058f Check to see if contents.xcworkspacedata exists before writing 2019-03-30 11:00:45 +00:00
Kas 5956b94cd6
Ensuring Library search paths and Swift import paths are set (#308)
- A few additional build settings are needed when linking against pre-built static libraries
- `LIBRARY_SEARCH_PATHS` needs to point to the directory containing the `.a` file
- `SWIFT_INCLUDE_PATHS` need to point to the directory containing the `.swiftmodule` file

Test Plan:

- Generate `fixtures/ios_app_with_static_libraries`
- Verify the application builds
- Verify the `LIBRARY_SEARCH_PATHS` and `SWIFT_INCLUDE_PATHS` settings are set on target `A`
2019-03-27 21:32:08 +00:00
Kas ecb11cd479
Fixing swiftlint & swiftformat issues (#305)
- Fixing swiftlint issues
- Ensuring swift format is updated (if needed)
2019-03-24 09:47:45 +00:00
Oliver Atkinson 88929377cd
Merge pull request #303 from tuist/remove-project-scheme
Remove "-Project" scheme
2019-03-23 21:52:19 +00:00
Oliver Atkinson 1462a38d8f swiftformat . 2019-03-23 20:53:05 +00:00
Oliver Atkinson dc6d989daa swiftformat . 2019-03-23 20:51:20 +00:00
Oliver Atkinson 52eb55bbd3 remove includeInProjectScheme 2019-03-23 19:56:23 +00:00
Oliver Atkinson 249529a8e1 Wrote tests for TestTargetID and added PBXProj to GeneratedProject 2019-03-23 19:55:11 +00:00
Oliver Atkinson 6f1bd8d6a2 Remove Project scheme 2019-03-23 11:44:42 +00:00
Oliver Atkinson ee58cd8d8f swiftformat . 2019-03-23 10:47:00 +00:00
Oliver Atkinson 43e1ab5968 Fix ui test bundle not executing, added fixture test 2019-03-23 10:46:06 +00:00
Oliver Atkinson 9e14948e93 swiftformat . 2019-03-23 09:40:47 +00:00
Oliver Atkinson 14048aca8c set TEST_HOST for Unit tests bundle for an app target so that the default generated test target runs 2019-03-23 09:40:28 +00:00
Oliver Atkinson c910164c1e
Merge pull request #301 from tuist/fix-255
Allow header and framework search paths to inherit from the project
2019-03-23 09:31:14 +00:00
Kas fe44584b2b
Workspace Improvements (#298)
Resolves https://github.com/tuist/tuist/issues/258

### Short description 

Workspace manifests allow users to customize which project are included in their workspace however doesn't yet offer the ability to add arbitrary files and folder references (to support included things like Documentation and README files).

### Solution 

Extend the workspace manifest to allow specifying `additionalFiles`

e.g.

```swift
import ProjectDescription

let workspace = Workspace(name: "Workspace",
                          projects: [
                              "App", 
                              "Frameworks/FrameworkA", 
                              "Frameworks/FrameworkB", 
                            ],
                            additionalFiles: [
                                "Documentation/**",
                                .folderReference(path: "Website")
                            ])
```

As an added bonus of these changes, we can add the ability to specify glob patterns for `projects` to make it easier to include new projects without needing to constantly update the workspace manifest.

e.g.

```swift
import ProjectDescription

let workspace = Workspace(name: "Workspace",
                          projects: [
                              "App", 
                              "Frameworks/**", 
                            ],
                            additionalFiles: [
                                "Documentation/**",
                                .folderReference(path: "Website")
                            ])
```

### Implementation 

- [x] Update workspace manifests
- [x] Parse workspace manifests > models
- [x] Add workspace structure generator
- [x] Integrate workspace structure
- [x] Include fixture
- [x] Update documentation

### Test Plan 

- Run `tuist generate` on the following fixtures:
  - `fixture/ios_app_with_custom_workspace`
   
<img width="254" alt="custom-workspace" src="https://user-images.githubusercontent.com/11914919/54780257-36db2f80-4c11-11e9-8fda-5f59554533c0.png">

  - `fixture/ios_app_with_custom_workspace/App`

<img width="161" alt="custom-workspace-app" src="https://user-images.githubusercontent.com/11914919/54780299-4a869600-4c11-11e9-9637-cdfaa20bb8c8.png">

  - `fixture/ios_app_with_setup`

<img width="175" alt="setup" src="https://user-images.githubusercontent.com/11914919/54780315-540ffe00-4c11-11e9-99fd-e9175ee4de27.png">

  - `fixture/ios_app_with_frameworks`

<img width="184" alt="frameworks" src="https://user-images.githubusercontent.com/11914919/54780335-5d00cf80-4c11-11e9-906c-b53f26c36007.png">

Verify the generated workspace structure

### Notes 

All this work is based on group effort and iteration from #262 - thanks @ollieatkinson, @pepibumur! 👍
2019-03-23 13:00:17 +04:00
Oliver Atkinson 62dc1bf64c swiftformat . 2019-03-22 21:10:11 +00:00
Oliver Atkinson 0eea9275f5 Allow header and framework search paths to inherit from the project 2019-03-22 21:08:13 +00:00
Oliver Atkinson 2153c7daf1
Merge pull request #299 from tuist/fix-175
Allow linking of static frameworks/libraries into dynamic frameworks
2019-03-22 17:52:01 +00:00
Oliver Atkinson 87f1f7de68 swiftformat . 2019-03-22 17:34:15 +00:00
Oliver Atkinson e29b8bac54 swiftformat . 2019-03-22 14:40:29 +00:00
Oliver Atkinson 0e664a0721 Fix equality check for TargetNode and LibraryNode, change parameter to skip 2019-03-22 14:26:37 +00:00
Oliver Atkinson 5fdcf00af6 swiftformat . 2019-03-22 11:04:41 +00:00
Oliver Atkinson 7a2be6f05d Update tests to include linter 2019-03-22 11:04:21 +00:00
Oliver Atkinson f5daa217fd Allow linking of static frameworks/libraries into dynamic frameworks 2019-03-21 22:31:26 +00:00
Oliver Atkinson d6cfae88c2 Fix #296 - Do not include manifest inside of project scheme 2019-03-21 16:42:19 +00:00
Kas d4f6b7221a
Fixing duplicate manifest group (#295)
- While unifying manifest target generation (#271) one crucial step was missed, removing the "Manifest" project group from the pre-defined list of groups
- The manifest loader is also no longer used in the target generator - this was also missed in #271

Test Plan:

- Generate any of the fixtures
- Inspect the generated project
- Verify there are no duplicate manifest groups
2019-03-21 11:11:44 +04:00
Pedro Piñera Buendía 08cbc57e83
Update tuistenv when running tuist update (#288)
* Update tuistenv when running tuist update

* update changelog
2019-03-19 09:40:58 +01:00
Pedro Piñera 273dab98c1 Run swiftformat 2019-03-17 12:51:38 +01:00
Patrick Balestra 94469fb1a7 Remove App Delegate Warning (#291)
* Update UIKit `didFinishLaunchingWithOptions` method to remove warning

* Update UIKit `didFinishLaunchingWithOptions` method in fixtures

* Exclude fixtures from SwiftFormat

* Fix line too long lint error

* Update CHANGELOG.md
2019-03-17 12:50:56 +01:00
Pedro Piñera Buendía 7aaebf4723
Add async method to System (#285) 2019-03-14 17:32:13 +01:00
Pedro Piñera Buendía 739a4c1015
Fix build settings not being generated properly (#282)
* Fix build settings not being generated properly

* update changelog

* Adding unit test for debug/release target settings

* Fix tests

* Solve some issues after rebasing
2019-03-14 08:40:23 +01:00
Kas d348c83d93 Manifest targets are now static frameworks (to avoid link errors) (#287)
* Manifest targets are now static frameworks to prevent link errors

- The manifest target can be built to ensure there are no syntax errors in the project manifests
- This target doesn't need to be linked, a compilation step is sufficient to serve its purpose
- By converting the manifest target to a static framework, the link step is skipped and the errors that were obtained during that step can be avoided all together

Test Plan:

- Run `tuist generate` on any fixture within `fixtures`
- Open the generated workspace (you can use `tuist focus` as a shortcut to those steps)
- Build the `<Project>-Manifest` scheme in Xcode
- Verify no link errors appear

* Updated changelog
2019-03-14 07:49:59 +01:00
Kas b369ae67d4
Unifying manifest target generation (#271)
- The manifest target can be generated using the exiting generator code without needing any additional logic
- Manifest targets models are now created at the point of loading project models

Test Plan:

- Verify unit tests pass via `swift test`
- Verify acceptance tests pass via `bundle exec rake features`
- Generate any fixture and validate the `Manifest` target is still generated
- Verify autocomplete still work within the `Project.swift` file
2019-03-13 21:44:47 +04:00
Pedro Piñera Buendía 39f937ce18
Create a Setup.swift file when running the init command (#283)
* Create a Setup.swift file

* Update changelog

* Add more examples
2019-03-13 10:39:46 +01:00
Pedro Piñera Buendía 9f53f22780
Add Homebrew tap up (#281)
* Add Homebrew tap up

* update changelog

* Address comments

* Add documentation
2019-03-13 09:56:52 +01:00
Pedro Piñera Buendía 048a2a060b
Fix duplicated embedded frameworks (#280)
* Fix duplicated embedded frameworks

* Update changelog
2019-03-12 18:48:37 +01:00
Oliver Atkinson f4ea856db2 [RELEASE] 0.12.0 2019-03-11 13:34:00 +00:00
Kas 9f68556930
Adding project and target "filesGroup" (internally) to customize root project group (#257)
- The idea is to enable declaring the root folder in which target sources are hosted
- This will allow us to unify the creation of the manifest target (just like any other target with some custom settings) without needing any additional logic
  - For example, at the model loader level, we can create a target and re-use the existing target generation logic to generate the manifest target
  - To ensure the manifest can get its dedicated top level folder, we could add a target level option (at the generator level) to specify the root group - `filesGroup`
- The manifest target can declare its `filesGroup: .group(name: "Manifest")` while all other targets use the default `filesGroup: .group(name: "Project")`

- Note: this is a very simplistic solution for the specific use case of supporting the manifest target, a more flexible solution could be explored as a follow up

Test Plan:

- Ensure unit and acceptance tests pass
- run `tuist generate` within any of the `fixtures` and the structure is as it was before (sources appear within `Project` group)
2019-03-10 10:03:40 +00:00
Pedro Piñera e64c2afed5 Change init command and update getting started documentation 2019-03-08 18:51:59 +01:00
Pedro Piñera bda99ad49e Fix tests 2019-03-08 18:46:58 +01:00
Oliver Atkinson 17ee968886 swiftformat . 2019-03-08 13:26:01 +00:00
dangthaison91 5cb7a67722 Support resources as array
Support source files as Array

Added FileList to maintain source compatibility

Fixed CI build failed

Fixed tests failed

Update document
2019-03-08 12:07:30 +00:00
Oliver Atkinson de5485715d Fix #253 - Include linked library and embed in any top level executable bundle (#259)
* Fix #253 - Include linked library and embed in any top level executable bundle

* Fix fixture test, removed explicit link inside of main app and compiled Framework2 as a fat binary

* swiftformat .

* Update CHANGELOG.md

* Add acceptance tests

* Delete copying the working directory

* Store DerivedData in the working directory
2019-03-08 00:31:43 +01:00
Pedro Piñera Buendía 99537d0820
Improve the Xcode project reload when the project is regenrated (#247)
* Improve writing logic

* update changelog

* update changelog

* Sort workspace elements

* Extract sortening logic into ProjectFilesSortener

* Fix tests
2019-03-07 18:22:00 +01:00
Kas 7833205a1e
Manifest loader now returns concrete manifest objects (#244)
- The manifest loader now returns `ProjectDescription` classes
- The model loader now transforms `ProjectDescription` classes >  generator `Models`

Test Plan:

- Verify unit tests pass `swift test`
- Verify acceptance tests pass `bundle exec rake features`
2019-03-05 13:49:42 +00:00
Pedro Piñera Buendía a89aebacfa
Support variables in the bundle id (#252)
* Support variables in the bundle id

* Update changelog

* re-enable tests
2019-03-05 10:10:54 +01:00
Pedro Piñera Buendía de422d50aa
Add swiftlint (#245)
* Add Swiftlint

* Add swiftlint back
2019-02-27 08:45:56 -05:00
Pedro Piñera Buendía d47d5370e0
Replace swiftlint with swiftformat (#239)
* Replace swiftlint with swiftformat

* Update CHANGELOG

* Add missing require

* Fix require

* include .swiftformat file

* Remove require

* Fix Dangerfile

* Run Swiftformat after rebase

* Upgrade swiftformat

* Revert upgrade

* Use the right configuration
2019-02-26 21:17:26 -05:00
Kas 0bbdd4cfed
Commands now use `Generator` component (#242)
Part of: #205

- To ease the migration of classes to the generator library, the generator is added to `TuistKit` temporarily
  - This component will later move to `TuistGenerator`
- This allows decoupling commands from the workspace generator / graph related classes
- `GraphLoader` no longer depends on the `GraphManifestLoader`
- Focus command no longer has a `--config` option as it's no longer used

Test Plan:

- Ensure unit tests pass `swift test`
- Ensure acceptance tests pass `bundle exec rake features`
- Navigate to any of the fixtures and test out `tuist focus`
2019-02-24 18:36:26 +00:00
Kas 718ba08431
Model / linter tidy ups (#241)
- `Workspace` and `Scheme` are now decoupled from manifests json
- `ProjectLinter` no longer requires the `UpLinter`
- Adding scheme conversion from `ProjectDescriotion` to `TuistKit` models

Test Plan:

- Verify unit tests continue to pass
2019-02-23 21:08:05 +00:00
Kas 441ac4b88b
Decoupling Models from Manifests JSON (#237)
- Introducing a `GeneratorModelLoader` component responsible for obtaining the model objects required by the `TuistGenerator` library
- To support this, the models are being decoupled from the manifest definitions (and the JSON representation)
- The conversion between the manifest and model types takes place within the model loader

Test Plan:

- Ensure unit tests continue to pass `swift test`
- Ensure acceptance tests pass `bundle exec rake features`
- Verify projects within the `fixtures` directory are still correctly generated when performing `tuist generate`
2019-02-22 07:09:29 +00:00
Oliver Atkinson 105ccea129 Remove errornous Yams import 2019-02-21 17:07:18 +00:00
Oliver Atkinson cdaf181651 Add integration tests for Workspace Generator 2019-02-21 17:04:17 +00:00