Skip to content

Commit d3176ad

Browse files
authored
Merge pull request #14 from kkm000/add-props
Add .props file to initialize all contract settings
2 parents cb52a7f + 6614210 commit d3176ad

File tree

2 files changed

+156
-1
lines changed

2 files changed

+156
-1
lines changed

nuget/CodeContracts.MSBuild/CodeContracts.MSBuild.nuspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<tags>CodeContracts Code Contracts MSBuild</tags>
1919
</metadata>
2020
<files>
21-
<file src="build\CodeContracts.MSBuild.targets" target="build\CodeContracts.MSBuild.targets" />
21+
<file src="build\CodeContracts.MSBuild.*" target="build\" />
2222
<file src="..\..\Contracts\**" target="Contracts" />
2323
</files>
2424
</package>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<PropertyGroup>
3+
<!--=====================================================================
4+
CODE CONTRACT DEFAULTS.
5+
All defaults are set as they were by the late Visual Studio extension,
6+
except for enabling the static checker by default (otherwise the user
7+
would not be adding the package in the first place).
8+
9+
Names in comments correspond to the the original property page.
10+
======================================================================-->
11+
12+
<!--=====================================================================
13+
Runtime checking. If false, whole section is irrelevant.
14+
======================================================================-->
15+
<CodeContractsEnableRuntimeChecking Condition="
16+
'$(CodeContractsEnableRuntimeChecking)' == ''">False</CodeContractsEnableRuntimeChecking>
17+
18+
<!-- Assembly mode, 1 = standard, 2 = advanced. -->
19+
<CodeContractsAssemblyMode Condition="
20+
'$(CodeContractsAssemblyMode)' == ''">1</CodeContractsAssemblyMode>
21+
22+
<!-- Level drop-down: Full, Pre and Post, Preconditions, ReleaseRequires, None -->
23+
<CodeContractsRuntimeCheckingLevel Condition="
24+
'$(CodeContractsRuntimeCheckingLevel)' == ''">Full</CodeContractsRuntimeCheckingLevel>
25+
<!-- [ ] Only public surface contracts -->
26+
<CodeContractsRuntimeOnlyPublicSurface Condition="
27+
'$(CodeContractsRuntimeOnlyPublicSurface)' == ''">False</CodeContractsRuntimeOnlyPublicSurface>
28+
<!-- [ ] Assert on contract failure -->
29+
<CodeContractsRuntimeThrowOnFailure Condition="
30+
'$(CodeContractsRuntimeThrowOnFailure)' == ''">False</CodeContractsRuntimeThrowOnFailure>
31+
<!-- [ ] Call-site requires checking -->
32+
<CodeContractsRuntimeCallSiteRequires Condition="
33+
'$(CodeContractsRuntimeCallSiteRequires)' == ''">False</CodeContractsRuntimeCallSiteRequires>
34+
<!-- [ ] Skip quantifiers -->
35+
<CodeContractsRuntimeSkipQuantifiers Condition="
36+
'$(CodeContractsRuntimeSkipQuantifiers)' == ''">False</CodeContractsRuntimeSkipQuantifiers>
37+
38+
<!-- Customer rewriter methods / Assembly -->
39+
<CodeContractsCustomRewriterAssembly Condition="
40+
'$(CodeContractsCustomRewriterAssembly)' == ''" />
41+
<!-- Customer rewriter methods / Class -->
42+
<CodeContractsCustomRewriterClass Condition="
43+
'$(CodeContractsCustomRewriterClass)' == ''" />
44+
45+
<!--=====================================================================
46+
Static checking. If false, whole section is irrelevant.
47+
======================================================================-->
48+
<CodeContractsRunCodeAnalysis Condition="
49+
'$(CodeContractsRunCodeAnalysis)' == ''">True</CodeContractsRunCodeAnalysis>
50+
51+
<!-- [X] Check non-null -->
52+
<CodeContractsNonNullObligations Condition="
53+
'$(CodeContractsNonNullObligations)' == ''">True</CodeContractsNonNullObligations>
54+
<!-- [X] Check enum values -->
55+
<CodeContractsEnumObligations Condition="
56+
'$(CodeContractsEnumObligations)' == ''">True</CodeContractsEnumObligations>
57+
<!-- [X] Check redundant assume -->
58+
<CodeContractsRedundantAssumptions Condition="
59+
'$(CodeContractsRedundantAssumptions)' == ''">True</CodeContractsRedundantAssumptions>
60+
<!-- [ ] Show entry assumptions -->
61+
<CodeContractsSuggestAssumptions Condition="
62+
'$(CodeContractsSuggestAssumptions)' == ''">False</CodeContractsSuggestAssumptions>
63+
<!-- [ ] Suggest requires -->
64+
<CodeContractsSuggestRequires Condition="
65+
'$(CodeContractsSuggestRequires)' == ''">False</CodeContractsSuggestRequires>
66+
<!-- [X] Suggest asserts to contracts -->
67+
<CodeContractsAssertsToContractsCheckBox Condition="
68+
'$(CodeContractsAssertsToContractsCheckBox)' == ''">True</CodeContractsAssertsToContractsCheckBox>
69+
<!-- [X] Infer requires -->
70+
<CodeContractsInferRequires Condition="
71+
'$(CodeContractsInferRequires)' == ''">True</CodeContractsInferRequires>
72+
<!-- [ ] Infer ensures -->
73+
<CodeContractsInferEnsures Condition="
74+
'$(CodeContractsInferEnsures)' == ''">False</CodeContractsInferEnsures>
75+
<!-- [X] Check arithmetic -->
76+
<CodeContractsArithmeticObligations Condition="
77+
'$(CodeContractsArithmeticObligations)' == ''">True</CodeContractsArithmeticObligations>
78+
<!-- [X] Check missing public requires -->
79+
<CodeContractsMissingPublicRequiresAsWarnings Condition="
80+
'$(CodeContractsMissingPublicRequiresAsWarnings)' == ''">True</CodeContractsMissingPublicRequiresAsWarnings>
81+
<!-- [X] Check redundant conditionals -->
82+
<CodeContractsRedundantTests Condition="
83+
'$(CodeContractsRedundantTests)' == ''">True</CodeContractsRedundantTests>
84+
<!-- [ ] Show external assumptions -->
85+
<CodeContractsSuggestAssumptionsForCallees Condition="
86+
'$(CodeContractsSuggestAssumptionsForCallees)' == ''">False</CodeContractsSuggestAssumptionsForCallees>
87+
<!-- [X] Suggest readonly fields -->
88+
<CodeContractsSuggestReadonly Condition="
89+
'$(CodeContractsSuggestReadonly)' == ''">True</CodeContractsSuggestReadonly>
90+
<!-- [X] Suggest necessary ensures -->
91+
<CodeContractsNecessaryEnsures Condition="
92+
'$(CodeContractsNecessaryEnsures)' == ''">True</CodeContractsNecessaryEnsures>
93+
<!-- [ ] Infer invariants for readonly -->
94+
<CodeContractsInferObjectInvariants Condition="
95+
'$(CodeContractsInferObjectInvariants)' == ''">False</CodeContractsInferObjectInvariants>
96+
<!-- [X] Infer ensures for autoproperties -->
97+
<CodeContractsInferEnsuresAutoProperties Condition="
98+
'$(CodeContractsInferEnsuresAutoProperties)' == ''">True</CodeContractsInferEnsuresAutoProperties>
99+
<!-- [ ] Fail build on warnings -->
100+
<CodeContractsFailBuildOnWarnings Condition="
101+
'$(CodeContractsFailBuildOnWarnings)' == ''">False</CodeContractsFailBuildOnWarnings>
102+
<!-- [X] Check array bounds -->
103+
<CodeContractsBoundsObligations Condition="
104+
'$(CodeContractsBoundsObligations)' == ''">True</CodeContractsBoundsObligations>
105+
<!-- [ ] Check missing public ensures -->
106+
<CodeContractsMissingPublicEnsuresAsWarnings Condition="
107+
'$(CodeContractsMissingPublicEnsuresAsWarnings)' == ''">False</CodeContractsMissingPublicEnsuresAsWarnings>
108+
<!-- [ ] Suggest object invariants -->
109+
<CodeContractsSuggestObjectInvariants Condition="
110+
'$(CodeContractsSuggestObjectInvariants)' == ''">False</CodeContractsSuggestObjectInvariants>
111+
112+
<!-- [X] Cache results -->
113+
<CodeContractsCacheAnalysisResults Condition="
114+
'$(CodeContractsCacheAnalysisResults)' == ''">True</CodeContractsCacheAnalysisResults>
115+
<!-- SQL Server -->
116+
<CodeContractsSQLServerOption Condition="
117+
'$(CodeContractsSQLServerOption)' == ''" />
118+
<!-- [ ] Skip the analysis if cannot connect to cache -->
119+
<CodeContractsSkipAnalysisIfCannotConnectToCache Condition="
120+
'$(CodeContractsSkipAnalysisIfCannotConnectToCache)' == ''">False</CodeContractsSkipAnalysisIfCannotConnectToCache>
121+
<!-- Warning level slider, 0..3 -->
122+
<CodeContractsAnalysisWarningLevel Condition="
123+
'$(CodeContractsAnalysisWarningLevel)' == ''">0</CodeContractsAnalysisWarningLevel>
124+
<!-- [X] Be optimistic on external API -->
125+
<CodeContractsBeingOptimisticOnExternal Condition="
126+
'$(CodeContractsBeingOptimisticOnExternal)' == ''">True</CodeContractsBeingOptimisticOnExternal>
127+
<!-- [ ] Baseline -->
128+
<CodeContractsUseBaseLine Condition="
129+
'$(CodeContractsUseBaseLine)' == ''">False</CodeContractsUseBaseLine>
130+
<!-- Baseline file -->
131+
<CodeContractsBaseLineFile Condition="
132+
'$(CodeContractsBaseLineFile)' == ''" />
133+
134+
<!-- Contract reference assembly -->
135+
<CodeContractsReferenceAssembly Condition="
136+
'$(CodeContractsReferenceAssembly)' == ''">Build</CodeContractsReferenceAssembly>
137+
<!-- [ ] Emit contracts into XML doc file -->
138+
<CodeContractsEmitXMLDocs Condition="
139+
'$(CodeContractsEmitXMLDocs)' == ''">False</CodeContractsEmitXMLDocs>
140+
141+
<!--=====================================================================
142+
Advanced options.
143+
======================================================================-->
144+
145+
<!-- Extra contract library paths -->
146+
<CodeContractsLibPaths Condition="
147+
'$(CodeContractsLibPaths)' == ''" />
148+
<!-- Extra runtime checker options -->
149+
<CodeContractsExtraRewriteOptions Condition="
150+
'$(CodeContractsExtraRewriteOptions)' == ''" />
151+
<!-- Extra static checker options -->
152+
<CodeContractsExtraAnalysisOptions Condition="
153+
'$(CodeContractsExtraAnalysisOptions)' == ''" />
154+
</PropertyGroup>
155+
</Project>

0 commit comments

Comments
 (0)