-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
75 lines (62 loc) · 2.91 KB
/
build.xml
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
<?xml version="1.0"?>
<project name="MPXJ.Net" default="archive" basedir=".">
<property environment="env"/>
<property name="mpxj.version" value="13.7.0" />
<property name="mpxj.net.version" value="${mpxj.version}" />
<target name="update-version-numbers" description="Ensure that version numbers in the code are up-to-date">
<replaceregexp file="${basedir}/MPXJ.Net/MPXJ.Net.csproj"
match="<Version>.+</Version>"
replace="<Version>${mpxj.net.version}</Version>"
byline="true"/>
<replaceregexp file="${basedir}/MPXJ.Net/MPXJ.Net.csproj"
match='Include="net.sf.mpxj:mpxj" Version=".+"'
replace='Include="net.sf.mpxj:mpxj" Version="${mpxj.version}"'
byline="true"/>
</target>
<target name="clean">
<delete includeemptydirs="true">
<fileset dir="${basedir}" defaultexcludes="false">
<include name="**/bin/**" />
<include name="**/obj/**" />
</fileset>
</delete>
<exec executable="dotnet" dir="${basedir}" failonerror="true">
<arg line="clean MPXJ.Net.sln" />
</exec>
<mkdir dir="${basedir}/mpxj.net/bin/Release" />
</target>
<target name="build" depends="clean, update-version-numbers">
<exec executable="dotnet" dir="${basedir}" failonerror="true">
<arg line="build --configuration Release MPXJ.Net.sln" />
</exec>
</target>
<target name="test" depends="build">
<exec executable="dotnet" dir="${basedir}" failonerror="true">
<arg line="test --configuration Release MPXJ.Net.sln" />
</exec>
</target>
<target name="nuget-test-deploy" depends="build" description="Deploy to NuGet test environment">
<exec executable="dotnet" dir="${basedir}" failonerror="true">
<arg line="nuget push MPXJ.Net\bin\Release\MPXJ.Net.${mpxj.net.version}.nupkg --api-key ${env.NUGETTEST_API_KEY} --source https://apiint.nugettest.org/v3/index.json" />
</exec>
</target>
<target name="nuget-deploy" depends="build" description="Deploy to NuGet">
<exec executable="dotnet" dir="${basedir}" failonerror="true">
<arg line="nuget push MPXJ.Net\bin\Release\MPXJ.Net.${mpxj.net.version}.nupkg --api-key ${env.NUGET_API_KEY} --source https://www.nuget.org/api/v2/package" />
</exec>
</target>
<target name="github-deploy" depends="build" description="Deploy to GitHub">
<exec executable="gh" failonerror="true">
<arg line='release create -t "Version ${mpxj.net.version}" v${mpxj.net.version}'/>
</exec>
</target>
<target name="deploy" depends="nuget-deploy,github-deploy"/>
<target name="coverage">
<exec executable="dotnet" dir="${basedir}" failonerror="true">
<arg line='test /p:AltCover=true /p:AltCoverAssemblyExcludeFilter="MPXJ.Net.Tests|AltCover.Monitor|NUnit3.TestAdapter|Microsoft|testhost" -f net6.0'/>
</exec>
<exec executable="reportgenerator" dir="${basedir}" failonerror="true">
<arg line='-reports:MPXJ.Net.Tests/coverage.net6.0.xml -targetdir:coverage'/>
</exec>
</target>
</project>