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

Edit command #703

Merged
merged 10 commits into from Nov 26, 2019
Merged

Edit command #703

merged 10 commits into from Nov 26, 2019

Conversation

pepicrft
Copy link
Contributor

@pepicrft pepicrft commented Nov 22, 2019

Related #668

Short description πŸ“

This PR adds a new command, tuist edit to edit the project in a given directory.

Implementation πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

  • Update the ProjectEditor utility to raise an error if the directory doesn't contain editable files.
  • Implement EditCommand

Testing strategy βœ…

  • Support generating a project in the same directory without blocking the execution an add an acceptance test that runs the command, and makes sure the targets compile.

@pepicrft pepicrft requested review from andreacipriani and a team November 22, 2019 17:49
@pepicrft pepicrft self-assigned this Nov 22, 2019
@ghost ghost requested review from kwridan and marciniwanicki and removed request for a team November 22, 2019 17:50
@pepicrft pepicrft changed the title [WIP] Edit command Edit command Nov 25, 2019
@pepicrft
Copy link
Contributor Author

I followed @kwridan's suggestion and used the -W argument. As he pointed out, the xed's -w option doesn't work as expected.

I also added support for a --permanent argument. When passed, it generates the Manifests.xcodeproj in the directory where the user intends to edit the manifests. The acceptance test that I added uses that argument to generate the project in the same directory and make sure that both, the helpers and the manifests target compile.

import ProjectDescription

let setup = Setup([
// .homebrew(packages: ["swiftlint", "carthage"]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftover or you want to keep the commented code for documentation?

let projectDescriptionPath = directory.appending(component: "ProjectDescription.framework")
let project = Project.test(path: directory, name: "Edit")
let graph = Graph.test(name: "Edit")
let helpersDirectory = directory.appending(component: "ProjectDDescriptionHelpers")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo ProjectDDescriptionHelpers, is it actually used?

@pepicrft pepicrft merged commit fe3e8c3 into master Nov 26, 2019
@pepicrft pepicrft deleted the edit-command branch November 26, 2019 13:52
@pepicrft pepicrft mentioned this pull request Nov 26, 2019
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants