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 targets to MSBuild #11968

Merged
merged 1 commit into from
Aug 29, 2022

Conversation

memsharded
Copy link
Member

@memsharded memsharded commented Aug 26, 2022

Changelog: Feature: Add MSBuild().build(.., targets=["target1"]) argument to new MSBuild.
Docs: conan-io/docs#2724

Close #11966

@memsharded memsharded requested a review from uilianries August 26, 2022 17:25
@memsharded memsharded added this to the 1.52 milestone Aug 26, 2022
@@ -41,10 +41,15 @@ def command(self, sln):
if maxcpucount:
cmd += " /m:{}".format(maxcpucount)

if targets:
if not isinstance(targets, list):
Copy link
Contributor

Choose a reason for hiding this comment

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

why? I would allow any Iterable, so generator/co-routine could be used here

Copy link
Member Author

Choose a reason for hiding this comment

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

I prefer interfaces to be as defined, limited, and constrained as possible, and open them up when real use cases happen. If you have a generator just call the method msbuild.build(...targets=list(yourstuff))

Example: If we allow an Iterable, it happens that a string is Iterable, so users passing a string target="mytarget", will get a /target=m;y;t;a;r;g;e;t that will produce a more difficult to interpret later at build output. You can say, now you have to handle the string case differently in the method, and that starts to add code to the method, that needs to be tested, documented, and maintained, and this is exactly what I want to avoid

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.

[feature] MSBuild add targets parameter again
3 participants