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

add spm-module to complete command #275

Merged
merged 3 commits into from
Oct 18, 2016
Merged

add spm-module to complete command #275

merged 3 commits into from
Oct 18, 2016

Conversation

vdka
Copy link
Contributor

@vdka vdka commented Oct 18, 2016

Adds support for reading the build commands from the build.yaml file
closes #270

Copy link
Owner

@jpsim jpsim left a comment

Choose a reason for hiding this comment

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

Could you please add a changelog entry, following the guidelines in CONTRIBUTING.md?

It's also really unfortunate that we don't have SPM tests at the moment, but arguably out of scope for this PR.

@@ -51,6 +53,13 @@ struct CompleteCommand: CommandProtocol {
}

var args = ["-c", path]
Copy link
Owner

Choose a reason for hiding this comment

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

I don't think we should be mixing user-provided arguments with SPM-based ones. How's this instead?

var args: [String]
if !options.spmModule.isEmpty {
    guard let module = Module(spmName: options.spmModule) else {
        return .failure(.invalidArgument(description: "Bad module name"))
    }
    args = module.compilerArguments
} else {
    args = ["-c", path] + options.compilerargs
    if args.index(of: "-sdk") == nil {
        args.append(contentsOf: ["-sdk", sdkPath()])
    }
}

vdka added 2 commits October 19, 2016 08:07
Adds support for reading the build commands from the `build.yaml` file
closes jpsim#270
@vdka
Copy link
Contributor Author

vdka commented Oct 18, 2016

I have rebased onto the latest commit and made the changes suggested. Is there any documentation I need to update with this new flag?

and include link to related issue
@jpsim
Copy link
Owner

jpsim commented Oct 18, 2016

Is there any documentation I need to update with this new flag?

Could have updated the "Complete" section of the README, but that's unnecessary I think. Documentation in the changelog is sufficient IMO.

Thanks!

@jpsim jpsim merged commit 66ad4c4 into jpsim:master Oct 18, 2016
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.

Module support
2 participants