-
Notifications
You must be signed in to change notification settings - Fork 8
/
common-project.xml
136 lines (120 loc) · 5.68 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
<?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.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.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-2014 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" />
</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}" />
</attributes>
</asminfo>
</target>
</project>