1 |
|
<!--
|
2 |
|
|
3 |
|
gvSIG. Desktop Geographic Information System.
|
4 |
|
|
5 |
|
Copyright (C) 2007-2012 gvSIG Association.
|
6 |
|
|
7 |
|
This program is free software; you can redistribute it and/or
|
8 |
|
modify it under the terms of the GNU General Public License
|
9 |
|
as published by the Free Software Foundation; either version 2
|
10 |
|
of the License, or (at your option) any later version.
|
11 |
|
|
12 |
|
This program is distributed in the hope that it will be useful,
|
13 |
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14 |
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15 |
|
GNU General Public License for more details.
|
16 |
|
|
17 |
|
You should have received a copy of the GNU General Public License
|
18 |
|
along with this program; if not, write to the Free Software
|
19 |
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
20 |
|
MA 02110-1301, USA.
|
21 |
|
|
22 |
|
For any additional information, do not hesitate to contact us
|
23 |
|
at info AT gvsig.com, or visit our website www.gvsig.com.
|
24 |
|
|
25 |
|
-->
|
26 |
|
<project name="org.gvsig.initial.build" default="prepare-workspace">
|
27 |
|
|
28 |
|
<dirname property="org.gvsig.initial.build.basedir" file="${ant.file.org.gvsig.initial.build}" />
|
29 |
|
|
30 |
|
<property name="workspace.basedir" value="${org.gvsig.initial.build.basedir}/.." />
|
31 |
|
<property name="build.basedir" value="${workspace.basedir}/org.gvsig.maven.base.build" description="Eclipse workspace location" />
|
32 |
|
<property name="build.jar.version" value="1.0.8-SNAPSHOT" />
|
33 |
|
<property name="build.jar.file" value="org.gvsig.maven.base.build-${build.jar.version}.jar" />
|
34 |
|
|
35 |
|
<property name="ant.libs.dir" location="${build.basedir}" description="Additional ant tasks libs folder" />
|
36 |
|
|
37 |
|
<target name="check-maven-base-build-available">
|
38 |
|
<available file="${user.home}/.m2/repository/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}" property="maven-base-build-available" />
|
39 |
|
</target>
|
40 |
|
|
41 |
|
<target name="get-maven-base-build-local" depends="check-maven-base-build-available" if="maven-base-build-available">
|
42 |
|
<!-- Unzip de build jar file from the maven repository into the workspace root folder -->
|
43 |
|
<copy todir="${workspace.basedir}" preservelastmodified="false" filtering="false">
|
44 |
|
<zipfileset src="${user.home}/.m2/repository/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}">
|
45 |
|
<patternset>
|
46 |
|
<exclude name="META-INF/**" />
|
47 |
|
</patternset>
|
48 |
|
</zipfileset>
|
49 |
|
</copy>
|
50 |
|
</target>
|
51 |
|
|
52 |
|
<target name="get-maven-base-build-remote" depends="check-maven-base-build-available" unless="maven-base-build-available">
|
53 |
|
<mkdir dir="target" />
|
54 |
|
|
55 |
|
<!-- Download the build jar file -->
|
56 |
|
<get src="http://devel.gvsig.org/m2repo/j2se/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}" dest="target/${build.jar.file}" verbose="true" />
|
57 |
|
|
58 |
|
<!-- Unzip de build jar file into the workspace root folder -->
|
59 |
|
<copy todir="${workspace.basedir}" preservelastmodified="false" filtering="false">
|
60 |
|
<zipfileset src="target/${build.jar.file}">
|
61 |
|
<patternset>
|
62 |
|
<exclude name="META-INF/**" />
|
63 |
|
</patternset>
|
64 |
|
</zipfileset>
|
65 |
|
</copy>
|
66 |
|
|
67 |
|
</target>
|
68 |
|
|
69 |
|
<target name="find.depends.natives.file">
|
70 |
|
<condition property="depends.natives.file.exists">
|
71 |
|
<available file="${org.gvsig.initial.build.basedir}/DEPENDS_ON_NATIVE_LIBRARIES"/>
|
72 |
|
</condition>
|
73 |
|
</target>
|
74 |
|
|
75 |
|
<target name="find.gvsig.platform.properties.file"
|
76 |
|
depends="find.depends.natives.file"
|
77 |
|
if="depends.natives.file.exists">
|
78 |
|
<condition property="gvsig.platform.exists">
|
79 |
|
<available file="${user.home}/.gvsig.platform.properties"/>
|
80 |
|
</condition>
|
81 |
|
</target>
|
82 |
|
|
83 |
|
<target name="check.gvsig.platform.properties"
|
84 |
|
depends="find.gvsig.platform.properties.file">
|
85 |
|
<fail if="depends.natives.file.exists" unless="gvsig.platform.exists">
|
86 |
|
ERROR!!
|
87 |
|
|
88 |
|
You have to define your gvSIG platform properties,
|
89 |
|
by creating the file: ${user.home}/.gvsig.platform.properties
|
90 |
|
with the following content:
|
91 |
|
|
92 |
|
native_platform=linux
|
93 |
|
native_distribution=all
|
94 |
|
native_compiler=gcc4
|
95 |
|
native_arch=i386
|
96 |
|
native_libraryType=dynamic
|
97 |
|
export native_classifier=${native_platform}-${native_distribution}-${native_compiler}-${native_arch}-${native_libraryType}
|
98 |
|
|
99 |
|
Replace the fifth initial variables values with the ones appropiate
|
100 |
|
to your platform.
|
101 |
|
|
102 |
|
If you use maven in the command line, you can use the previous file also
|
103 |
|
to define the MAVEN_OPTS environment variable, by adding to your
|
104 |
|
.bash_rc file something like this:
|
105 |
|
|
106 |
|
if [ -f "${HOME}/.gvsig.platform.properties" ]
|
107 |
|
then
|
108 |
|
. ${HOME}/.gvsig.platform.properties
|
109 |
|
export MAVEN_OPTS="-Xmx256M -XX:MaxPermSize=64m -Dnative_classifier=${native_classifier}"
|
110 |
|
else
|
111 |
|
export MAVEN_OPTS="-Xmx256M -XX:MaxPermSize=64m"
|
112 |
|
fi
|
113 |
|
|
114 |
|
It will work if you use the bash shell. In any other case or platform, you'll
|
115 |
|
have to define your MAVEN_OPTS environment variable and set the
|
116 |
|
"native_classifier" parameter directly.
|
117 |
|
</fail>
|
118 |
|
|
119 |
|
</target>
|
120 |
|
|
121 |
|
<target name="prepare-workspace" depends="get-maven-base-build-local,get-maven-base-build-remote,check.gvsig.platform.properties">
|
122 |
|
|
123 |
|
<mkdir dir="target" />
|
124 |
|
|
125 |
|
<chmod dir="${build.basedir}/maven/bin" perm="u+x" includes="m2,mvn,mvnDebug" />
|
126 |
|
|
127 |
|
<!-- Copy the maven launchers to the workspace metadata folder -->
|
128 |
|
<copy todir="${workspace.basedir}/.metadata">
|
129 |
|
<fileset dir="${build.basedir}/eclipse-launchers">
|
130 |
|
<exclude name="**/org.eclipse.jdt.core.prefs" />
|
131 |
|
<exclude name="**/org.eclipse.core.variables.prefs" />
|
132 |
|
</fileset>
|
133 |
|
</copy>
|
134 |
|
|
135 |
|
<concat destfile="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs" append="true">
|
136 |
|
<filelist dir="${build.basedir}/eclipse-launchers/.plugins/org.eclipse.core.runtime/.settings" files="org.eclipse.jdt.core.prefs" />
|
137 |
|
</concat>
|
138 |
|
<concat destfile="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.variables.prefs" append="true">
|
139 |
|
<filelist dir="${build.basedir}/eclipse-launchers/.plugins/org.eclipse.core.runtime/.settings" files="org.eclipse.core.variables.prefs" />
|
140 |
|
</concat>
|
141 |
|
|
142 |
|
<!-- Configure the eclipse workspace -->
|
143 |
|
<ant antfile="${build.basedir}/maven-goals.xml" target="mvn-configure-eclipse-workspace" />
|
144 |
|
|
145 |
|
<!-- Configure the gvSIG profile -->
|
146 |
|
<ant antfile="${build.basedir}/check-gvsig-profile.xml" />
|
147 |
|
|
148 |
|
<property name="user-settings-file-location" value="${user.home}/.m2/settings.xml" />
|
149 |
|
|
150 |
|
<taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask">
|
151 |
|
<classpath>
|
152 |
|
<pathelement location="${ant.libs.dir}/com.oopsconsultancy.xmltask-1.16.1.jar" />
|
153 |
|
</classpath>
|
154 |
|
</taskdef>
|
155 |
|
|
156 |
|
<xmltask source="${user-settings-file-location}" dest="${user-settings-file-location}">
|
157 |
|
<copy path="//:settings/:profiles/:profile[:id/text() = 'gvsig-install']/:properties/:gvsig.install.dir/text()" property="current-gvsig-location" />
|
158 |
|
</xmltask>
|
159 |
|
|
160 |
|
<replace file="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs" token="@GVSIG_HOME@" value="${current-gvsig-location}" />
|
161 |
|
<replace file="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.variables.prefs" token="@GVSIG_HOME@" value="${current-gvsig-location}" />
|
162 |
|
|
163 |
|
<!-- Compile, install and generate eclipse projects -->
|
164 |
|
<ant antfile="${build.basedir}/maven-goals.xml" target="mvn-install-and-eclipse-eclipse" />
|
165 |
|
|
166 |
|
<echo>INFORMATION!!!</echo>
|
167 |
|
<echo>Restart eclipse and then proceed to import the subprojects contained into the main project</echo>
|
168 |
|
|
169 |
|
<!-- TODO: copiar al proyecto de configuración general -->
|
170 |
|
</target>
|
171 |
|
|
172 |
|
<target name="clean">
|
173 |
|
<delete dir="target" />
|
174 |
|
</target>
|
175 |
|
|
176 |
|
</project>
|