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

Build tweaks #1418

Merged
merged 4 commits into from
Sep 1, 2018
Merged

Build tweaks #1418

merged 4 commits into from
Sep 1, 2018

Conversation

adamralph
Copy link
Contributor

No description provided.

build.cmd Outdated
@@ -1 +1,2 @@
@dotnet run --project "%~dp0\tools\FakeItEasy.Build\FakeItEasy.Build.csproj" -- %*
@cd %~dp0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Relative paths are used inside Program.cs. If you don't change working directory, then the targets will fail when run from a subdirectory, e.g. ../build.cmd.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

BTW since you currently need to be in the root folder to run the script, the current inclusion of %~dp0 in the path is redundant.

Copy link
Member

Choose a reason for hiding this comment

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

Changing directories could be disorienting to the user. If we're going to support a "run the build from anywhere" kind of attitude, I think it's polite to pushd and then popd when we're done.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@blairconrad it only changes it for the scope of the script:

image

Copy link
Member

Choose a reason for hiding this comment

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

@adamralph that's only because you're running it from PowerShell. If you were running from cmd, it would stay in the changed directory. So I think pushd/popd is necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahhh, you're right! Thanks, I'll change it.

I guess I need to change this in my other projects too. Or I might just swap build.cmd for build.ps1 to force people to use PowerShell. 😉

Copy link
Member

Choose a reason for hiding this comment

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

Or I might just swap build.cmd for build.ps1 to force people to use PowerShell. 😉

I'd consider doing that for FakeItEasy too... I never use cmd anymore.

@@ -104,7 +104,7 @@ public static void Main(string[] args)
DependsOn("build", "outputDirectory", "pdbgit"),
() =>
{
var version = Read(ToolPaths.GitVersion, "/showvariable NuGetVersionV2", ".");
var version = Read(ToolPaths.GitVersion, "/showvariable NuGetVersionV2");
Copy link
Contributor Author

@adamralph adamralph Sep 1, 2018

Choose a reason for hiding this comment

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

When SimpleExec is passed a working directory, it prints an extra line like so:

Working directory: .

Both this argument and this line are redundant, since "." refers to the current directory.

The other changes to remove ./ are pure refactoring (no observable effect).

@adamralph
Copy link
Contributor Author

adamralph commented Sep 1, 2018

BTW, you could choose to prefix all paths with ./ for explicitness, but it should be consistent. The paths used for Pdbs and TestSuites are already missing the prefix, so I removed them in all other places for consistency.

Copy link
Member

@blairconrad blairconrad left a comment

Choose a reason for hiding this comment

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

Thanks, @adamralph. It is tidier. And it's nice to have the latest stable Bullseye and SimpleExec.
I did ask for one change, but perhaps you and @thomaslevesque think it's foolish.

build.cmd Outdated
@@ -1 +1,2 @@
@dotnet run --project "%~dp0\tools\FakeItEasy.Build\FakeItEasy.Build.csproj" -- %*
@cd %~dp0
Copy link
Member

Choose a reason for hiding this comment

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

Changing directories could be disorienting to the user. If we're going to support a "run the build from anywhere" kind of attitude, I think it's polite to pushd and then popd when we're done.

build.cmd Outdated
@@ -1 +1,2 @@
@dotnet run --project "%~dp0\tools\FakeItEasy.Build\FakeItEasy.Build.csproj" -- %*
@cd %~dp0
Copy link
Member

Choose a reason for hiding this comment

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

@adamralph that's only because you're running it from PowerShell. If you were running from cmd, it would stay in the changed directory. So I think pushd/popd is necessary.

@adamralph
Copy link
Contributor Author

@thomaslevesque I swapped the cd for pushd and popd. Since the change was so trivial I amended the first commit directly, rather than pushing a fixup.

@thomaslevesque
Copy link
Member

@thomaslevesque I swapped the cd for pushd and popd. Since the change was so trivial I amended the first commit directly, rather than pushing a fixup.

👍
Thanks!

@thomaslevesque
Copy link
Member

@blairconrad since your concerns were addressed, I'm taking the liberty of dismissing your review

@thomaslevesque thomaslevesque dismissed blairconrad’s stale review September 1, 2018 14:48

Requested changes have been made

@thomaslevesque thomaslevesque merged commit b47f50f into FakeItEasy:develop Sep 1, 2018
@thomaslevesque
Copy link
Member

Thanks @adamralph!

@blairconrad
Copy link
Member

Yes thanks, @adamralph. And @thomaslevesque, dismissing my review was the right move!

@blairconrad blairconrad added this to the vNext milestone Sep 1, 2018
@adamralph adamralph deleted the build-tweaks branch September 2, 2018 07:16
@blairconrad
Copy link
Member

This change has been released as part of FakeItEasy 4.8.1.

Thanks, @adamralph. Look for your name in the release notes. 🏆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants