Commit Graph

312 Commits

Author SHA1 Message Date
Vytis 76e8811301 Add new version to Changelog 2020-01-31 18:17:28 +01:00
Pedro Piñera 3d31061350 Update CHANGELOG 2020-01-30 09:02:38 +01:00
Kas f3dd9d761e
Add fixture generator for stress testing Tuist (#890)
Part of: https://github.com/tuist/tuist/issues/820 

- Creating a small command line tool to generate large fixtures
- Add github action to build & test the fixture generator whenever its sources or ProjectDescription's sources change

Usage:

```sh
swift run FixtureGenerator --projects 10 --targets 10 --sources 100
```

Test Plan:

- Run `swift run` within `fixtures/fixture_generator`
- Run `tuist generate` within fixtures/fixture_generator/Fixture`
- Verify the generated fixure is valid
- Experiment with different number of sources / targets / projects to benchmark Tuist
2020-01-30 07:18:14 +00:00
Pedro Piñera cd0b14e6ea Update website 2020-01-29 19:09:20 +01:00
Maciej Piotrowski 84ed57b212
Update CHANGELOG.md 2020-01-27 15:28:16 +01:00
Pedro Piñera Buendía 6fcb219b04
Merge pull request #913 from tuist/fix/excluding-different-dir
Fix: Excluding files from target doesn't work in all cases
2020-01-21 20:13:55 +01:00
Pedro Piñera 834c6deac6 Update CHANGELOG.md 2020-01-21 16:26:59 +01:00
Vytis a07a6c7c82
Merge branch 'master' into fix/excluding-different-dir 2020-01-21 16:05:29 +01:00
Andrea Cipriani 75c49a6a65 Update changelog 2020-01-21 14:03:27 +01:00
Vytis e1faafbe8b Update changelog 2020-01-21 12:36:46 +01:00
Kas adf0bda2a8
Fix project header attributes (#895)
- Project headers in Xcode have no attributes by default
- As it happens, setting any arbitrary value defaults to "Project" visibility
- To make generated project more inline with Xcode, we can omitt setting attributes for project headers

Test Plan:

- Run `tuist generate` within `fixtures/ios_app_with_frameworks/Framework2`
- Verify the generated project has `MyProjectClass.h` set to "Project" visibility in the generated project
2020-01-21 09:05:48 +00:00
Marcin Iwanicki 1eafc16443
Make the scheme generation with testable targets stable (#892)
### Short description

We've noticed the scheme generation is not always stable. The order of testable targets in a scheme could change after re-generating the project. 
It's reproducible when multiple testable targets depend on the same target (framework, or app) within a single project.

i.e.

- ProjectA:
  - AppTarget 
  - UnitTestsTarget (dependencies: [AppTarget])
  - UITestsTarget (dependencies: [AppTarget])

### Solution

- Sorted testable targets
- Updated one of the unit tests to reproduce the issues, and avoid regression in the future
- Updated the integration tests to cover multiple testable targets user case
2020-01-21 08:22:33 +00:00
Kas 1584e42e01
Ensure precompiled frameworks of target applications aren't included in UI test targets (#888)
Resolves: https://github.com/tuist/tuist/issues/887

- Test targets declare their host applications as a dependency
- This lead to a few graph queries transitively including depdencies of the application in the test targets
- When performing dependency searches, we can skip dependency tree of nodes that can embed products (e.g. Applications)

Test Plan:

- Run `tuist generate` within `fixtures/ios_app_with_transitive_framework`
- Open the generated workspace
- Verify that `AppUITests` has no precompiled frameworks included
2020-01-15 14:06:03 +00:00
Marcin Iwanicki 8a4b65724f
Add RemoveHeadersOnCopy attribute for build files in copy files build phases (#886)
### Short description 📝

While working on https://github.com/bloomberg/xcdiff/pull/40, we discovered that some of the build files are missing `RemoveHeadersOnCopy` attribute. The attribute determines if the headers should be striped from the archive, and if not set, can lead to headers leakage. The attribute is not visible in the Xcode UI, but added automatically every time a certain bundle types are added to a copy files build phase (i.e. .framework, .appex).
Oddly the attribute is not added for `.xcframework`, but it's probably an Xcode issue (FB7533618).

### Solution 📦

Added "RemoveHeadersOnCopy" attribute for build files in embed precompiled frameworks, embed watch content, and embed app extensions build phases.

### Implementation 👩‍💻👨‍💻

- [x] Update TuistGenerator to add `RemoveHeadersOnCopy`
- [x] Update acceptance tests
- [x] Update CHANGELOG
2020-01-13 17:23:13 +00:00
Pedro Piñera 53d9f0e4a1 Update CHANGELOG 2020-01-07 18:20:29 +01:00
Pedro Piñera 35143fe056 Update CHANGELOG 2019-12-30 20:03:16 +01:00
Pedro Piñera 3375dd0660 Update CHANGELOG 2019-12-29 13:37:48 +01:00
Pedro Piñera 750e76624e Version 1.1.0 2019-12-27 16:57:57 +01:00
Pedro Piñera 366ca477ff Update CHANGELOG 2019-12-27 16:18:05 +01:00
Pedro Piñera 19a8c450f8 Update CHANGELOG 2019-12-26 11:53:55 +01:00
Vytis c75ad0f354 Add related test targets as testables (#818)
Resolves https://github.com/tuist/tuist/issues/569

### Short description 📝

It should be possible to run tests if target has any test targets.

### Solution 📦

This PR finds all related test targets to the test scheme. It was already done for test targets themselves, but the functionality was extended to include all other targets.

### Implementation 👩‍💻👨‍💻

- [x] Added implementation
- [x] Added tests

### Test Plan 🛠

Run with `app_with_framework_and_tests` fixture and check that in generated schemes:

#### Previous behaviour didn't break
1. `AppTests` scheme has `AppTests` as a testable target.
1. `FrameworkTests` scheme has `FrameworkTests` as a testable target.

#### New behaviour works as expected
1. `App` scheme has `AppTests` as a testable target.
1. `Framework` scheme has `FrameworkTests` as a testable target.
2019-12-23 17:18:25 +00:00
Pedro Piñera 76938c0bb4 Update CHANGELOG 2019-12-19 16:07:10 +01:00
Vytis 214845d87b Updated changelog 2019-12-18 13:41:38 +01:00
Oliver Atkinson 184f3942dc Update CHANGELOG and Constants.swift for 1.0.1 2019-12-17 11:12:42 +00:00
Oliver Atkinson 4e7c4bb68b
Merge pull request #805 from tuist/xcode-developer-dir
DEVELOPER_DIR takes precedence over xcode-select when set
2019-12-17 10:59:54 +00:00
Pedro Piñera cff6671a1d Version 1.0.0 2019-12-17 10:30:59 +01:00
Kas 2f3029db00
Add knownRegions to generated projects (#792)
- Generated projects were missing an exhaustive list of known regions. 
- This causes Xcode to immediately modify generated projects on launch to fix this.
- Based on localizable resources we can infer the knownRegions of the project
- While adding localizable resource file elements we can keep track of the languages encountered
- This can then be used to set a complete set of knownRegions 

Test Plan:

- Run `tuist generate` within `fixtures/ios_app_with_framework_and_resources`
- Verify the generated project MainApp has both "English" and "French" in the list of localizations in the project's info tab
2019-12-16 16:21:42 +00:00
Oliver Atkinson 023e49d12e Ensure DEVELOPER_DIR is passed through when using System to run shell commands 2019-12-16 15:44:48 +00:00
Kassem Wridan e60772a496 Update changelog 2019-12-16 13:58:38 +00:00
Pedro Piñera Buendía 7cdb28e629
Merge pull request #790 from bloomberg/feature/stable-scheme-generation
Fix unstable scheme generation
2019-12-16 09:32:53 +01:00
Kas de14ceb7dc
Support generating info.plist for Watch Apps & Extensions (#756)
Part of: https://github.com/tuist/tuist/issues/628

- Added watchOS App / Extension defaults to the info plist content provider
- Watch apps reference their host applications bundle identifier in the info plist `WKCompanionAppBundleIdentifier` key
- Watch app extensions reference their host watch apps bundle identifier in the info plist `NSExtension.NSExtensionAttributes.WKAppBundleIdentifier`
- As such the parent project is now used to perform lookups for those hosts to extract their bundle identifiers
- Updated fixture to leverage generated info.plist files

Test Plan:

- run `tuist generate` within `fixtures/ios_app_with_watchapp2`
- Verify the info.plist files generated in `Derrived/InfoPlists` matche the ones created by Xcode
  (They were previously checked in under `Support`)
2019-12-15 20:40:12 +00:00
Marcin Iwanicki 279fc99985 Update CHANGELOG 2019-12-15 19:06:11 +00:00
Kas b61d9a4ed5
Remove duplicate HEADER_SEARCH_PATHS (#787)
- In the even two library dependencies shared the same `publicHeaders` path (e.g. `libcrypto.a` and `libssl.a` in OpenSSL) duplicate entries were added to the `HEADER_SEARCH_PATHS` build setting
- This was regressed due to an earlier change https://github.com/tuist/tuist/pull/751
  - previously the uniquing was happening in the settings helper when build settings were extended multiple times
- To resolve this, we now ensure we unique paths being added
- Additionally a test is included to ensure this doesn't regress in the future

Test Plan:

- Verify the unit tests pass

A bit of a contrived manual test case

update the fixture in `fixtures/ios_app_with_static_libraries/Modules/A/Project.swift`

```swift
let project = Project(name: "A",
                      targets: [
                          Target(name: "A",
                                 platform: .iOS,
                                 product: .staticLibrary,
                                 bundleId: "io.tuist.A",
                                 infoPlist: "Info.plist",
                                 sources: "Sources/**",
                                 dependencies: [
                                     .project(target: "B", path: "../B"),
                                     .library(path: "../C/prebuilt/C/libC.a",
                                             publicHeaders: "../C/prebuilt/C",
                                             swiftModuleMap: "../C/prebuilt/C/C.swiftmodule"),
                                    // Add a duplicate
                                     .library(path: "../C/prebuilt/C/libC.a",
                                             publicHeaders: "../C/prebuilt/C",
                                             swiftModuleMap: "../C/prebuilt/C/C.swiftmodule")
                          ])
])
```

This of course causes a duplicate binary (hence why it wasn't included) but can help illustrate a situation where two `.library` dependencies point to the same `publicHeaders` path.
2019-12-12 17:33:41 +00:00
ldindu 881ddfdf47
Merge branch 'master' into feature/introduction-xcframework-dependency-type 2019-12-11 20:41:31 +00:00
ldindu 44dca729a2 Update changelog 2019-12-11 20:38:18 +00:00
Pedro Piñera cccaa140e8 Update CHANGELOG 2019-12-11 06:14:42 -05:00
Pedro Piñera 76ef8a4f42 Update CHANGELOG 2019-12-10 11:33:11 -05: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 200b34f115 Update changelog 2019-12-07 23:38:42 +00:00
Pedro Piñera cff8065957 Update CHANGELOG 2019-12-07 18:32:45 +01:00
Pedro Piñera 91dad5a59c Update CHANGELOG 2019-12-07 17:13:15 +01:00
Pedro Piñera d6bc52382e Add utility to compile xcframeworks 2019-12-07 16:05:48 +01:00
Pedro Piñera e869c06915 Update CHANGELOG 2019-12-07 15:01:34 +01:00
Pedro Piñera a188326e5f Update CHANGELOG 2019-12-07 13:57:43 +01:00
Pedro Piñera 6ca812f3d2 Update CHANGELOG 2019-12-06 18:55:03 +01:00
Pedro Piñera 09bbdc057b Update CHANGELOG 2019-12-06 18:13:51 +01:00
Kas 42d2ae4aa5
Ensure custom search path settings are included in generated projects (#751)
Resolves https://github.com/tuist/tuist/issues/750

- The previous logic was setting the `$(inherited)` and the derived search paths seperately
- This caused the derrived search paths to replace any existing custom settings
- To solve this, we can set the derived search paths and the `$(inherited)` setting as one setting
- This allows the extend helper method to extend existing settings

Test Plan:

- Run `tuist generate` within `fixtures/ios_app_with_static_libraries`
- Inspect the generated workspace, Module A should have a `$(SRCROOT/CustomHeader` header search path
2019-12-05 13:53:14 +00:00
Pedro Piñera 71e0d0b385 Update CHANGELOG 2019-12-04 18:03:15 +01:00
Adam Khazi fee2377801
Make Scheme Generation Methods More Generic Follow Up (#749)
### Short description 📝

Follow up to https://github.com/tuist/tuist/pull/730 with small errors fixed.
2019-12-04 09:21:43 +00: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