forked from kerryjiang/SuperSocket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SuperSocket.build
158 lines (136 loc) · 5.59 KB
/
SuperSocket.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
<?xml version="1.0" ?>
<project name="SuperSocket" default="makeRelease" xmlns="http://nant.sf.net/schemas/nant.xsd">
<property name="build.dir" value="${project::get-base-directory()}" />
<property name="releaseVersion" overwrite="false" value=""></property>
<property name="push" overwrite="false" value=""></property>
<target name="zipSourceCode" description="zip the source code">
<zip zipfile="SuperSocket${releaseVersionTag}.Source.zip">
<fileset basedir=".">
<include name="**/*" />
<exclude name="**/bin/**" />
<exclude name="**/obj/**" />
<exclude name="**/.git/**" />
<exclude name="**/*.user" />
<exclude name="**/*.suo" />
<exclude name="**/.gitignore" />
<exclude name="**/nuget.key" />
<exclude name="*Push.bat" />
<exclude name="*SuperSocket.build" />
<exclude name="**/*.nuspec" />
<exclude name="**/*.userprefs" />
<exclude name=".travis.yml" />
<exclude name="**/.vs/**" />
</fileset>
</zip>
</target>
<target name="cleanObjDir" description="clear the obj dir">
<delete>
<fileset>
<include name="**/obj/**"/>
</fileset>
</delete>
</target>
<target name="zipBinaries" description="zip the binary output">
<zip zipfile="SuperSocket${releaseVersionTag}.Binaries.zip">
<fileset basedir="bin">
<include name="**/*" />
</fileset>
</zip>
</target>
<target name="buildSln" description="build the solution">
<msbuild project="${solutionFile}" verbose="true">
<arg value="/t:Clean;Build" />
<arg value="/p:OutputPath=${build.dir}\bin\${netFxVersion}\${configuration}" />
</msbuild>
</target>
<target name="buildPrj" description="build the project">
<msbuild project="${solutionFile}" verbose="true">
<arg value="/t:Clean;Build" />
<arg value="/p:OutputPath=${build.dir}\bin\${netFxVersion}\${configuration}" />
</msbuild>
</target>
<target name="nugetPack" description="pack the nuget package">
<loadfile file="nuget.key" property="nuget.key" />
<exec program="nuget" failonerror="true">
<arg line="SetApiKey ${nuget.key}" />
</exec>
<exec program="nuget" failonerror="true">
<arg line="Pack SuperSocket.nuspec -Properties Configuration=Release;version=${releaseVersion}" />
</exec>
<exec program="nuget" failonerror="true">
<arg line="Pack SuperSocket.Engine.nuspec -Properties Configuration=Release;version=${releaseVersion}" />
</exec>
<exec program="nuget" failonerror="true">
<arg line="Pack SuperSocket.WebSocket.nuspec -Properties Configuration=Release;version=${releaseVersion}" />
</exec>
<if test="${push=='true'}">
<exec program="nuget" failonerror="true">
<arg line="Push SuperSocket.${releaseVersion}.nupkg" />
</exec>
<exec program="nuget" failonerror="true">
<arg line="Push SuperSocket.Engine.${releaseVersion}.nupkg" />
</exec>
</if>
</target>
<target name="nugetPackVersion" description="pack the nuget package">
<mkdir dir="nuget\lib\${netFxVersion}" />
<copy todir="nuget\lib\${netFxVersion}">
<fileset basedir="bin\${netFxVersion}\Release">
<include name="*.dll" />
<include name="*.xml" />
<include name="*.exe" />
</fileset>
</copy>
</target>
<target name="makeRelease" description="make the release package">
<property name="releaseVersionTag" value=""/>
<if test="${string::get-length(releaseVersion) > 0}">
<property name="releaseVersionTag" value="(${releaseVersion})"/>
</if>
<call target="zipSourceCode" />
<property name="netFxVersion" value="net35" />
<property name="configuration" value="Debug" />
<property name="solutionFile" value="SuperSocket.2010.NET35.sln" />
<call target="buildSln" />
<property name="solutionFile" value="Management\Server\SuperSocket.ServerManager.Net35.csproj" />
<call target="buildPrj" />
<call target="cleanObjDir" />
<property name="netFxVersion" value="net35" />
<property name="configuration" value="Release" />
<property name="solutionFile" value="SuperSocket.2010.NET35.sln" />
<call target="buildSln" />
<property name="solutionFile" value="Management\Server\SuperSocket.ServerManager.Net35.csproj" />
<call target="buildPrj" />
<call target="cleanObjDir" />
<property name="netFxVersion" value="net40" />
<property name="configuration" value="Debug" />
<property name="solutionFile" value="SuperSocket.2010.sln" />
<call target="buildSln" />
<property name="solutionFile" value="Management\Server\SuperSocket.ServerManager.Net40.csproj" />
<call target="buildPrj" />
<call target="cleanObjDir" />
<property name="netFxVersion" value="net40" />
<property name="configuration" value="Release" />
<property name="solutionFile" value="SuperSocket.2010.sln" />
<call target="buildSln" />
<property name="solutionFile" value="Management\Server\SuperSocket.ServerManager.Net40.csproj" />
<call target="buildPrj" />
<call target="cleanObjDir" />
<property name="netFxVersion" value="net45" />
<property name="configuration" value="Debug" />
<property name="solutionFile" value="SuperSocket.2013.sln" />
<call target="buildSln" />
<property name="solutionFile" value="Management\Server\SuperSocket.ServerManager.Net45.csproj" />
<call target="buildPrj" />
<call target="cleanObjDir" />
<property name="netFxVersion" value="net45" />
<property name="configuration" value="Release" />
<property name="solutionFile" value="SuperSocket.2013.sln" />
<call target="buildSln" />
<property name="solutionFile" value="Management\Server\SuperSocket.ServerManager.Net45.csproj" />
<call target="buildPrj" />
<call target="cleanObjDir" />
<call target="zipBinaries" />
<call target="nugetPack" />
</target>
</project>