-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdefault.build
123 lines (114 loc) · 4.96 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
<?xml version="1.0"?>
<project name="DemoHelper" default="build">
<include buildfile="default.build.user" />
<property name="signtool" value="signtool.exe" />
<!-- the signinfo.txt file has to contain one line with parameters for signtool.exe,
for example:
/t "url/to/timestamp/server" /q
-->
<loadfile file="signinfo.txt" property="signinfo" failonerror="false" if="${file::exists('signinfo.txt')}"/>
<target name="VersionInfo" depends="VSNET,env">
<description>
Sets the version information as properties, env variables
and sets up the different version specific files.
</description>
<nant target="versioninfo">
<buildfiles>
<include name="versioninfo.build" />
</buildfiles>
</nant>
<loadfile file="src\version.in" property="versionheaderfile">
<filterchain>
<replacetokens begintoken="$" endtoken="$">
<token key="MajorVersion" value="${environment::get-variable('MajorVersion')}" />
<token key="MinorVersion" value="${environment::get-variable('MinorVersion')}" />
<token key="MicroVersion" value="${environment::get-variable('Microversion')}" />
<token key="WCREV" value="${environment::get-variable('WCREV')}" />
<token key="WCLOGCOUNT" value="${environment::get-variable('WCLOGCOUNT')}" />
<token key="WCDATE" value="${environment::get-variable('WCDATE')}" />
</replacetokens>
</filterchain>
</loadfile>
<echo file="src\version.h" message="${versionheaderfile}" />
</target>
<target name="build" depends="VersionInfo">
<exec program="msbuild.exe" >
<arg value="DemoHelper.sln" />
<arg value="/t:Rebuild" />
<arg value="/p:Configuration=Debug" />
<arg value="/p:Platform=x64" />
<arg value="/verbosity:minimal" />
<arg value="/maxcpucount" />
</exec>
<exec program="msbuild.exe" >
<arg value="DemoHelper.sln" />
<arg value="/t:Rebuild" />
<arg value="/p:Configuration=Release" />
<arg value="/p:Platform=x64" />
<arg value="/verbosity:minimal" />
<arg value="/maxcpucount" />
</exec>
<!-- sign all binaries -->
<if test="${file::exists('signinfo.txt')}">
<foreach item="File" property="filename">
<in>
<items>
<include name="bin\Release\x64\*.exe" />
</items>
</in>
<do>
<exec program="${signtool}">
<arg value="sign" />
<arg value="${signinfo}" />
<arg value="${filename}" />
</exec>
</do>
</foreach>
</if>
<property name="verstring" value="${environment::get-variable('MajorVersion')}.${environment::get-variable('MinorVersion')}.${environment::get-variable('MicroVersion')}" />
<property name="verstringfull" value="${verstring}.${environment::get-variable('WCLOGCOUNT')}" />
<zip zipfile="bin\DemoHelper-${verstring}.zip" ziplevel="9">
<fileset basedir="bin\release\x64">
<include name="DemoHelper.exe" />
</fileset>
</zip>
<exec program="checksum" output="bin\checksum64.txt">
<arg value="-t" />
<arg value="sha256" />
<arg value="-f" />
<arg value="bin\DemoHelper-${verstring}.zip" />
</exec>
<loadfile file="bin\checksum64.txt" property="checksum64" />
<loadfile file="choco\demohelper.nuspec" property="nuspecfile">
<filterchain>
<replacetokens begintoken="$" endtoken="$">
<token key="MajorVersion" value="${environment::get-variable('MajorVersion')}" />
<token key="MinorVersion" value="${environment::get-variable('MinorVersion')}" />
<token key="MicroVersion" value="${environment::get-variable('Microversion')}" />
<token key="WCREV" value="${environment::get-variable('WCLOGCOUNT')}" />
<token key="WCDATE" value="${environment::get-variable('WCDATE')}" />
</replacetokens>
</filterchain>
</loadfile>
<echo file="choco\package\demohelper.nuspec" message="${nuspecfile}" />
<loadfile file="choco\chocolateyInstall.ps1" property="cinstfile">
<filterchain>
<replacetokens begintoken="$" endtoken="$">
<token key="MajorVersion" value="${environment::get-variable('MajorVersion')}" />
<token key="MinorVersion" value="${environment::get-variable('MinorVersion')}" />
<token key="MicroVersion" value="${environment::get-variable('Microversion')}" />
<token key="WCREV" value="${environment::get-variable('WCLOGCOUNT')}" />
<token key="WCDATE" value="${environment::get-variable('WCDATE')}" />
<token key="checksum64" value="${string::trim(checksum64)}" />
</replacetokens>
</filterchain>
</loadfile>
<echo file="choco\package\tools\chocolateyInstall.ps1" message="${cinstfile}" />
<echo>
now start an admin console in choco\package and then run
choco pack
to upload the package, run
cpush demohelper-x.x.x.nupkg
</echo>
</target>
</project>