svn-gvsig-desktop / tags / v2_0_0_Build_2041 / build / ant-tasks / ant-tasks-config.xml @ 37748
History | View | Annotate | Download (5.55 KB)
1 | 29554 | cordinyana | <project name="gvSIG-ant-tasks-config" |
---|---|---|---|
2 | xmlns:artifact="antlib:org.apache.maven.artifact.ant"> |
||
3 | |||
4 | <description>
|
||
5 | Ant tasks and macros configuration to interact with maven and |
||
6 | subversion |
||
7 | </description>
|
||
8 | |||
9 | <dirname property="ant-tasks-config.basedir" |
||
10 | file="${ant.file.gvSIG-ant-tasks-config}" /> |
||
11 | |||
12 | <property name="workspace_loc" location="${ant-tasks-config.basedir}/../.." |
||
13 | description="Eclipse workspace location" /> |
||
14 | |||
15 | <property name="build.folder" location="${ant-tasks-config.basedir}/.." |
||
16 | description="Folder of the build project" /> |
||
17 | |||
18 | <property name="gvsiglogo" |
||
19 | location="${ant-tasks-config.basedir}/resources/gvSIG.png" /> |
||
20 | |||
21 | <property name="ant.libs.dir" location="${ant-tasks-config.basedir}" |
||
22 | description="Additional ant tasks libs folder" /> |
||
23 | |||
24 | <!-- ============================= -->
|
||
25 | <!-- External ant tasks definition -->
|
||
26 | <!-- ============================= -->
|
||
27 | |||
28 | <!-- Maven ant tasks registration -->
|
||
29 | <path id="maven-ant-tasks.classpath" |
||
30 | 35754 | cordinyana | path="${ant.libs.dir}/maven-ant-tasks-2.1.3.jar" /> |
31 | 29554 | cordinyana | <typedef resource="org/apache/maven/artifact/ant/antlib.xml" |
32 | uri="antlib:org.apache.maven.artifact.ant" |
||
33 | classpathref="maven-ant-tasks.classpath" /> |
||
34 | |||
35 | <!-- ant-contrib library load -->
|
||
36 | <taskdef resource="net/sf/antcontrib/antlib.xml"> |
||
37 | <classpath>
|
||
38 | <pathelement location="${ant.libs.dir}/ant-contrib-1.0b3.jar" /> |
||
39 | <pathelement location="${ant.libs.dir}/bcel-5.1.jar" /> |
||
40 | <pathelement location="${ant.libs.dir}/commons-httpclient-3.0.1.jar" /> |
||
41 | <pathelement location="${ant.libs.dir}/commons-logging-1.0.4.jar" /> |
||
42 | <pathelement location="${ant.libs.dir}/ivy-1.3.1.jar" /> |
||
43 | </classpath>
|
||
44 | </taskdef>
|
||
45 | |||
46 | <taskdef name="antform" classname="com.sardak.antform.AntForm"> |
||
47 | <classpath>
|
||
48 | <pathelement location="${ant.libs.dir}/antform-2.0.jar" /> |
||
49 | </classpath>
|
||
50 | </taskdef>
|
||
51 | |||
52 | <taskdef name="antmenu" classname="com.sardak.antform.AntMenu"> |
||
53 | <classpath>
|
||
54 | <pathelement location="${ant.libs.dir}/antform-2.0.jar" /> |
||
55 | </classpath>
|
||
56 | </taskdef>
|
||
57 | |||
58 | <target name="show.path.properties" unless="path.properties.shown"> |
||
59 | <echo>workspace_loc = ${workspace_loc}</echo> |
||
60 | <echo>build.folder = ${build.folder}</echo> |
||
61 | <echo>ant.libs.dir = ${ant.libs.dir}</echo> |
||
62 | <property name="path.properties.shown" value="true" /> |
||
63 | </target>
|
||
64 | |||
65 | <!-- Maven targets -->
|
||
66 | <macrodef name="maven"> |
||
67 | <attribute name="arg" /> |
||
68 | <sequential>
|
||
69 | 32300 | cordinyana | <condition property="gvsig.platform.exists"> |
70 | <available file="${user.home}/.gvsig.platform.properties"/> |
||
71 | </condition>
|
||
72 | |||
73 | <fail unless="gvsig.platform.exists"> |
||
74 | ERROR!! |
||
75 | |||
76 | You have to define your gvSIG platform properties, |
||
77 | by creating the file: ${user.home}/.gvsig.platform.properties |
||
78 | with the following content: |
||
79 | |||
80 | native_platform=linux |
||
81 | native_distribution=Ubuntu-9.10 |
||
82 | native_compiler=gcc4 |
||
83 | native_arch=i386 |
||
84 | native_libraryType=dynamic |
||
85 | export native_classifier=${native_platform}-${native_distribution}-${native_compiler}-${native_arch}-${native_libraryType} |
||
86 | |||
87 | Replace the fifth initial variables values with the ones appropiate |
||
88 | to your platform. |
||
89 | |||
90 | If you use maven in the command line, you can use the previous file also |
||
91 | to define the MAVEN_OPTS environment variable, by adding to your |
||
92 | .bash_rc file something like this: |
||
93 | |||
94 | if [ -f "${HOME}/.gvsig.platform.properties" ] |
||
95 | then |
||
96 | . ${HOME}/.gvsig.platform.properties |
||
97 | 37155 | cordinyana | export MAVEN_OPTS="-Xmx384M -XX:MaxPermSize=64m -Dnative-classifier=${native_classifier} -Dnative-platform=${native_platform}" |
98 | 32300 | cordinyana | else |
99 | 33695 | cordinyana | export MAVEN_OPTS="-Xmx384M -XX:MaxPermSize=64m" |
100 | 32300 | cordinyana | fi |
101 | |||
102 | It will work if you use the bash shell. In any other case or platform, you'll |
||
103 | have to define your MAVEN_OPTS environment variable and set the |
||
104 | "native-classifier" parameter directly. |
||
105 | </fail>
|
||
106 | |||
107 | <loadproperties srcFile="${user.home}/.gvsig.platform.properties"> |
||
108 | <filterchain>
|
||
109 | <linecontains>
|
||
110 | <contains value="native_"/> |
||
111 | </linecontains>
|
||
112 | </filterchain>
|
||
113 | </loadproperties>
|
||
114 | <property name="native_classifier" value="${native_platform}-${native_distribution}-${native_compiler}-${native_arch}-${native_libraryType}"/> |
||
115 | 37161 | cordinyana | <echo>mvn -e -Dnative-classifier=${native_classifier} -Dnative-platform=${native_platform} @{arg}</echo> |
116 | 29554 | cordinyana | <artifact:mvn mavenHome="${build.folder}/maven" fork="true" |
117 | 33695 | cordinyana | failonerror="true" maxmemory="384M"> |
118 | 37155 | cordinyana | <arg line="-e -Dnative-classifier=${native_classifier} -Dnative-platform=${native_platform} @{arg}" /> |
119 | 33695 | cordinyana | <jvmarg value="-XX:MaxPermSize=96M" /> |
120 | 29554 | cordinyana | </artifact:mvn>
|
121 | </sequential>
|
||
122 | </macrodef>
|
||
123 | 37161 | cordinyana | |
124 | <macrodef name="maven.lin"> |
||
125 | <attribute name="arg" /> |
||
126 | <sequential>
|
||
127 | <echo>mvn -e -Dnative-classifier=linux-all-gcc4-i386-dynamic -Dnative-platform=linux @{arg}</echo> |
||
128 | <artifact:mvn mavenHome="${build.folder}/maven" fork="true" |
||
129 | failonerror="true" maxmemory="384M"> |
||
130 | <arg line="-e -Dnative-classifier=linux-all-gcc4-i386-dynamic -Dnative-platform=linux @{arg}" /> |
||
131 | <jvmarg value="-XX:MaxPermSize=96M" /> |
||
132 | </artifact:mvn>
|
||
133 | </sequential>
|
||
134 | </macrodef>
|
||
135 | 29554 | cordinyana | |
136 | 37161 | cordinyana | <macrodef name="maven.win"> |
137 | <attribute name="arg" /> |
||
138 | <sequential>
|
||
139 | <echo>mvn -e -Dnative-classifier=win-nt-vs8-i386-dynamic -Dnative-platform=win @{arg}</echo> |
||
140 | <artifact:mvn mavenHome="${build.folder}/maven" fork="true" |
||
141 | failonerror="true" maxmemory="384M"> |
||
142 | <arg line="-e -Dnative-classifier=win-nt-vs8-i386-dynamic -Dnative-platform=win @{arg}" /> |
||
143 | <jvmarg value="-XX:MaxPermSize=96M" /> |
||
144 | </artifact:mvn>
|
||
145 | </sequential>
|
||
146 | </macrodef>
|
||
147 | |||
148 | 29554 | cordinyana | <!-- Utility targets -->
|
149 | <target name="cancel"> |
||
150 | <fail>User canceled</fail> |
||
151 | </target>
|
||
152 | </project> |