Commit Graph

872 Commits

Author SHA1 Message Date
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
Pedro Piñera 13570028f2 Use dark code highlighting 2019-04-22 07:49:08 +02:00
Pedro Piñera 77a2abfb82 Fix some styles 2019-04-22 07:42:27 +02:00
Pedro Piñera 5a559093de Remove node_modules before installing 2019-04-22 07:18:45 +02:00
Pedro Piñera 407a03fc42 Add netlify.toml 2019-04-22 07:17:46 +02:00
Pedro Piñera 558ca804d2 Adjust vscode settings 2019-04-22 07:11:54 +02:00
Pedro Piñera ffa6b2f83f Add Docz 2019-04-22 07:11:40 +02:00
Pedro Piñera Buendía d7629ba0ba
Update README.md 2019-04-19 22:03:24 +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 fb6bd0642c
Merge pull request #313 from tuist/ollieatkinson-readme-patch
Update README.md
2019-03-30 12:05:46 +00:00
Oliver Atkinson 14f99d2f94
Merge pull request #312 from tuist/fix-309
Check to see if contents.xcworkspacedata exists before writing
2019-03-30 12:05:27 +00:00
Oliver Atkinson 7e6e0deeba
Update README.md 2019-03-30 11:35:19 +00:00
Oliver Atkinson 74ec40ee5b Update CHANGELOG.md 2019-03-30 11:32:27 +00:00
Oliver Atkinson e66555f089 Simplify test 2019-03-30 11:23:49 +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
Pedro Piñera Buendía 3dea22abd0
Update Feature_request.md 2019-03-25 08:36:08 +01:00
Pedro Piñera Buendía 0b96d122a5
Remove opencollective comment 2019-03-25 08:35:57 +01:00
Oliver Atkinson d803a9b3d5
Merge pull request #307 from tuist/changelog-breaking-change-project-scheme
Update CHANGELOG.md to include Breaking for scheme removal
2019-03-24 19:46:41 +00:00
Oliver Atkinson 06e8717024
Update CHANGELOG.md 2019-03-24 13:13:58 +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 33fc00bbf1
Merge pull request #302 from tuist/improve_circleci_performance
Improve CircleCI by caching gems and not updating homebrew
2019-03-24 07:20:40 +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 7eb8ec9a9b Remove includeInProjectScheme from unit tests 2019-03-23 21:12:26 +00:00
Oliver Atkinson 24e274f948
Merge pull request #300 from tuist/fix-204
Set TEST_HOST and BUNDLE_LOADER for app unit tests
2019-03-23 21:05:18 +00:00
Oliver Atkinson 96ffd2e00e Update CHANGELOG.md 2019-03-23 20:57:25 +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 2ffe813cbd Remove explicit test host settings 2019-03-23 20:10:01 +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 e72e809761 WIP: Improve CircleCI by caching gems and not updating homebrew 2019-03-23 10:54:14 +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 0934064025 Update CHANGELOG.md 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