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

GH2140: PR DotNetCorePublish does not respect SelfContained DotNetCorePublishSettings property #2140 #2142

Merged
merged 1 commit into from
Jun 21, 2018
Merged

GH2140: PR DotNetCorePublish does not respect SelfContained DotNetCorePublishSettings property #2140 #2142

merged 1 commit into from
Jun 21, 2018

Conversation

klabranche
Copy link

Made SelfContainedproperty of DotNetPublishSettings a nullable boolean since no setting means it takes…the .Net default of true when runtime is included. Added the logic to include false for self contain and test when running DotNetPublish.

#2140

@dnfclas
Copy link

dnfclas commented Apr 25, 2018

CLA assistant check
All CLA requirements met.

}
else
{
builder.Append("--self-contained false");
Copy link
Member

Choose a reason for hiding this comment

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

Can we divide this into two separate appends instead?

Copy link
Author

Choose a reason for hiding this comment

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

You mean two separate ifs, one for true and another if for false?

Copy link
Member

Choose a reason for hiding this comment

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

No, like this:

builder.Append("--self-contained");
builder.Append("false");

Copy link
Author

Choose a reason for hiding this comment

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

oh... sure

@kcamp
Copy link
Contributor

kcamp commented Apr 25, 2018

As discovered in GH-2136, this (change from bool to bool?) will be a breaking change. See GH-2039 and GH-2040.

@patriksvensson
Copy link
Member

@kcamp Correct, but I think the impact will be minimal from changing this property (especially since it hasn't worked properly before).

@kcamp
Copy link
Contributor

kcamp commented Apr 25, 2018

No prob. Just trying to avoid a repeat. 👍

@klabranche
Copy link
Author

@kcamp is this a breaking change, it's not working as is.... This wouldn't create a regression at all?

Copy link
Author

@klabranche klabranche left a comment

Choose a reason for hiding this comment

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

I could also rewrite a bit differently, less code but maybe less readable....
From:

            if (settings.SelfContained.HasValue)
            {
                if (settings.SelfContained.Value)
                {
                    builder.Append("--self-contained");
                }
                else
                {
                    builder.Append("--self-contained");
                    builder.Append("false");
                }
            }

To:

            if (settings.SelfContained.HasValue)
            {
		builder.Append("--self-contained");
                if (!settings.SelfContained.Value)
                {
                    builder.Append("false");
                }
            }

I prefer the current version, it feels more clear/readable to me....

@patriksvensson
Copy link
Member

@klabranche Yeah, I think the current version is more readable as well 👍

@klabranche
Copy link
Author

Always nice to see every build fail.... Anything I can do @patriksvensson? Assuming not....

@kcamp
Copy link
Contributor

kcamp commented Apr 25, 2018

@klabranche It looks like some extra whitespace (line break) in the style analysis. You should be able to check build output via TC by logging in as guest.

[18:57:40][Step 1/1] Tools\DotNetCore\Publish\DotNetCorePublisher.cs(129,1): error SA1507: Code should not contain multiple blank lines in a row [Z:\buildAgent\work\218bb411df7337f7\src\Cake.Common\Cake.Common.csproj]
[18:57:40][Step 1/1] Tools\DotNetCore\Publish\DotNetCorePublisher.cs(129,1): error SA1507: Code should not contain multiple blank lines in a row [Z:\buildAgent\work\218bb411df7337f7\src\Cake.Common\Cake.Common.csproj]

@klabranche
Copy link
Author

OH.... didn't know that but also read the contribs and didn't realize I had some extra lines... my bad....

@klabranche
Copy link
Author

klabranche commented Apr 27, 2018

All good to go it looks like. :-) ?

@devlead devlead changed the title PR DotNetCorePublish does not respect SelfContained DotNetCorePublishSettings property #2140 GH2140: PR DotNetCorePublish does not respect SelfContained DotNetCorePublishSettings property #2140 Jun 20, 2018
since no setting means it takes the .Net default of true when runtime is included.
Added the logic to include false for self contain and test
Fixes #2140
Copy link
Member

@devlead devlead left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@devlead devlead merged commit 1628eb1 into cake-build:develop Jun 21, 2018
@devlead
Copy link
Member

devlead commented Jun 21, 2018

@klabranche your changes have been merged, thanks for your contribution 👍

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.

7 participants