main
1<?xml version="1.0" encoding="utf-8" ?>
2<project name="rrsp" default="">
3 <property name="base.dir" value="${directory::get-parent-directory(project::get-base-directory())}" />
4 <property name="src.dir" value="${base.dir}\product" />
5 <property name="lib.dir" value="${base.dir}\thirdparty" />
6 <property name="tmp.dir" value="${base.dir}/tmp" />
7 <property name="tools.dir" value="${base.dir}\thirdparty" />
8 <property name="support.dir" value="${base.dir}\support" />
9 <property name="config.dir" value="${support.dir}\config" />
10
11 <property name="major" value="${datetime::get-year(datetime::now())}" />
12 <property name="minor" value="${datetime::get-month(datetime::now())}" />
13 <property name="build" value="${datetime::get-day(datetime::now())}" />
14 <property name="revision" value="${datetime::get-hour(datetime::now())}${datetime::get-minute(datetime::now())}" />
15 <property name="version.number" value="${major}.${minor}.${build}.${revision}" />
16
17 <property name="solution.file" value="${base.dir}/studio.sln" />
18 <property name="msbuild.exe" value="${framework::get-framework-directory(framework::get-target-framework())}\msbuild.exe" />
19
20 <include buildfile="local.properties.xml" />
21
22 <target name="clean">
23 <delete dir="${tmp.dir}" />
24 </target>
25
26 <target name="init" depends="clean, create.configs">
27 <mkdir dir="${tmp.dir}" />
28 </target>
29
30 <target name="compile" depends="init">
31 <property name="command.line" value='${solution.file} /t:Clean;Rebuild /p:Configuration=${project.config} /p:OutDir=${tmp.dir}\ /p:Platform="Any CPU" /v:q' />
32 <exec program="${msbuild.exe}" commandline="${command.line}" workingdir="${base.dir}" />
33 </target>
34
35 <target name="_publish.installer" depends="compile">
36 <property name="project.file" value="${base.dir}\product\desktop.ui\solidware.financials.csproj" />
37 <property name="support.url" value="http://solidware.ca/" />
38 <property name="command.line" value='${project.file} /t:publish /m /p:UpdateEnabled=true /p:UpdateRequired=true /p:MinimumRequiredVersion=${version.number} /p:PublisherName="${publisher.name}" /p:ProductName="${product.name}" /p:PublishUrl=${publish.url} /p:InstallUrl=${publish.url} /p:UpdateUrl=${update.url} /p:Install=True /p:ApplicationVersion=${major}.${minor}.${build}.* /p:ApplicationRevision=${revision} /p:UpdateInterval=1 /p:UpdateIntervalUnits=Minutes /p:UpdateUrlEnabled=True /p:IsWebBootstrapper=True /p:InstallFrom=Web /p:PublishDir=${publish.dir} /p:ManifestKeyFile="${key.file}" /p:ManifestCertificateThumbprint="${key.file.thumbprint}" /p:SupportUrl=${support.url}' />
39 <exec program="${msbuild.exe}" commandline="${command.line}" />
40 </target>
41
42 <target name="local.installer">
43 <property name="publish.url" value="${tmp.dir}\public\" />
44 <property name="update.url" value="${publish.url}" />
45 <property name="publish.dir" value="${publish.url}" />
46 <property name="product.name" value="Family Finances (LOCAL)" />
47 <property name="publisher.name" value="SolidWare Inc." />
48 <call target="_publish.installer" />
49 </target>
50
51 <target name="load.prod.properties">
52 <if test="${file::exists('production.properties.xml')}">
53 <echo message="loading production properties..." />
54 <include buildfile="production.properties.xml" />
55 </if>
56 </target>
57
58 <target name="prod.installer" depends="load.prod.properties">
59 <echo message="prod.installer" />
60 <property name="publish.url" value="http://mokhan.ca/downloads/apps/momoney/" />
61 <property name="update.url" value="${publish.url}" />
62 <property name="publish.dir" value="${tmp.dir}\public\" />
63 <property name="product.name" value="Family Finances" />
64 <property name="publisher.name" value="SolidWare Inc." />
65 <call target="_publish.installer" />
66 </target>
67
68 <target name="run.test" depends="compile">
69 <property name="xunit.cons.exe" value="${tools.dir}/mspec/mspec.exe" />
70 <exec program="${xunit.cons.exe}" workingdir="${tmp.dir}" commandline="${xunit.arguments}" />
71 </target>
72
73 <target name="test">
74 <property name="xunit.arguments" value="-t --html ${tmp.dir} ${tmp.dir}/specs.dll" />
75 <call target="run.test" />
76 </target>
77
78 <target name="expand.template.file">
79 <copy file="${target}.template" tofile="${target}" overwrite="true">
80 <filterchain>
81 <expandproperties />
82 </filterchain>
83 </copy>
84 </target>
85
86 <target name="create.configs">
87 <property name="target" value="${src.dir}/desktop.ui/Properties/AssemblyInfo.cs" />
88 <call target="expand.template.file" />
89 <property name="target" value="${src.dir}/desktop.ui/app.config" />
90 <call target="expand.template.file" />
91 </target>
92
93 <target name="run" depends="compile">
94 <exec program="${tmp.dir}/solidware.financials.exe" />
95 </target>
96</project>