Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Add flag to generate cccheck RSP at build time #459

Merged

Conversation

yaakov-h
Copy link
Contributor

This PR adds a new flag to the MSBuild properties, CodeContractsDeferCodeAnalysis. If this is set, Code Contracts will do everything it need to do for static analysis except actually run cccheck.exe.

This allows developers and automated build processes to manually run the static check at a later time by invoking cccheck.exe @MyAssemblyName.rsp.

This option is exposed in the Visual Studio properties pane as 'Create checking artifacts only'. If this option is selected, 'Check in background' and 'Fail build on warnings' are disabled as they are no longer relevant.

This PR also includes minor fixes observed from the BuildCC.bat build log, and renames the RSP files from MyAssemblyNameccrewrite.rsp, for example, to MyAssemblyName.ccrewrite.rsp.

This has been functionally tested in Visual Studio 2015.

Copy link
Contributor

@SergeyTeplyakov SergeyTeplyakov left a comment

Choose a reason for hiding this comment

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

Looks good to me.

{
this.handleError(new Error(1080, message, binding.SourceContext));
}
this.handleError(new Error(1080, message, binding.SourceContext));
Copy link
Contributor

Choose a reason for hiding this comment

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

Not clear from this review: does it really guaranteed that handleError is not null?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's an invariant on it as non-null. It's also only set from the constructor, which has a precondition for non-null.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good.

@SergeyTeplyakov SergeyTeplyakov merged commit a7df47a into microsoft:master Dec 12, 2016
@yaakov-h yaakov-h mentioned this pull request Mar 20, 2017
6 tasks
@yaakov-h yaakov-h deleted the wtg/pr/rsp-generation branch April 24, 2018 13:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants