]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.osgiboot/src/main/ant/osgiboot.xml
remove empty packages
[gpl/argeo-slc.git] / runtime / org.argeo.slc.osgiboot / src / main / ant / osgiboot.xml
1 <!--
2
3 Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
4
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8
9 http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16
17 -->
18
19 <project default="launch">
20 <dirname property="baseDir" file="${ant.file}" />
21 <dirname property="equinoxDir" file="${ant.file}" />
22 <property name="equinoxJar" location="${equinoxDir}/org.eclipse.osgi.jar" />
23 <property name="equinoxArgs" value="-console -clean -noExit" />
24 <property name="osgiBootBundle" value="org.argeo.slc.osgiboot.jar" />
25 <property name="configurationDir" location="${equinoxDir}/configuration" />
26 <property name="configurationFile" location="${configurationDir}/config.ini" />
27
28 <path id="slc.osgi.locations.raw.default">
29 <fileset dir="${baseDir}/lib">
30 <include name="*.jar" />
31 </fileset>
32 </path>
33
34 <target name="launch" description="Launch Equinox" depends="prepareDefault,writeConfiguration,start">
35
36 </target>
37
38 <target name="prepareDefault" unless="slc.osgi.locations">
39 <pathconvert dirsep="/" property="slc.osgi.locations" refid="slc.osgi.locations.raw.default" />
40
41 <property name="slc.osgi.start" value="org.springframework.osgi.extender" />
42 </target>
43
44 <target name="writeConfiguration" description="Generate configuration based on properties">
45 <echo message="equinoxJar=${equinoxJar}" />
46 <echo message="configurationDir=${configurationDir}" />
47 <mkdir dir="${configurationDir}" />
48 <echo message="osgiBootBundle=${osgiBootBundle}" />
49 <echo file="${configurationFile}">
50 <![CDATA[
51 osgi.bundles=reference:file:${osgiBootBundle}@start
52 ]]>
53 </echo>
54
55 <addProperty name="slc.osgi.locations" />
56 <addProperty name="slc.osgi.start" />
57 <addProperty name="slc.osgi.bundles" />
58 <addProperty name="slc.osgi.devBases" />
59 <addProperty name="slc.osgi.devPatterns" />
60 <addProperty name="slc.maven.dependencyFile" />
61 </target>
62
63 <target name="start.java" description="Start Equinox runtime based on generated config">
64 <java classname="org.eclipse.core.runtime.adaptor.EclipseStarter" fork="true" dir="${equinoxDir}" classpath="${equinoxJar}">
65 <arg value="-console" />
66 <arg value="-noExit" />
67 <arg value="-clean" />
68 <arg value="-debug" />
69 <arg value="-configuration" />
70 <arg value="${configurationDir}" />
71 </java>
72 </target>
73
74 <target name="start">
75 <property name="commandArgs" value="-cp ${equinoxJar} org.eclipse.core.runtime.adaptor.EclipseStarter ${equinoxArgs} -configuration ${configurationDir}" />
76
77 <condition property="starter" value="gnome-terminal">
78 <and>
79 <os family="unix" />
80 </and>
81 </condition>
82 <condition property="starterArgs" value="--maximize -x">
83 <and>
84 <os family="unix" />
85 </and>
86 </condition>
87 <condition property="starter" value="start">
88 <os family="windows" />
89 </condition>
90 <condition property="vmlauncher" value="false">
91 <os family="windows" />
92 </condition>
93 <property name="starterArgs" value="" />
94 <property name="javaCommand" value="java" />
95 <property name="vmlauncher" value="true" />
96
97 <echo message="commandArgs=${commandArgs}" />
98 <echo message="${javaCommand} ${commandArgs}" file="${equinoxDir}/launch.bat" />
99 <echo message="${javaCommand} ${commandArgs}" file="${equinoxDir}/launch.sh" />
100 <exec executable="${starter}" dir="${equinoxDir}" vmlauncher="${vmlauncher}">
101 <arg line="${starterArgs}" />
102 <arg line="${javaCommand}" />
103 <arg line="${commandArgs}" />
104 </exec>
105 </target>
106
107 <macrodef name="addProperty">
108 <attribute name="name" />
109 <sequential>
110 <property name="@{name}" value="" />
111 <echo message="@{name}=${@{name}}" />
112 <echo file="${configurationFile}" append="true">
113 <![CDATA[@{name}=${@{name}}]]>
114 </echo>
115 </sequential>
116 </macrodef>
117 </project>