gvsig-geoprocess / org.gvsig.geoprocess / tags / org.gvsig.geoprocess-2.2.3 / prepare-workspace.xml @ 1063
History | View | Annotate | Download (7.4 KB)
1 | 237 | cordinyana | <!--
|
---|---|---|---|
2 | |||
3 | gvSIG. Desktop Geographic Information System.
|
||
4 | |||
5 | 245 | cordinyana | Copyright (C) 2007-2012 gvSIG Association.
|
6 | 237 | cordinyana | |
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 | 245 | cordinyana | 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 | 237 | cordinyana | -->
|
26 | 20 | nbrodin | <project name="org.gvsig.initial.build" default="prepare-workspace"> |
27 | 98 | cordinyana | |
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 | 153 | cordinyana | <property name="build.jar.version" value="1.0.8-SNAPSHOT" /> |
33 | 98 | cordinyana | <property name="build.jar.file" value="org.gvsig.maven.base.build-${build.jar.version}.jar" /> |
34 | |||
35 | 116 | cordinyana | <property name="ant.libs.dir" location="${build.basedir}" description="Additional ant tasks libs folder" /> |
36 | |||
37 | 98 | cordinyana | <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 | 116 | cordinyana | <mkdir dir="target" /> |
54 | |||
55 | 98 | cordinyana | <!-- Download the build jar file -->
|
56 | 175 | cordinyana | <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 | 98 | cordinyana | |
58 | 20 | nbrodin | <!-- Unzip de build jar file into the workspace root folder -->
|
59 | 98 | cordinyana | <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 | 153 | cordinyana | |
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 | 98 | cordinyana | |
92 | 153 | cordinyana | 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 | 98 | cordinyana | |
99 | 153 | cordinyana | 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 | 98 | cordinyana | <mkdir dir="target" /> |
124 | |||
125 | <chmod dir="${build.basedir}/maven/bin" perm="u+x" includes="m2,mvn,mvnDebug" /> |
||
126 | |||
127 | 20 | nbrodin | <!-- Copy the maven launchers to the workspace metadata folder -->
|
128 | <copy todir="${workspace.basedir}/.metadata"> |
||
129 | 98 | cordinyana | <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 | 20 | nbrodin | </copy>
|
134 | 98 | cordinyana | |
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 | 20 | nbrodin | <!-- Configure the eclipse workspace -->
|
143 | 98 | cordinyana | <ant antfile="${build.basedir}/maven-goals.xml" target="mvn-configure-eclipse-workspace" /> |
144 | 20 | nbrodin | |
145 | 98 | cordinyana | <!-- Configure the gvSIG profile -->
|
146 | 153 | cordinyana | <ant antfile="${build.basedir}/check-gvsig-profile.xml" /> |
147 | 116 | cordinyana | |
148 | 98 | cordinyana | <property name="user-settings-file-location" value="${user.home}/.m2/settings.xml" /> |
149 | 116 | cordinyana | |
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 | 98 | cordinyana | <xmltask source="${user-settings-file-location}" dest="${user-settings-file-location}"> |
157 | 116 | cordinyana | <copy path="//:settings/:profiles/:profile[:id/text() = 'gvsig-install']/:properties/:gvsig.install.dir/text()" property="current-gvsig-location" /> |
158 | 98 | cordinyana | </xmltask>
|
159 | |||
160 | 116 | cordinyana | <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 | 20 | nbrodin | <!-- Compile, install and generate eclipse projects -->
|
164 | 98 | cordinyana | <ant antfile="${build.basedir}/maven-goals.xml" target="mvn-install-and-eclipse-eclipse" /> |
165 | |||
166 | 20 | nbrodin | <echo>INFORMATION!!!</echo> |
167 | <echo>Restart eclipse and then proceed to import the subprojects contained into the main project</echo> |
||
168 | 98 | cordinyana | |
169 | 20 | nbrodin | <!-- TODO: copiar al proyecto de configuración general -->
|
170 | </target>
|
||
171 | 98 | cordinyana | |
172 | 20 | nbrodin | <target name="clean"> |
173 | 98 | cordinyana | <delete dir="target" /> |
174 | 20 | nbrodin | </target>
|
175 | 153 | cordinyana | |
176 | 116 | cordinyana | </project> |