~mandel/ubuntuone-windows-installer/systray_integrate_spring

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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<project default="installer" xmlns="http://nant.sourceforge.net/release/latest/nant.xsd">

	<!-- the enviroment property allows to select which enviroment we are compiling to -->
	<property name="enviroment" value="debug" />
	<property name="build_results" value="install/build_results" />
	
	<target name="clean" 
	        description="Removes all the different results of the last comilation if they exist">
		<!-- delete all the different results from the previous build -->
		<echo>Removing the test-results</echo>
		<delete dir="test-results"  if="${directory::exists('test-results')}" />
		
		<echo>Cleaning Canonical.UbuntuOne.Client results.</echo>
		
		<delete dir="src/Canonical.UbuntuOne.Client/bin"  if="${directory::exists('src/Canonical.UbuntuOne.Client/bin')}" />
		<delete dir="src/Canonical.UbuntuOne.Client/obj"  if="${directory::exists('src/Canonical.UbuntuOne.Client/obj')}" />
		
		<echo>Cleaning Canonical.UbuntuOne.Client.Views results.</echo>
		
		<delete dir="src/Canonical.UbuntuOne.Client.Views/bin"  if="${directory::exists('src/Canonical.UbuntuOne.Client.Views/bin')}" />
		<delete dir="src/Canonical.UbuntuOne.Client.Views/obj"  if="${directory::exists('src/Canonical.UbuntuOne.Client.Views/obj')}" />
		
		<echo>Cleaning Canonical.UbuntuOne.Common results.</echo>
		
		<delete dir="src/Canonical.UbuntuOne.Common/bin"  if="${directory::exists('src/Canonical.UbuntuOne.Common/bin')}" />
		<delete dir="src/Canonical.UbuntuOne.Common/obj"  if="${directory::exists('src/Canonical.UbuntuOne.Common/obj')}" />
		
		<echo>Cleaning Canonical.UbuntuOne.Common.Tests results.</echo>
		
		<delete dir="src/Canonical.UbuntuOne.Common.Tests/bin"  if="${directory::exists('src/Canonical.UbuntuOne.Common.Tests/bin')}" />
		<delete dir="src/Canonical.UbuntuOne.Common.Tests/obj"  if="${directory::exists('src/Canonical.UbuntuOne.Common.Tests/obj')}" />
		
		<echo>Cleaning Canonical.UbuntuOne.ProcessDispatcher results.</echo>
		
		<delete dir="src/Canonical.UbuntuOne.ProcessDispatcher/bin"  if="${directory::exists('src/Canonical.UbuntuOne.ProcessDispatcher/bin')}" />
		<delete dir="src/Canonical.UbuntuOne.ProcessDispatcher/obj"  if="${directory::exists('src/Canonical.UbuntuOne.ProcessDispatcher/obj')}" />
		
		<echo>Cleaning Canonical.UbuntuOne.ProcessDispatcher.Tests results.</echo>
		
		<delete dir="src/Canonical.UbuntuOne.ProcessDispatcher.Tests/bin"  if="${directory::exists('src/Canonical.UbuntuOne.ProcessDispatcher.Tests/bin')}" />
		<delete dir="src/Canonical.UbuntuOne.ProcessDispatcher.Tests/obj"  if="${directory::exists('src/Canonical.UbuntuOne.ProcessDispatcher.Tests/obj')}" />
		
		<echo>Clean the data from the msi</echo>
		
		<delete dir="${build_results}"  if="${directory::exists('${build_results}')}" />
		
	</target>
	
	<target name="generate_protos"  description="Generates the code that is used to talk with the python process using protobuffer.">
		<delete file="src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/SyncDaemon.cs" />
		<copy todir="lib/Protobuf-net" flatten="true">
			<fileset basedir="proto">
				<include name="sync_daemon.proto" />
				<include name="configuration.proto" />
				<include name="sync_daemon_client.proto" />
				<include name="folder.proto" />
				<include name="shares.proto" />
			</fileset>
		</copy>
		
		<!-- execute the proto-gen tool to generate the code of the c# project -->
		<exec basedir="lib/Protobuf-net"
			  managed="true"
              workingdir="lib/Protobuf-net"
			  program="protogen.exe"
			  commandline="-i:sync_daemon.proto -o:SyncDaemon.cs -ns:Canonical.UbuntuOne.ProcessDispatcher -p:fixCase=true"/>
			  
		<exec basedir="lib/Protobuf-net"
			  managed="true"
              workingdir="lib/Protobuf-net"
			  program="protogen.exe"
			  commandline="-i:configuration.proto -o:Configuration.cs -ns:Canonical.UbuntuOne.ProcessDispatcher -p:fixCase=true"/>
			  
		<exec basedir="lib/Protobuf-net"
			  managed="true"
              workingdir="lib/Protobuf-net"
			  program="protogen.exe"
			  commandline="-i:sync_daemon_client.proto -o:SyncDaemonClient.cs -ns:Canonical.UbuntuOne.ProcessDispatcher -p:fixCase=true"/>
			  
		<exec basedir="lib/Protobuf-net"
			  managed="true"
              workingdir="lib/Protobuf-net"
			  program="protogen.exe"
			  commandline="-i:folder.proto -o:Folder.cs -ns:Canonical.UbuntuOne.ProcessDispatcher -p:fixCase=true"/>
			  
		<exec basedir="lib/Protobuf-net"
			  managed="true"
              workingdir="lib/Protobuf-net"
			  program="protogen.exe"
			  commandline="-i:shares.proto -o:Shares.cs -ns:Canonical.UbuntuOne.ProcessDispatcher -p:fixCase=true"/>
			  
		<!-- move the generated code -->
		<move file="./lib/Protobuf-net/SyncDaemon.cs" todir="./src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/"/>
		<move file="./lib/Protobuf-net/Configuration.cs" todir="./src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/"/>
		<move file="./lib/Protobuf-net/SyncDaemonClient.cs" todir="./src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/"/>
		<move file="./lib/Protobuf-net/Folder.cs" todir="./src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/"/>
		<move file="./lib/Protobuf-net/Shares.cs" todir="./src/Canonical.UbuntuOne.ProcessDispatcher/Protobuf/"/>
		
		<!-- delete the files we have copied -->
		<delete file="lib/Protobuf-net/sync_daemon.proto" />
		<delete file="lib/Protobuf-net/configuration.proto" />
		<delete file="lib/Protobuf-net/sync_daemon_client.proto" />
		<delete file="lib/Protobuf-net/folder.proto" />
		<delete file="lib/Protobuf-net/shares.proto" />
		
	</target>
	
	<target name="build" 
	        description="Compiles all the different projects that form part of the solution." 
			depends="clean, generate_protos">
		<!-- use the msbuild action to compile the solution -->
		<msbuild project="src/UbuntuOne.sln"> 
			<property name="Configuration" value="${enviroment}" /> 
		</msbuild>
		
	</target>
	
	<target name="tests" 
			description="Runs the unit tests of the project."
			depends="build">
			
		<!-- create dir where we copy the test results -->
		<mkdir dir="test-results" />
		<!-- execute the nunit console from the tools dir agains each of the test dlls -->
		<echo>Executing Canonical.UbuntuOne.Common.Tests</echo>
		<exec basedir="tools/NUnit"
              managed="true"
              workingdir="src/Canonical.UbuntuOne.Common.Tests/bin/${enviroment}"
              program="nunit-console.exe"
              commandline="Canonical.UbuntuOne.Common.Tests.dll /xml=../../../../test-results/Canonical.UbuntuOne.Common.Tests-Result.xml" /> 
	
		<echo>Executng Canonical.UbuntuOne.ProcessDispatcher.Tests</echo>
		<exec basedir="tools/NUnit"
              managed="true"
              workingdir="src/Canonical.UbuntuOne.ProcessDispatcher.Tests/bin/${enviroment}"
              program="nunit-console.exe"
              commandline="Canonical.UbuntuOne.ProcessDispatcher.Tests.dll /xml=../../../../test-results/Canonical.UbuntuOne.ProcessDispatcher.Tests-Result.xml" />
	</target>
	
	<target name="installer"
	        description="Compiles the solution and create a merge installer that allows to install the solution and other related apps."
			depends="build">
		
		<mkdir dir="${build_results}" />
		
		<!-- The results from the build will have to be copied to a build result folder in install so that we do can build the msi -->
		<copy todir="${build_results}/Daemon" flatten="true">
			<fileset basedir="src/Canonical.UbuntuOne.ProcessDispatcher/bin/${enviroment}">
				<include name="*.dll" />
				<include name="*.pdb" />
				<include name="*.xml" />
				<include name="*.config" />
				<include name="*.exe" />
			</fileset>
		</copy>
		
		<copy todir="${build_results}/Daemon/Config" flatten="true">
			<fileset basedir="src/Canonical.UbuntuOne.ProcessDispatcher/bin/${enviroment}/Config">
				<include name="*.config" />
			</fileset>
		</copy>
		<!-- wix compiler -->
		<exec basedir="tools/Wix/bin"
			  managed="true"
              workingdir="install"
			  program="candle.exe"
			  commandline="-ext WixUIExtension -ext WixUtilExtension UbuntuOne.wxs"/>
			  
		<!-- wix linker -->
		<exec basedir="tools/Wix/bin"
			  managed="true"
              workingdir="install"
			  program="light.exe"
			  commandline="-out UbuntuOne.msi -ext WixUIExtension -ext WixUtilExtension UbuntuOne.wixobj"/>
			  
		
	</target>
	
	<target name="bootstrapper"
			description="Creates a bootstrapper that will allow to install Ubuntu One, Tomboy and Gtk Sharp in the users machine.">
			 
		<exec basedir="tools/dotNetInstaller/bin"
              managed="true"
              workingdir="install"
              program="InstallerLinker.exe"
              commandline="/Output:setup.exe /Template:dotNetInstaller.exe /Configuration:InstallerProject.xml /Embed+" />
	</target>
</project>