forked from cuyahogaproject/cuyahoga
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon-project.xml
176 lines (149 loc) · 7.52 KB
/
common-project.xml
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
<?xml version="1.0" encoding="utf-8"?>
<project name="Cuyahoga" xmlns="http://nant.sf.net/release/0.85/nant.xsd">
<description><![CDATA[
This file contains common tasks tailored specifically for the ISA
build process. The goal was to define all the actions in this file, so
that actual project build files only have to configure a few variables
and call tasks in this file.
Usage
<property name="root.dir" value="..\.." />
<include buildfile="${root.dir}/common-project.xml" />
These lines should be placed at the top level under the <project>
element. Property root.dir defines a relative path to the root of the
distribution, that is, ISA directory.
After including the file, a target should be defined to initialize
configuration variables according to the project being built.
The standard of this target is init (but any other name can be chosen).
The init target should depend on (or call) target common.init defined
in this file.
Other predefined targets are:
- common.compile-dll
compile a DLL, generating the documentation.
- common.generate-assemblyinfo, common.generate-assemblyinfoversion
generate an AssemblyInfo.cs or AssemblyInfoVersion.cs file from
assembly.* NAnt properties.
All compile/run targets put the output in build.dir. Common.compile*
targets use source fileset with id="project.sources", assembly fileset
with id="project.references" and resource fileset with id="project.resources"
to compile the project. The source and resource filesets are optional.
]]></description>
<include buildfile="common.xml" />
<target name="common.compile-dll"
description="Compile sources into a DLL">
<csc
target="library"
define="${current.build.defines}"
debug="${build.debug}"
optimize="${build.optimize}"
output="${build.bin.dir}/${project::get-name()}.dll"
doc="${build.bin.dir}/${project::get-name()}.xml"
rebuild="${build.rebuild}"
>
<nowarn>
<warning number="1591" />
<!-- No XML comment for publicly visible member -->
</nowarn>
<sources refid="project.sources" />
<references refid="project.references" />
<resources refid="project.resources" />
</csc>
</target>
<target name="common.copy-references">
<foreach item="File" property="reference">
<in>
<items refid="project.references" />
</in>
<do>
<copy file="${reference}" todir="${bin.dir}" overwrite="${build.rebuild}" />
</do>
</foreach>
</target>
<target name="common.compile-winexe"
description="Compile sources into a WinForms executable">
<csc
target="winexe"
define="${current.build.defines}"
debug="${build.debug}"
optimize="${build.optimize}"
output="${build.dir}\${project::get-name()}.exe"
win32icon="${app.icon}"
>
<nowarn>
<warning number="1591" />
<!-- No XML comment for publicly visible member -->
</nowarn>
<sources refid="project.sources" />
<references refid="project.references" />
<resources refid="project.resources" />
</csc>
</target>
<target name="common.compile-tests"
description="Compile NUnit tests and copy App.config file to the output directory, if it exists.">
<call target="common.compile-dll" />
</target>
<target name="common.run-tests" description="Run NUnit tests">
<if test="${common.testrunner.enabled}">
<call target="common.find-nunit" unless="${property::exists('nunit.found')}" />
<echo message="Running tests in '${project::get-name()}'" />
<property name="nunitcommandline" value="${project::get-name()}.dll /xml:${testresults.dir}/${project::get-name()}.dll-results.xml /config:${build.dir}/${project::get-name()}.dll.config /nologo /noshadow ${common.testrunner.args}" />
<if test="${(framework::get-family(framework::get-runtime-framework()) == 'mono')}">
<property name="nunitcommandline" value="${project::get-name()}.dll -xml:${testresults.dir}/${project::get-name()}.dll-results.xml -config:${build.dir}/${project::get-name()}.dll.config -nologo -noshadow -labels" />
</if>
<!-- Use nunit-console.exe if found, otherwise fall back to nunit2 task -->
<exec if="${nunit.found}"
program="${nunit-console}"
workingdir="${build.bin.dir}"
commandline="${nunitcommandline}"
failonerror="${common.testrunner.failonerror}"
timeout="180000"
/>
</if>
<if test="${not common.testrunner.enabled}">
<echo message="Tests are disabled for '${project::get-name()}'" />
</if>
</target>
<target name="common.set-assembly-attribute-values">
<property overwrite="false" name="assembly.is-cls-compliant" value="false" />
<property overwrite="false" name="assembly.is-com-visible" value="false" />
<property overwrite="false" name="assembly.guid" value="" />
<property overwrite="false" name="assembly.allow-partially-trusted-callers" value="true" />
<property overwrite="false" name="assembly.description" value="" />
<property overwrite="false" name="assembly.product" value="${project.productname}" />
<property overwrite="false" name="assembly.company" value="${project.company}" />
<property overwrite="false" name="assembly.title" value="${project::get-name()} for ${framework::get-description(framework::get-target-framework())}" />
<property overwrite="false" name="assembly.version" value="${project.version}" />
<property overwrite="false" name="assembly.version.informational" value="${assembly.major}.${assembly.minor}.${assembly.build}.${svn.revision}" />
<property overwrite="false" name="assembly.copyright" value="2004-2007 Cuyahoga Project. All rights reserved." />
</target>
<target name="common.generate-assemblyinfo"
depends="common.init common.set-assembly-attribute-values"
description="Generate AssemblyInfo.cs using assembly.* properties."
>
<property name="assemblyinfo.cs" value="${path::combine(src.dir,'Properties/AssemblyInfo.cs')}" />
<attrib file="${assemblyinfo.cs}" readonly="false" />
<asminfo output="${assemblyinfo.cs}" language="CSharp">
<imports>
<import namespace="System" />
<import namespace="System.Reflection" />
<import namespace="System.Runtime.CompilerServices" />
<import namespace="System.Runtime.InteropServices" />
<import namespace="System.Security" if="${assembly.allow-partially-trusted-callers}" />
</imports>
<attributes>
<attribute type="CLSCompliantAttribute" value="${assembly.is-cls-compliant}" />
<attribute type="ComVisibleAttribute" value="${assembly.is-com-visible}" />
<attribute type="GuidAttribute" value="${assembly.guid}" if="${assembly.guid != ''}" />
<attribute type="AssemblyTitleAttribute" value="${assembly.title}" />
<attribute type="AssemblyDescriptionAttribute" value="${assembly.description}" />
<attribute type="AssemblyCompanyAttribute" value="${assembly.company}" />
<attribute type="AssemblyProductAttribute" value="${assembly.product}" />
<attribute type="AssemblyCopyrightAttribute" value="${assembly.copyright}" />
<attribute type="AssemblyVersionAttribute" value="${assembly.version}" />
<attribute type="AssemblyInformationalVersionAttribute" value="${assembly.version.informational}" />
<attribute type="AssemblyFileVersionAttribute" value="${assembly.version}" />
<!-- For some reason, NAnt doesn't detect that APTCA has a public no-argument constructor -->
<attribute asis="true" type="AllowPartiallyTrustedCallersAttribute" if="${assembly.allow-partially-trusted-callers}" />
</attributes>
</asminfo>
</target>
</project>