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

New command-line build and verify #233

Merged
merged 5 commits into from
Apr 20, 2014
Merged

Conversation

adamchester
Copy link
Contributor

This PR introduces a new command-line build and verify. Using build.cmd from a VS command line, in the root project folder, the following happens (by default):

  • the solution is built in Release and Verify configurations
  • in the new Verify configuration, code analysis, and msbuild 'treat warnings as errors' are enabled. CA ruleset is based on the 'Microsoft Managed Recommended Rules' from VS 2013. All enabled rules are set to error on violations.
  • Xunit tests are executed, reporting any errors

Sample output:

c:\My\repo\Humanizer>build
Microsoft (R) Build Engine version 12.0.30324.0
[Microsoft .NET Framework, version 4.0.30319.34014]
Copyright (C) Microsoft Corporation. All rights reserved.

  Humanizer -> C:\My\repo\Humanizer\src\Humanizer\bin\Verify\Humanizer.dll
  Running Code Analysis...
  Code Analysis Complete -- 0 error(s), 0 warning(s)
  Humanizer.Tests -> c:\My\repo\Humanizer\Src\Humanizer.Tests\bin\Verify\Humanizer.Tests.dll
  Running Code Analysis...
  Code Analysis Complete -- 0 error(s), 0 warning(s)
  Humanizer -> C:\My\repo\Humanizer\src\Humanizer\bin\Release\Humanizer.dll
  Humanizer.Tests -> c:\My\repo\Humanizer\Src\Humanizer.Tests\bin\Release\Humanizer.Tests.dll
  xUnit.net MSBuild runner (32-bit .NET 4.0.30319.34014)
  xunit.dll:     Version 1.9.1.1600
  Test assembly: c:\My\repo\Humanizer\src\Humanizer.Tests\bin\Release\Humanizer.Tests.dll
    Tests: 3619, Failures: 0, Skipped: 0, Time: 0.845 seconds

This is based on the Albedo project. I removed the nuget and versioning-related tasks. They could be added back if needed.

// cc @moodmosaic - would appreciate your feedback, if you can :)

@@ -1,6 +1,8 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012

Choose a reason for hiding this comment

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

Is it necessary to change the Visual Studio version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess it's not necessary, but they are still backwards compatible.

@moodmosaic
Copy link

@adamchester It looks good! I left a few comments that, I think, can be easily addressed. :)

@MehdiK
Copy link
Member

MehdiK commented Apr 19, 2014

Cool. Thanks a lot guys for the work and discussions.

@adamchester #230 is in. Please let me know when you're happy with this and I can merge it.

by using `build.cmd` from a VS command line, in the root project folder, the following happens (by default):
 - the solution is built in Release and Verify configurations
 - in the new Verify configuration, code analysis, and msbuild 'treat warnings as errors' are enabled. CA ruleset is based on the 'Microsoft Managed Recommended Rules' from VS 2013. All enabled rules are set to error on violations.
 - Xunit tests are executed, reporting any errors

This is based on the Albedo project (https://github.com/ploeh/Albedo). I removed the nuget and versioning-related tasks. They could be added back if needed.
@adamchester
Copy link
Contributor Author

OK, I think it's ready :)

<Target Name="CleanVerify">
<MSBuild Projects="@(ProjectToBuild)" Targets="Clean" Properties="Configuration=Verify" />
</Target>
<Target Name="CleanRelease">
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need to run Release too?

Copy link
Member

Choose a reason for hiding this comment

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

Do'h. Never mind.

@MehdiK MehdiK merged commit b3ab7a8 into Humanizr:master Apr 20, 2014
@MehdiK
Copy link
Member

MehdiK commented Apr 20, 2014

This is awesome. Thanks for the great work @adamchester :)

I added this to release-notes and readme files.

@adamchester adamchester deleted the build-verify branch April 20, 2014 08:54
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

3 participants