This repository has been archived by the owner on Nov 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 247
/
default.build
186 lines (149 loc) · 10.3 KB
/
default.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<?xml version="1.0"?>
<project name="NAnt Examples" default="rebuild">
<property name="root.folder" value="${directory::get-current-directory()}" />
<property name="build.folder" value="${root.folder}/build" />
<property name="solution.folder" value="${root.folder}/main" />
<property name="tools.folder" value="${root.folder}/tools" />
<property name="schema.folder" value="${solution.folder}/schema" />
<property name="program.files.x86" value="${environment::get-variable('ProgramFiles(x86)')}" if="${environment::variable-exists('ProgramFiles(x86)')}"/>
<property name="program.files.x86" value="${environment::get-variable('ProgramFiles')}" unless="${property::exists('program.files.x86')}" />
<property name="program.files" value="${environment::get-variable('ProgramFiles')}" />
<property name="netfx.tools.folder" value="${program.files.x86}/Microsoft SDKs\Windows\v10.0A\Bin\NETFX 4.7.2 Tools" />
<property name="netfx.folder" value="${environment::get-variable('SystemRoot')}/Microsoft.NET" />
<property name="netfx.framework.folder" value="${netfx.folder}/Framework" if="${directory::exists(netfx.folder + '/Framework')}" />
<property name="netfx.framework.folder" value="${netfx.folder}/Framework64" if="${directory::exists(netfx.folder + '/Framework64')}" />
<property name="netfx4.folder" value="${netfx.framework.folder}/v4.0.30319" />
<property name="ci.buildNumber" value="${environment::get-variable('APPVEYOR_BUILD_NUMBER')}" if="${environment::variable-exists('APPVEYOR_BUILD_NUMBER')}"/>
<property name="ci.buildNumber" value="0" unless="${property::exists('ci.buildNumber')}" />
<property name="ci.fullBuildNumber" value="${environment::get-variable('APPVEYOR_BUILD_VERSION')}" if="${environment::variable-exists('APPVEYOR_BUILD_VERSION')}"/>
<property name="ci.fullBuildNumber" value="0" unless="${property::exists('ci.fullBuildNumber')}" />
<property name="ci.gitSha" value="${string::substring(environment::get-variable('APPVEYOR_REPO_COMMIT'), 0, 7)}" if="${environment::variable-exists('APPVEYOR_REPO_COMMIT')}"/>
<property name="ci.gitSha" value="0000000" unless="${property::exists('ci.gitSha')}" />
<property name="coverity.folder" value="C:\Projects\cov-analysis-win64-7.7.0.4\cov-analysis-win64-7.7.0.4\bin" if="${directory::exists('C:\Projects\cov-analysis-win64-7.7.0.4\cov-analysis-win64-7.7.0.4\bin')}" />
<property name="coverity.exe" value="${coverity.folder}/cov-build.exe" if="${property::exists('coverity.folder')}" />
<property name="coverity.exe" value="cov-build.exe" unless="${property::exists('coverity.exe')}" />
<property name="coverity.token" value="" />
<property name="coverity.token" value="${environment::get-variable('COVERITY_TOKEN')}" if="${environment::variable-exists('COVERITY_TOKEN')}" />
<property name="coverity.email" value="" />
<property name="coverity.email" value="${environment::get-variable('COVERITY_EMAIL')}" if="${environment::variable-exists('COVERITY_EMAIL')}" />
<property name="buildnumber.major" value="4" />
<property name="buildnumber.minor" value="7" />
<property name="buildnumber.build" value="${ci.buildNumber}" />
<property name="buildnumber.revision" value="0" />
<property name="buildnumber.version" value="${buildnumber.major}.${buildnumber.minor}.${buildnumber.build}.${buildnumber.revision}" />
<loadtasks assembly="${build.folder}/nantcontrib-0.85/bin/NAnt.Contrib.Tasks.dll" />
<include buildfile="${build.folder}/version.build" />
<include buildfile="${build.folder}/opencover.build" />
<include buildfile="${build.folder}/environment.build" />
<include buildfile="${build.folder}/installer.build" />
<include buildfile="${build.folder}/nuget_package.build" />
<target name="build-environment" depends="get-os-version, create-snk, prepare-environment, get-version-number, generate-release-notes, prepare-sample-project" />
<target name="rebuild" depends="build-environment, clean, build, test" >
<call target="test-cpp" if="${version::get-major(version::parse(machine.version))==6}" />
</target>
<target name="teamcity-build" depends="build-environment, clean" >
<echo>##teamcity[buildNumber '${buildnumber.version}']</echo>
<call target="build-all-platforms" />
</target>
<target name="codeql-build" depends="build-environment build-release-platforms-x64" />
<target name="copy-artefacts" >
<move file="${solution.folder}/OpenCover.Installer/bin/Release/opencover.installer.msi"
tofile="${solution.folder}/bin/installer/opencover.${buildnumber.major}.${buildnumber.minor}.${buildnumber.build}.msi" />
<move file="${solution.folder}/bin/zip/opencover.zip"
tofile="${solution.folder}/bin/zip/opencover.${buildnumber.major}.${buildnumber.minor}.${buildnumber.build}.zip" />
</target>
<target name="generate-coverage-files" depends="dogfood-release, transformcppcoverage, update-coveralls" />
<target name="create-release" depends="clean-all, build-environment, build-release-platforms, test, test-cpp, create-zip-package">
<call target="copy-artefacts" />
<call target="chocolatey-package-portable" />
<call target="chocolatey-package-install" />
<call target="chocolatey-package" />
<call target="nuget-package" />
<call target="set-rc-property" />
<call target="nuget-package" />
<call target="test-bdd" />
<call target="generate-coverage-files" />
</target>
<target name="create-coverity-release" depends="clean-all, build-environment" if="${property::exists('coverity.exe')}">
<exec program="${coverity.exe}" commandline="--dir cov-int --encoding=UTF-8 build.bat build-release-platforms-x64" />
<exec program="${tools.folder}/7-Zip/7za.exe">
<arg value="a" />
<arg value="coverity.zip" />
<arg value="cov-int" />
</exec>
<exec program="${curl.exe}"
commandline='--form token=${coverity.token} --insecure --form email=${coverity.email} --form [email protected] --form version="${ci.fullBuildNumber}" --form description="${ci.fullBuildNumber}" https://scan.coverity.com/builds?project=OpenCover%2Fopencover' />
</target>
<target name="reset-private-vars" >
<setenv name="SONARQUBE_TOKEN" value="" />
<setenv name="COVERITY_TOKEN" value="" />
<setenv name="COVERALLS_REPO_TOKEN" value="" />
</target>
<target name="sonarqube-build" if="${environment::variable-exists('SONARQUBE_TOKEN')}" depends="generate-coverage-files, update-coveralls">
<property name="sonarqube.token" value="${environment::get-variable('SONARQUBE_TOKEN')}" />
<call target="reset-private-vars" />
<exec program="${tools.folder}/7-Zip/7za.exe" unless="${directory::exists('tools\sonarqube\cxx-runner')}">
<arg value="x" />
<arg value="-otools\sonarqube\cxx-runner" />
<arg value="tools\CxxSonarQubeMsbuidRunner.zip" />
</exec>
<exec program="${tools.folder}/7-Zip/7za.exe" unless="${directory::exists('tools\sonarqube\runner')}">
<arg value="x" />
<arg value="-otools\sonarqube\runner" />
<arg value="tools\sonar-scanner-msbuild-4.0.0.821.zip" />
</exec>
<!-- assumes coverage file has been created -->
<exec program='${tools.folder}\sonarqube\cxx-runner\CxxSonarQubeMsbuidRunner.exe'
workingdir='${root.folder}'>
<arg value='/m:main\opencover.sln' />
<arg value='/d:sonar.verbose=true' />
<arg value='/d:sonar.sourceEncoding=UTF-8' />
<arg value='/d:sonar.login=${sonarqube.token}' />
<arg value='/d:sonar.host.url=https://sonarcloud.io' />
<arg value='/d:sonar.cxx.forceIncludes=sonar.h' />
<arg value='/d:sonar.cfamily.build-wrapper-output.bypass=true' />
<arg value='/x:vs17' />
<arg value='/q:${tools.folder}\sonarqube\runner\MSBuild.SonarQube.Runner.exe' />
<arg value='/n:opencover' />
<arg value='/k:opencover' />
<arg value='/o:sawilde-github' />
<arg value='/p:Configuration=release,Platform=x64,GtestRunnerTaskEnabled=false' />
<arg value='/v:"${ci.fullBuildNumber}"' />
<arg value='/d:sonar.cs.opencover.reportsPaths="${root.folder}\main\bin\release\opencovertests.xml"' />
<arg value='/d:sonar.coverageReportPaths="${root.folder}\GenericCoverage.xml"' />
<arg value='/d:sonar.sources="main\OpenCover.Console,main\OpenCover.Framework,main\OpenCover.Extentions,main\OpenCover.Profiler,main\OpenCover.Support,main\OpenCover.MSBuild"' />
<arg value='/d:sonar.tests="main\OpenCover.Test,main\OpenCover.Test.Profiler,main\OpenCover.Specs,main\OpenCover.UITest"' />
<arg value='/d:sonar.exclusions="**\*.config"' />
</exec>
</target>
<target name="quick-build-release" depends="clean, build-environment, build-release-platforms, test, test-cpp" />
<target name="set-rc-property" >
<property name="buildnumber.ci" value="-rc" />
</target>
<target name="cover-cpp" depends="clean-all, build-environment, build-debug-platforms" >
<exec program="${tools.folder}\OpenCppCoverage\OpenCppCoverage.exe" commandline="--modules main\bin\Debug\x64\ --sources ${root.folder}\main --excluded_sources packages -- main\bin\Debug\x64\OpenCover.Test.Profiler.exe" />
</target>
<target name="cover-cpp-release" >
<exec program="${tools.folder}\OpenCppCoverage\OpenCppCoverage.exe" >
<arg value='--modules'/>
<arg value='main\bin\Release\x64'/>
<arg value='--sources'/>
<arg value='${root.folder}\main'/>
<arg value='--export_type=cobertura'/>
<arg value='--excluded_sources'/>
<arg value='packages'/>
<arg value='--excluded_sources'/>
<arg value='OpenCover.Test.Profiler'/>
<arg value='--'/>
<arg value='main\bin\Release\x64\OpenCover.Test.Profiler.exe'/>
</exec>
</target>
<target name="transformcppcoverage" depends="cover-cpp-release" >
<exec program="powershell" >
<arg value="${tools.folder}\CorrectFileCaseOnCppCoverage.ps1" />
<arg value="-xmlFile" />
<arg value="${root.folder}\OpenCover.Test.ProfilerCoverage.xml" />
</exec>
<style style="${tools.folder}\OpenCppCoverageToGenCoverage.xsl" in="${root.folder}\OpenCover.Test.ProfilerCoverage.xml" out="${root.folder}\GenericCoverage.xml"/>
</target>
</project>