-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppVeyor.proj
More file actions
157 lines (139 loc) · 8.08 KB
/
AppVeyor.proj
File metadata and controls
157 lines (139 loc) · 8.08 KB
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
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="AppVeyor">
<UsingTask TaskName="ReplaceFileText" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<InputFilename ParameterType="System.String" Required="true" />
<OutputFilename ParameterType="System.String" Required="true" />
<MatchExpression ParameterType="System.String" Required="true" />
<ReplacementText ParameterType="System.String" Required="true" />
<XmlEncode ParameterType="System.Boolean" Required="false" />
</ParameterGroup>
<Task>
<Reference Include="System.Core" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
<Using Namespace="System" />
<Using Namespace="System.IO" />
<Using Namespace="System.Text.RegularExpressions" />
<Using Namespace="System.Xml.Linq" />
<Code Type="Fragment" Language="cs">
<![CDATA[
var replace = ReplacementText;
if(XmlEncode) {
replace = new XElement("t", replace).LastNode.ToString();
}
File.WriteAllText(
OutputFilename,
Regex.Replace(File.ReadAllText(InputFilename), MatchExpression, replace));
]]>
</Code>
</Task>
</UsingTask>
<ItemGroup>
<XU_RESULTSFILE Include="XUnitResults.xml" />
<OC_RESULTSFILE Include="opencover.xml" />
<SQ_RESULTSFILES Include="@(XU_RESULTSFILE);@(OC_RESULTSFILE)" />
<SQ_WORKDIR Include=".sonarqube" />
</ItemGroup>
<PropertyGroup>
<IS_PRERELEASE Condition="'$(IS_PRERELEASE)' == ''">True</IS_PRERELEASE>
<APPVEYOR_BUILD_VERSION Condition="'$(APPVEYOR_BUILD_VERSION)' == ''">1.0.0.0</APPVEYOR_BUILD_VERSION>
<BUILD_VERSION_BASE Condition="'$(BUILD_VERSION_BASE)' == ''">$(APPVEYOR_BUILD_VERSION)</BUILD_VERSION_BASE>
<BUILD_VERSION_SUFFIX Condition="'$(IS_PRERELEASE)' == 'True'">-prerelease</BUILD_VERSION_SUFFIX>
<BUILD_VERSION Condition="'$(BUILD_VERSION)' == ''">$(BUILD_VERSION_BASE)$(BUILD_VERSION_SUFFIX)</BUILD_VERSION>
<NUGET_VERSION Condition="'$(NUGET_VERSION)' == ''">$(BUILD_VERSION)</NUGET_VERSION>
<APPVEYOR_REPO_COMMIT_MESSAGE Condition="'$(APPVEYOR_REPO_COMMIT_MESSAGE)' == ''">The 2nd generation of NuLog!</APPVEYOR_REPO_COMMIT_MESSAGE>
<RELEASE_NOTES Condition="'$(RELEASE_NOTES)' == ''">$(APPVEYOR_REPO_COMMIT_MESSAGE)</RELEASE_NOTES>
<ASSEMBLY_COPYRIGHT Condition="'$(ASSEMBLY_COPYRIGHT)' == ''">© 2020 Ivan Andrew Pointer</ASSEMBLY_COPYRIGHT>
<TESTS_DLLS Condition="'$(TESTS_DLLS)' == ''">NuLog.Tests\bin\Debug\NuLog.Tests.dll NuLog.NetFramework.Tests\bin\Debug\NuLog.NetFramework.Tests.dll</TESTS_DLLS>
<XU_VERSION Condition="'$(XU_VERSION)' == ''">2.4.1</XU_VERSION>
<XU_RUNNER Condition="'$(XU_RUNNER)' == ''">packages\xunit.runner.console.$(XU_VERSION)\tools\net472\xunit.console.x86.exe</XU_RUNNER>
<XU_EXCLUDE Condition="'$(XU_EXCLUDE)' == ''">-notrait Category=Unit-Exclude</XU_EXCLUDE>
<XU_COMMAND Condition="'$(XU_COMMAND)' == ''">$(XU_RUNNER) $(TESTS_DLLS) $(XU_EXCLUDE) -xml "@(XU_RESULTSFILE)"</XU_COMMAND>
<OC_REGISTER Condition="'$(OC_REGISTER)' == ''">user</OC_REGISTER>
<OC_VERSION Condition="'$(OC_VERSION)' == ''">4.7.922</OC_VERSION>
<OC_RUNNER Condition="'$(OC_RUNNER)' == ''">packages\OpenCover.$(OC_VERSION)\tools\OpenCover.Console.exe</OC_RUNNER>
<OC_FILTER Condition="'$(OC_FILTER)' == ''">+[NuLog*]* -[NuLog.Tests]* -[NuLog.NetFramework.Tests]* -[NuLog.CLI*]* -[NuLogSnippets*]*</OC_FILTER>
<OC_EXCLUDEFILES Condition="'$(OC_EXCLUDEFILES)' == ''">*Shim.cs</OC_EXCLUDEFILES>
<!-- OC_SEARCHDIRS SHOULD BE SEMI-COLON DELIMITED -->
<OC_SEARCHDIRS Condition="'$(OC_SEARCHDIRS)' == ''">NuLog.Tests\bin\Debug;NuLog.NetFramework.Tests\bin\Debug</OC_SEARCHDIRS>
<OC_COMMAND>$(OC_RUNNER) -output:"@(OC_RESULTSFILE)" -register:$(OC_REGISTER) -target:"$(XU_RUNNER)" -targetargs:"$(TESTS_DLLS) $(XU_EXCLUDE)" -filter:"$(OC_FILTER)" -excludebyfile:"$(OC_EXCLUDEFILES)" -searchdirs:$(OC_SEARCHDIRS)</OC_COMMAND>
<SQ_VERSION Condition="'$(SQ_VERSION)' == ''">4.9.0</SQ_VERSION>
<SQ_SCANNER Condition="'$(SQ_SCANNER)' == ''">packages\dotnet-framework-sonarscanner.$(SQ_VERSION)\tools\SonarScanner.MSBuild.exe</SQ_SCANNER>
<SQ_PROJECT Condition="'$(SQ_PROJECT)' == ''">NuLog</SQ_PROJECT>
<SQ_HOST Condition="'$(SQ_HOST)' == ''">https://sonarcloud.io</SQ_HOST>
<SQ_ORG Condition="'$(SQ_ORG)' == ''">ivanpointer-github</SQ_ORG>
<SQ_LOGIN Condition="'$(SQ_LOGIN)' == ''">58b6e7e4bd6e2e4dbd0dadce9c705646bf6449af</SQ_LOGIN>
<SQ_EXCL Condition="'$(SQ_EXCL)' == ''">NuLogSnippets/**/*,**/*Shim.cs,NuLog.CLI*/**/*,**/LogFactoryActivatorNull.cs</SQ_EXCL>
<SQ_PREPARE_COMMAND Condition="'$(SQ_PREPARE_COMMAND)' == ''">$(SQ_SCANNER) begin /k:"$(SQ_PROJECT)" /v:"$(BUILD_VERSION)" /o:"$(SQ_ORG)" /d:"sonar.host.url=$(SQ_HOST)" /d:"sonar.login=$(SQ_LOGIN)" /d:sonar.cs.xunit.reportsPaths="@(XU_RESULTSFILE)" /d:sonar.cs.opencover.reportsPaths="@(OC_RESULTSFILE)" /d:sonar.coverage.exclusions="$(SQ_EXCL)" /d:sonar.cpd.exclusions="$(SQ_EXCL)"</SQ_PREPARE_COMMAND>
<SQ_END_COMMAND Condition="'$(SQ_END_COMMAND)' == ''">$(SQ_SCANNER) end /d:"sonar.login=$(SQ_LOGIN)"</SQ_END_COMMAND>
</PropertyGroup>
<ItemGroup>
<ProjectToBuild Include="NuLog.sln">
<Properties>Configuration=Release</Properties>
</ProjectToBuild>
<SQ_PROJECT Include="NuLog.sln">
<Properties>Configuration=Debug</Properties>
</SQ_PROJECT>
</ItemGroup>
<Target Name="AppVeyor" DependsOnTargets="Restore;Inspect;AppVeyorBuild">
</Target>
<Target Name="AppVeyorBuild">
<ItemGroup>
<AssemblyInfoFiles Include="**\NuLog*\**\AssemblyInfo.cs" />
<FilesToDelete Include="**\NuLog*0.0.0-rc0.nupkg" />
<NuspecFiles Include="**\*.nuspec" />
</ItemGroup>
<ReplaceFileText
InputFilename="%(AssemblyInfoFiles.Identity)"
OutputFilename="%(AssemblyInfoFiles.Identity)"
MatchExpression="AssemblyCopyright\("[^"]*"\)"
ReplacementText="AssemblyCopyright("$(ASSEMBLY_COPYRIGHT)")" />
<ReplaceFileText
InputFilename="%(AssemblyInfoFiles.Identity)"
OutputFilename="%(AssemblyInfoFiles.Identity)"
MatchExpression="AssemblyVersion\("[^"]*"\)"
ReplacementText="AssemblyVersion("$(BUILD_VERSION_BASE)")" />
<ReplaceFileText
InputFilename="%(AssemblyInfoFiles.Identity)"
OutputFilename="%(AssemblyInfoFiles.Identity)"
MatchExpression="AssemblyFileVersion\("[^"]*"\)"
ReplacementText="AssemblyFileVersion("$(BUILD_VERSION_BASE)")" />
<MSBuild Projects="@(ProjectToBuild)" />
<ReplaceFileText
InputFilename="%(NuspecFiles.Identity)"
OutputFilename="%(NuspecFiles.Identity)"
MatchExpression="\$releaseNotes\$"
ReplacementText="$(RELEASE_NOTES)"
XmlEncode="True" />
<Exec Command="nuget pack "%(NuspecFiles.FullPath)" -version $(BUILD_VERSION)" />
<Delete Files="@(FilesToDelete)" />
</Target>
<Target Name="Restore">
<MSBuild Projects="@(ProjectToBuild)" Targets="Restore" />
</Target>
<Target Name="Inspect" DependsOnTargets="Restore;SonarQube">
</Target>
<Target Name="SonarQube" DependsOnTargets="Restore;PrepareSonarQube;SonarQubeBuild;ExecuteXUnit;ExecuteOpenCover;FinalizeSonarQube;CleanupSonarQube">
</Target>
<Target Name="PrepareSonarQube">
<Delete Files="@(SQ_WORKDIR)" />
<Delete Files="@(SQ_RESULTSFILES)" />
<Exec Command="$(SQ_PREPARE_COMMAND)" />
</Target>
<Target Name="SonarQubeBuild">
<MSBuild Projects="@(SQ_PROJECT)" />
</Target>
<Target Name="ExecuteXUnit">
<Exec Command="$(XU_COMMAND)" />
</Target>
<Target Name="ExecuteOpenCover">
<Exec Command="$(OC_COMMAND)" />
</Target>
<Target Name="FinalizeSonarQube">
<Exec Command="$(SQ_END_COMMAND)" />
</Target>
<Target Name="CleanupSonarQube">
<!--<Delete Files="@(SQ_WORKDIR)" />-->
<!--<Delete Files="@(SQ_RESULTSFILES)" />-->
</Target>
</Project>