-
Notifications
You must be signed in to change notification settings - Fork 15
/
nbbuild.xml
148 lines (136 loc) · 7.5 KB
/
nbbuild.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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Greta_Build_Netbeans_8.2+" default="default" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1">
<description>Greta Builder for Netbeans 8.2 and later</description>
<!-- Common tasks for Netbeans -->
<!-- include common task for Netbeans -->
<target name="-print-netbeans-num">
<echo level="info">Netbeans build number = ${netbeans.buildnumber}</echo>
</target>
<!-- Override : Netbeans must not erase the dist directory !!! -->
<target depends="init" name="-do-clean">
<delete dir="${build.dir}"/>
<delete file="${dist.jar}"/>
</target>
<!-- Macro that computes relative path -->
<target name="-relmap.macro">
<macrodef name="relmap">
<attribute name="path"/>
<attribute name="base"/>
<attribute name="property" default="relmap.result"/>
<sequential>
<property location="@{base}" name="relmap.base.dir"/>
<pathconvert pathsep=" " property="@{property}">
<path path="@{path}"/>
<scriptmapper language="javascript">
<![CDATA[
allbackSlashes = /\\/g;
base = String(project.getProperty("relmap.base.dir"));
base = base.replace(allbackSlashes,"/");
base += "//";
base = base.replace(new RegExp("//", 'g'),"/");
source = source.replace(allbackSlashes,"/");
source0 = source;
counter = 0;
while(base.indexOf("/")!=-1 && source.indexOf("/")!=-1
&& base.substr(0,base.indexOf("/")) == source.substr(0,source.indexOf("/"))
){
base = base.substr(base.indexOf("/")+1);
source = source.substr(source.indexOf("/")+1);
++counter;
}
if(base=="")
source = "./"+source;
else{
if(counter>1){
parents = "";
while(base.indexOf("/")!=-1){
base = base.substr(base.indexOf("/")+1);
parents+="../"
}
source = parents+source;
}
else
source = source0;
}
self.addMappedName(source);
]]>
</scriptmapper>
</pathconvert>
</sequential>
</macrodef>
</target>
<!-- Macro that manifest file without moving lib in ${dist.dir}/lib -->
<target name="-greta.pack.macro" depends="-relmap.macro">
<macrodef name="gretaPack">
<attribute default="${manifest.file}" name="manifest"/>
<element name="customize" optional="true"/>
<sequential>
<property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
<property location="${dist.jar}" name="dist.jar.resolved"/>
<pathconvert property="run.classpath.without.build.classes.dir">
<path path="${run.classpath}"/>
<map from="${build.classes.dir.resolved}" to=""/>
</pathconvert>
<relmap path="${run.classpath.without.build.classes.dir}" base="${dist.dir}" property="jar.classpath"/>
<j2seproject1:jar manifest="@{manifest}" compress="${jar.compress}">
<j2seproject1:manifest>
<j2seproject1:attribute name="Main-Class" value="${main.class}"/>
<j2seproject1:attribute name="Class-Path" value="${jar.classpath}"/>
</j2seproject1:manifest>
</j2seproject1:jar>
<echo>To run this application from the command line without Ant, try:</echo>
<echo>java -jar "${dist.jar.resolved}"</echo>
</sequential>
</macrodef>
</target>
<!-- Override : Discard warnings on UMLGraph tags in Javadoc -->
<target depends="init" if="have.sources" name="-javadoc-build">
<mkdir dir="${dist.javadoc.dir}"/>
<javadoc additionalparam="${javadoc.additionalparam} -Xdoclint:none"
author="${javadoc.author}"
charset="UTF-8"
destdir="${dist.javadoc.dir}"
docencoding="UTF-8"
encoding="${javadoc.encoding.used}"
failonerror="true"
noindex="${javadoc.noindex}"
nonavbar="${javadoc.nonavbar}"
notree="${javadoc.notree}"
private="${javadoc.private}"
source="${javac.source}"
splitindex="${javadoc.splitindex}"
use="${javadoc.use}"
useexternalfile="true"
version="${javadoc.version}"
windowtitle="${javadoc.windowtitle}">
<classpath>
<path path="${javac.classpath}"/>
</classpath>
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
<filename name="**/*.java"/>
</fileset>
<fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
<include name="**/*.java"/>
</fileset>
<!-- to discard warnings on UMLGraph tags -->
<tag name="depend" scope="all" enabled="false"/>
<tag name="composed" scope="all" enabled="false"/>
<tag name="has" scope="all" enabled="false"/>
<tag name="navassoc" scope="all" enabled="false"/>
<tag name="inavassoc" scope="all" enabled="false"/>
</javadoc>
</target>
<!-- End of common tasks for Netbeans -->
<!-- Specific tasks for Netbeans 8.2 and later -->
<!-- redefinition of -do-jar-with-libraries-pack task
because Netbeans moves librairies in a "lib" directory
and we don't want to move them
and we want to make the good path in the manifest file -->
<target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-greta.pack.macro" if="do.archive+manifest.available" name="-do-jar-with-libraries">
<gretaPack manifest="${tmp.manifest.file}"/>
</target>
<target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-jar" if="libs.CopyLibs.classpath" name="-do-jar-without-libraries">
<j2seproject1:jar compress="${jar.compress}"/>
</target>
<!-- End of specific tasks for Netbeans 8.2 and later -->
</project>