1 |
1 |
<?xml version="1.0" encoding="ISO-8859-1"?>
|
2 |
|
<project name="gvSIG-make-maven-project" default="mkproject-build" basedir=".">
|
|
2 |
<project name="gvSIG-make-maven-project" default="mkproject-build-basic" basedir=".">
|
3 |
3 |
|
4 |
4 |
<!-- Get current file location folder -->
|
5 |
5 |
<dirname property="gvSIG-make-maven-project.basedir" file="${ant.file.gvSIG-make-maven-project}" />
|
... | ... | |
39 |
39 |
</antform>
|
40 |
40 |
</target>
|
41 |
41 |
|
42 |
|
|
43 |
|
<target name="mkproject-prompt-data">
|
44 |
|
<property name="project.type" value="1" />
|
45 |
|
<property name="create.main" value="true" />
|
46 |
|
<property name="create.ui.library" value="true" />
|
47 |
|
<property name="create.plugin" value="false" />
|
48 |
|
|
49 |
|
<antform title="Create project" width="${form.width}" image="${gvsiglogo}">
|
50 |
|
<textProperty label="" editable="false" columns="${form.columns}" property="form.title" />
|
51 |
|
|
52 |
|
<textProperty label="Project" editable="false" property="project.name" />
|
53 |
|
<textProperty label="Group Id" editable="false" property="project.group.id" />
|
54 |
|
<textProperty label="Artifact Id" editable="false" property="project.artifact.id" />
|
55 |
|
<textProperty label="Folder" editable="false" property="project.folder" />
|
56 |
|
<separator />
|
57 |
|
<radioSelectionProperty property="selected.project.type" separator="#" values="1- Basic, API separated of the implementation#2- With providers, implementation requires provider services" editable="true" label="Choose project type :" />
|
58 |
|
<booleanProperty property="create.main" editable="true" label="Create test application" />
|
59 |
|
<booleanProperty property="create.ui.library" editable="true" label="Create swing library projects" />
|
60 |
|
<booleanProperty property="create.plugin" editable="true" label="Create gvSIG plugin" />
|
61 |
|
<separator />
|
62 |
|
<controlbar>
|
63 |
|
<button type="cancel" label=" Cancel " target="mkproject-build-cancelled" />
|
64 |
|
<button type="ok" label=" Next " target="mkproject-confirm" />
|
65 |
|
</controlbar>
|
66 |
|
</antform>
|
67 |
|
</target>
|
68 |
|
|
69 |
|
<target name="mkproject-confirm-data">
|
70 |
|
|
71 |
|
<propertyregex property="project.type" input="${selected.project.type}" regexp="([1-5]).*" select="\1" defaultvalue="1" />
|
72 |
|
|
73 |
|
<antform title="Confirm the creation" width="${form.width}" image="${gvsiglogo}">
|
74 |
|
<textProperty label="" editable="false" columns="${form.columns}" property="form.title" />
|
75 |
|
<label>The data used for the creation of project are:</label>
|
76 |
|
|
77 |
|
<textProperty label="Project" editable="false" property="project.name" />
|
78 |
|
<textProperty label="Project name capitalized" editable="false" property="${project.name.capitalized}" />
|
79 |
|
<textProperty label="Project name lowercase" editable="false" property="${project.name.lowercase}" />
|
80 |
|
<textProperty label="Group Id" editable="false" property="project.group.id" />
|
81 |
|
<textProperty label="Artifact Id" editable="false" property="project.artifact.id" />
|
82 |
|
<textProperty label="Folder" editable="false" property="project.folder" />
|
83 |
|
|
84 |
|
<textProperty label="Create main" editable="false" property="create.main" />
|
85 |
|
<textProperty label="Create UI library" editable="false" property="create.ui.library" />
|
86 |
|
<textProperty label="Create plugin" editable="false" property="create.plugin" />
|
87 |
|
<textProperty label="Project type" editable="false" property="project.type" />
|
88 |
|
|
89 |
|
<label>Continue ?</label>
|
90 |
|
<separator />
|
91 |
|
<controlbar>
|
92 |
|
<button type="cancel" label=" Cancel " target="mkproject-build-cancelled" />
|
93 |
|
<button type="ok" label=" Previous " target="mkproject-prompt-data" />
|
94 |
|
<button type="ok" label=" Next " />
|
95 |
|
</controlbar>
|
96 |
|
</antform>
|
97 |
|
|
98 |
|
</target>
|
99 |
|
|
100 |
|
<target name="mkproject-build" depends="mkproject-prompt-data">
|
|
42 |
<target name="mkproject-build-basic">
|
|
43 |
<antcall target="mkproject-build">
|
|
44 |
<param name="project.type" value="1" />
|
|
45 |
</antcall>
|
|
46 |
</target>
|
|
47 |
|
|
48 |
<target name="mkproject-build-provider">
|
|
49 |
<antcall target="mkproject-build">
|
|
50 |
<param name="project.type" value="2" />
|
|
51 |
</antcall>
|
|
52 |
</target>
|
|
53 |
|
|
54 |
<target name="mkproject-build">
|
101 |
55 |
<echo>
|
102 |
56 |
Project name: "${project.name}"
|
103 |
57 |
Project name capitalized: "${project.name.capitalized}"
|
... | ... | |
105 |
59 |
Group id: "${project.group.id}"
|
106 |
60 |
ArtifactId: "${project.artifact.id}"
|
107 |
61 |
Project folder: "${project.folder}"
|
108 |
|
Create main: "${create.main}"
|
109 |
|
Create UI library: "${create.ui.library}"
|
110 |
|
Create plugin: "${create.plugin}"
|
111 |
62 |
Project type: "${project.type}"
|
112 |
63 |
</echo>
|
113 |
64 |
|
... | ... | |
126 |
77 |
<!-- Calculate the project artifact id as PATH -->
|
127 |
78 |
<propertyregex property="project.artifact.id.folder" input="${project.artifact.id}" regexp="([^\.]*).([^\.]*)" replace="\1${file.separator}\2" />
|
128 |
79 |
|
129 |
|
|
130 |
|
<echo>Remove non wanted projects</echo>
|
131 |
|
<if>
|
132 |
|
<equals arg1="${create.plugin}" arg2="false" />
|
133 |
|
<then>
|
134 |
|
<echo>Remove the gvSIG extension projects</echo>
|
135 |
|
<delete dir="${project.folder}/org.gvsig.fortunecookies.app.noswinglib" />
|
136 |
|
<delete dir="${project.folder}/org.gvsig.fortunecookies.app" />
|
137 |
|
</then>
|
138 |
|
</if>
|
139 |
|
<if>
|
140 |
|
<equals arg1="${create.main}" arg2="false" />
|
141 |
|
<then>
|
142 |
|
<echo>Remove the library test main project</echo>
|
143 |
|
<delete dir="${project.foldern}/org.gvsig.fortunecookies/org.gvsig.fortunecookies.main" />
|
144 |
|
<replace file="${project.folder}/org.gvsig.fortunecookies/pom.xml" token="<module>org.gvsig.fortunecookies.main</module>" value="" />
|
145 |
|
<replace file="${project.folder}/org.gvsig.fortunecookies/pom.xml" token="<module>org.gvsig.fortunecookies.main.noswinglib</module>" value="" />
|
146 |
|
</then>
|
147 |
|
</if>
|
148 |
|
<if>
|
149 |
|
<equals arg1="${create.ui.library}" arg2="false" />
|
150 |
|
<then>
|
151 |
|
<echo>Remove the Swing library</echo>
|
152 |
|
<delete dir="${project.folder}/org.gvsig.fortunecookies/org.gvsig.fortunecookies.swing" />
|
153 |
|
<replace file="${project.folder}/org.gvsig.fortunecookies/pom.xml" token="<module>org.gvsig.fortunecookies.swing</module>" value="" />
|
154 |
|
<if>
|
155 |
|
<equals arg1="${create.plugin}" arg2="true" />
|
156 |
|
<then>
|
157 |
|
<echo>Leave only the extension which depends on the swing components</echo>
|
158 |
|
<delete dir="${project.folder}/org.gvsig.fortunecookies.app" />
|
159 |
|
<move todir="${project.folder}/org.gvsig.fortunecookies.app">
|
160 |
|
<fileset dir="${project.folder}/org.gvsig.fortunecookies.app.noswinglib" />
|
161 |
|
</move>
|
162 |
|
</then>
|
163 |
|
</if>
|
164 |
|
<if>
|
165 |
|
<equals arg1="${create.main}" arg2="true" />
|
166 |
|
<then>
|
167 |
|
<echo>Leave only the Main class which not depends on the swing components</echo>
|
168 |
|
<delete dir="${project.folder}/org.gvsig.fortunecookies/org.gvsig.fortunecookies.main" />
|
169 |
|
<move todir="${project.folder}/org.gvsig.fortunecookies/org.gvsig.fortunecookies.main">
|
170 |
|
<fileset dir="${project.folder}/org.gvsig.fortunecookies/org.gvsig.fortunecookies.main.noswinglib" />
|
171 |
|
</move>
|
172 |
|
<replace file="${project.folder}/org.gvsig.fortunecookies/pom.xml" token="<module>org.gvsig.fortunecookies.main.noswinglib</module>" value="" />
|
173 |
|
<replace file="${project.folder}/org.gvsig.fortunecookies/org.gvsig.fortunecookies.main/pom.xml" token="org.gvsig.fortunecookies.main.noswinglib" value="org.gvsig.fortunecookies.main" />
|
174 |
|
</then>
|
175 |
|
</if>
|
176 |
|
</then>
|
177 |
|
<else>
|
178 |
|
<!-- Let the Swing library and use the extension which uses that library -->
|
179 |
|
<if>
|
180 |
|
<equals arg1="${create.plugin}" arg2="true" />
|
181 |
|
<then>
|
182 |
|
<echo>Leave only the extension which not depends on the swing components</echo>
|
183 |
|
<delete dir="${project.folder}/org.gvsig.fortunecookies.app.noswinglib" />
|
184 |
|
</then>
|
185 |
|
</if>
|
186 |
|
<if>
|
187 |
|
<equals arg1="${create.main}" arg2="true" />
|
188 |
|
<then>
|
189 |
|
<echo>Leave only the Main class which depends on the swing components</echo>
|
190 |
|
<delete dir="${project.folder}/org.gvsig.fortunecookies/org.gvsig.fortunecookies.main.noswinglib" />
|
191 |
|
<replace file="${project.folder}/org.gvsig.fortunecookies/pom.xml" token="<module>org.gvsig.fortunecookies.main.noswinglib</module>" value="" />
|
192 |
|
</then>
|
193 |
|
</if>
|
194 |
|
</else>
|
195 |
|
</if>
|
196 |
|
|
197 |
80 |
<echo>Renaming folder ${project.folder}/org.gvsig.fortunecookies to
|
198 |
81 |
${project.folder}/${project.artifact.id}</echo>
|
199 |
82 |
<move todir="${project.folder}">
|