Revision 624

View differences:

org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/prepare-workspace.xml
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>
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/distrib
1
#/bin/bash
2

  
3
#USER=
4
#PASS=
5

  
6
REPO="https://devel.gvsig.org/svn/gvsig-geoprocess"
7

  
8
INCREMENT=3 #1:major number 2:minor number 3:bug number
9
PARAMETERS_LIN="-Dnative-platform=linux -Dnative-compiler=gcc4 -Dnative-arch=i386 -Dnative-distribution=all -Dlibrary-type=dynamic -Dnative_classifier=linux-all-gcc4-i386-dynamic -Dnative_classifier=linux-all-gcc4-i386-dynamic -Dmaven.test.skip"
10

  
11
VERSION_TO_FIX=`cat pom.xml | grep "<version>" | head -n 1 | sed 's/<version>//g' | sed 's/-SNAPSHOT<\/version>//g'`;
12
MAJOR_NUMBER=`echo $VERSION_TO_FIX | cut -d"." -f 1`;
13
MINOR_NUMBER=`echo $VERSION_TO_FIX | cut -d"." -f 2`;
14
BUG_NUMBER=`echo $VERSION_TO_FIX | cut -d"." -f 3`;
15

  
16
VERSION_TO_FIX=$MAJOR_NUMBER"."$MINOR_NUMBER"."$BUG_NUMBER
17

  
18
if [ $INCREMENT -eq 1 ]; then
19
  MAJOR_NUMBER=$((MAJOR_NUMBER+1));
20
fi
21

  
22
if [ $INCREMENT -eq 2 ]; then
23
  MINOR_NUMBER=$((MINOR_NUMBER+1));
24
fi
25

  
26
if [ $INCREMENT -eq 3 ]; then
27
  BUG_NUMBER=$((BUG_NUMBER+1));
28
fi
29

  
30
NEXT_DEV_VERSION=$MAJOR_NUMBER"."$MINOR_NUMBER"."$BUG_NUMBER"-SNAPSHOT"
31

  
32
echo Fixed version:$VERSION_TO_FIX
33
echo New development version:$NEXT_DEV_VERSION
34
#VERSION_TO_FIX=2.2.2
35
#NEXT_DEV_VERSION=2.2.3-SNAPSHOT
36

  
37
#mvn release:prepare -B -DdryRun=false -Dtag=v$VERSION_TO_FIX -DreleaseVersion=$VERSION_TO_FIX -DdevelopmentVersion=$NEXT_DEV_VERSION -DpreparationGoals="clean install" -Dusername=$USER -Dpassword=$PASS -DignoreSnapshots=true -Darguments=$PARAMETERS_LIN
38

  
39
read -p "¿Prepare de $i correcto? ¿Continuar? s/n: " CONTINUE
40
if [ "$CONTINUE" == "n" ]; then
41
  mvn release:rollback
42
  exit;
43
fi
44
  
45
mvn release:perform -Dusername=$USER -Dpassword=$PASS -Darguments=$PARAMETERS_LIN
46

  
47
read -p "¿Perform de $i correcto? ¿Continuar? s/n: " CONTINUE
48
if [ "$CONTINUE" == "n" ]; then
49
  mvn release:rollback
50
  exit;
51
fi
52

  
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/README.txt
26 26
you have to prepare it to be able to work easily with maven from
27 27
eclipse itself.
28 28

  
29
Perform the following steps:
30

  
31
1.- Launch the *prepare-workspace.xml* ant build file. 
32
    You can do it by loading the file into the ant view, 
33
    and running the default task, or right-clicking the 
34
    file from the package explorer or the navigator and
35
    select the option: *Run as > Ant build*. 
36
    
37
2.- Restart eclipse.
38

  
39
3.- Import the subprojects of the project you have just checked out.
40

  
41
Those steps are only needed once per workspace.     
42

  

Also available in: Unified diff