-
Notifications
You must be signed in to change notification settings - Fork 2
/
EngageTellAFriend.build
170 lines (159 loc) · 8.49 KB
/
EngageTellAFriend.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
<?xml version="1.0" encoding="utf-8" ?>
<project xmlns="http://nant.sf.net/release/0.92/nant.xsd" name="Engage: Tell A Friend" basedir="." default="package">
<property name="build" value="true" overwrite="false"/>
<property name="bin.directory" value="..\..\bin" overwrite="false"/>
<property name="project.config" value="release"/>
<property name="project.name" value="TellAFriend"/>
<property name="solution.file" value="Engage${project.name}.sln"/>
<property name="references.directory" value="References"/>
<property name="project.dll" value="${bin.directory}\Engage${project.name}.dll"/>
<patternset id="content.fileset">
<include name="**/*.ascx" />
<include name="**/*.aspx" />
<include name="**/*.asmx" />
<include name="**/*.resx" />
<include name="**/*.html" />
<include name="**/*.htm" />
<include name="**/*.css" />
<include name="**/*.jpg" />
<include name="**/*.gif" />
<include name="**/*.png" />
<include name="**/*.pdf" />
<include name="**/*.xml"/>
<include name="**/*.xsd"/>
<exclude name="Licenses/EULA-*.htm"/>
<exclude name="ReleaseNotes_*.htm"/>
<exclude name="??.??.??.txt" />
<exclude name="_ReSharper.*/**"/>
</patternset>
<patternset id="source.fileset">
<include name="**/*.js"/>
<include name="**/*.cs"/>
<include name="**/*.vb"/>
<include name="**/*.sln"/>
<include name="**/*.csproj"/>
<include name="**/*.vbproj"/>
<include name="**/*.build"/>
<include name="**/*.dnn"/>
<include name="**/*.docx"/>
<include name="tools/jsmin.exe"/>
</patternset>
<target name="build" description="Builds the solution" if="${build}">
<exec program="${environment::get-variable('windir')}\Microsoft.NET\Framework\v3.5\msbuild.exe" failonerror="true">
<arg value="${solution.file}" />
<arg value="/p:Configuration=${project.config}" />
<arg value="/p:Platform="Any CPU"" />
<arg value="/noconsolelogger" />
</exec>
</target>
<target name="get-version" depends="build" description="Sets the project.version property to the first three numbers from the version of the main assembly for this module">
<property name="version" value="${assemblyname::get-version(assembly::get-name(assembly::load-from-file(project.dll)))}" />
<property name="project.version" value="${string::substring(version,0,string::last-index-of(version,'.'))}" />
</target>
<target name="package" depends="get-version" description="Creates packages for this module, one for each license and version of DNN (in this case, just one altogether)">
<property name="package.directory" value="package"/>
<property name="package.name" value="Resources.zip"/>
<property name="package.license" value="Free"/>
<property name="includeSource" value="false"/>
<call target="setup-package-files"/>
<call target="create-resources-zip"/>
<call target="zip-package"/>
<property name="includeSource" value="true"/>
<call target="add-sources-to-resource-zip"/>
<call target="zip-package"/>
<delete file="${package.directory}\${package.name}" failonerror="false"/>
<delete dir="${package.directory}\temp" failonerror="false"/>
<call target="project-specific-tasks"/>
</target>
<target name="create-resources-zip" description="Creates the Resources.zip file for content (Install package) files">
<mkdir dir="${package.directory}" failonerror="false"/>
<mkdir dir="${package.directory}/temp" failonerror="false" />
<mkdir dir="${package.directory}/temp/resources" failonerror="false" />
<copy todir="${package.directory}/temp/resources" flatten="false">
<fileset>
<patternset refid="content.fileset"/>
<exclude name="obj/**"/>
<exclude name="${package.directory}/**"/>
</fileset>
</copy>
<zip zipfile="${package.directory}/temp/package/${package.name}">
<fileset basedir="${package.directory}/temp/resources">
<include name="**/*"/>
</fileset>
</zip>
</target>
<target name="add-sources-to-resource-zip" description="Adds the files for the Source package to the Resources.zip file">
<copy todir="${package.directory}/temp/resources" flatten="false">
<fileset>
<patternset refid="source.fileset"/>
<exclude name="obj/**"/>
<exclude name="${package.directory}/**"/>
</fileset>
</copy>
<zip zipfile="${package.directory}/temp/package/${package.name}">
<fileset basedir="${package.directory}/temp/resources">
<include name="**/*"/>
</fileset>
</zip>
</target>
<target name="setup-package-files" description="Copies common package files to the temp/package directory, and sets version-dependent attributes in the DNN 5 manifest file">
<property name="releaseNotes.file" value="ReleaseNotes_${project.version}.htm"/>
<property name="license.file" value="EULA-${package.license}.htm"/>
<mkdir dir="${package.directory}/temp/package" failonerror="false"/>
<copy todir="${package.directory}/temp/package" flatten="true">
<fileset>
<include name="${releaseNotes.file}"/>
<include name="??.??.??.txt" />
<include name="ReadMe.txt" />
<include name="Docs/*" />
<include name="**/*.SqlDataProvider"/>
<include name="**/*.4.dnn"/>
<include name="**/*.5.dnn"/>
<include name="Licenses/${license.file}"/>
</fileset>
</copy>
<copy todir="${package.directory}/temp/package/bin" flatten="true">
<fileset>
<include name="${project.dll}"/>
<include name="${references.directory}/*.dll"/>
<exclude name="${references.directory}/DotNetNuke.dll"/>
<exclude name="${references.directory}/DotNetNuke.*.dll"/>
<exclude name="${references.directory}/Microsoft.ApplicationBlocks.Data.dll"/>
<exclude name="${references.directory}/Telerik.Web.UI.dll"/>
</fileset>
</copy>
<attrib readonly="false">
<fileset basedir="${package.directory}/temp/package">
<include name="**"/>
</fileset>
</attrib>
<xmlpoke file="${package.directory}/temp/package/Engage${project.name}.5.dnn" value="${license.file}" xpath="dotnetnuke/packages/package/license/@src" failonerror="false" />
<xmlpoke file="${package.directory}/temp/package/Engage${project.name}.5.dnn" value="${releaseNotes.file}" xpath="dotnetnuke/packages/package/releaseNotes/@src" failonerror="false" />
<xmlpoke file="${package.directory}/temp/package/Engage${project.name}.5.dnn" value="${project.version}" xpath="dotnetnuke/packages/package/@version" failonerror="false" />
<xmlpoke file="${package.directory}/temp/package/Engage${project.name}.5.dnn" value="${project.version}" xpath="dotnetnuke/packages/package/components/component[@type='Script']/scripts/script[@type='UnInstall']/version" failonerror="false" />
<xmlpoke file="${package.directory}/temp/package/Engage${project.name}.5.dnn" value="${project.version}" xpath="dotnetnuke/packages/package/components/component[@type='Assembly']/assemblies/assembly[version='REPLACED BY NANT']/version" failonerror="false" />
</target>
<target name="zip-package" description="Zips up the files in the temp/package directory, getting the correct manifest file and using the correct naming convention">
<property name="package.type" value="Install"/>
<if test="${includeSource}">
<property name="package.type" value="Source"/>
</if>
<zip zipfile="${package.directory}/${project.name}_${project.version}_${package.type}.zip">
<fileset basedir="${package.directory}/temp/package">
<include name="**/*"/>
</fileset>
</zip>
</target>
<target name="combine-enterprise" description="Combines the Install and Source enterprise packages into one .zip file">
<zip zipfile="${package.directory}/${project.name}_${project.version}.zip">
<fileset basedir="${package.directory}">
<include name="${project.name}_${project.version}_Install.zip"/>
<include name="${project.name}_${project.version}_Source.zip"/>
</fileset>
</zip>
<delete file="${package.directory}/${project.name}_${project.version}_Install.zip" failonerror="false"/>
<delete file="${package.directory}/${project.name}_${project.version}_Source.zip" failonerror="false"/>
</target>
<target name="project-specific-tasks" description="Place tasks specific to the current project in this task">
</target>
</project>