Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the generation logic to not include the manifest files in the workspace #754

Merged
merged 2 commits into from Dec 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Expand Up @@ -8,6 +8,7 @@ Please, check out guidelines: https://keepachangelog.com/en/1.0.0/

- **Breaking** Generate manifests target as part of the generated project https://github.com/tuist/tuist/pull/724 by @pepibumur.
- The installation no longer checks if the Swift version is compatible https://github.com/tuist/tuist/pull/727 by @pepibumur.
- Don't include the manifests in the generated workspace https://github.com/tuist/tuist/pull/754 by @pepibumur.

### Added

Expand All @@ -20,7 +21,7 @@ Please, check out guidelines: https://keepachangelog.com/en/1.0.0/
- Support for paths relative to root https://github.com/tuist/tuist/pull/727 by @pepibumur.
- Replace `Sheme.testAction.targets` type from `String` to `TestableTarget` is a description of target that adds to the `TestAction`, you can specify execution tests parallelizable, random execution order or skip tests https://github.com/tuist/tuist/pull/728 by @rowwingman.
- Galaxy manifest model https://github.com/tuist/tuist/pull/729 by @pepibumur.
- Make scheme generation methods more generic https://github.com/tuist/tuist/pull/730 by @adamkhazi @kwridan.
- Make scheme generation methods more generic https://github.com/tuist/tuist/pull/730 by @adamkhazi @kwridan.
- Make scheme generation methods more generic by @adamkhazi @kwridan.
- `SimulatorController` with method to fetch the runtimes https://github.com/tuist/tuist/pull/746 by @pepibumur.

Expand Down
2 changes: 1 addition & 1 deletion Sources/TuistCore/Graph/Graph.swift
Expand Up @@ -186,7 +186,7 @@ public class Graph: Graphing {
public var targets: [TargetNode] {
return cache.targetNodes.flatMap { $0.value.values }
}

public func target(path: AbsolutePath, name: String) -> TargetNode? {
return findTargetNode(path: path, name: name)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/TuistCore/Models/Scheme.swift
Expand Up @@ -92,7 +92,7 @@ public struct TargetReference: Equatable {
public static func project(path: AbsolutePath, target: String) -> TargetReference {
return .init(projectPath: path, name: target)
}

public init(projectPath: AbsolutePath, name: String) {
self.projectPath = projectPath
self.name = name
Expand Down
100 changes: 47 additions & 53 deletions Sources/TuistGenerator/Generator/SchemesGenerator.swift

Large diffs are not rendered by default.

7 changes: 2 additions & 5 deletions Sources/TuistKit/Generator/Generator.swift
Expand Up @@ -16,13 +16,10 @@ extension Generating {
func generateWorkspace(at path: AbsolutePath,
manifestLoader: GraphManifestLoading) throws -> AbsolutePath {
let manifests = manifestLoader.manifests(at: path)
let workspaceFiles: [AbsolutePath] = [Manifest.workspace, Manifest.setup]
.compactMap { try? manifestLoader.manifestPath(at: path, manifest: $0) }

if manifests.contains(.workspace) {
return try generateWorkspace(at: path, workspaceFiles: workspaceFiles)
return try generateWorkspace(at: path, workspaceFiles: [])
} else if manifests.contains(.project) {
return try generateProjectWorkspace(at: path, workspaceFiles: workspaceFiles)
return try generateProjectWorkspace(at: path, workspaceFiles: [])
} else {
throw GraphManifestLoaderError.manifestNotFound(path)
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/TuistKit/Generator/GeneratorModelLoader.swift
Expand Up @@ -607,7 +607,7 @@ extension TuistCore.TestAction {
let codeCoverageTargets = manifest.codeCoverageTargets.map { TuistCore.TargetReference(projectPath: projectPath, name: $0) }
let preActions = manifest.preActions.map { TuistCore.ExecutionAction.from(manifest: $0, projectPath: projectPath) }
let postActions = manifest.postActions.map { TuistCore.ExecutionAction.from(manifest: $0, projectPath: projectPath) }

return TestAction(targets: targets,
arguments: arguments,
configurationName: configurationName,
Expand All @@ -631,7 +631,7 @@ extension TuistCore.RunAction {
static func from(manifest: ProjectDescription.RunAction, projectPath: AbsolutePath) -> TuistCore.RunAction {
let configurationName = manifest.configurationName
let arguments = manifest.arguments.map { TuistCore.Arguments.from(manifest: $0) }

var executableResolved: TuistCore.TargetReference?
if let executable = manifest.executable {
executableResolved = TargetReference(projectPath: projectPath, name: executable)
Expand Down
@@ -1,12 +1,12 @@
import Foundation
import Basic
import Foundation
import TuistCore
import TuistCoreTesting
@testable import TuistGenerator

final class MockSchemesGenerator: SchemesGenerating {
var generateProjectSchemeArgs: [(project: Project, xcprojectPath: AbsolutePath, generatedProject: GeneratedProject, graph: Graphing)] = []

func generateProjectSchemes(project: Project, xcprojectPath: AbsolutePath, generatedProject: GeneratedProject, graph: Graphing) throws {
generateProjectSchemeArgs.append((project: project, xcprojectPath: xcprojectPath, generatedProject: generatedProject, graph: graph))
}
Expand Down