Skip to main content
summaryrefslogtreecommitdiffstats
blob: 1652fe5b67ed0f8ecb4efe688c83fb533ac0915b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<project name="Customizes OSEE IDE Product" default="run">

	<!-- *************************************************************** -->
	<!-- MAIN RUN -->
	<!-- *************************************************************** -->
	<target name="run">
		<echo>Customize OSEE IDE Product</echo>
		<echo>Product-Name: [${product-name}]</echo>
		<echo>Archive-Name: [${zip-product-name}]</echo>
		<echo>Products-Path: [${products-directory}]</echo>
		<echo>Output-Path: [${output-directory}]</echo>
		<echo>Resources-Path: [${resources-directory}]</echo>
		<echo />

		<property name="defaultWorkspaceName" value="workspace" />
		<property name="additionalExecIniArgs" value=" " />

		<updateProduct os="win32" ws="win32" arch="x86" jreVersion="1.6.0_31" />
		<updateProduct os="win32" ws="win32" arch="x86_64" jreVersion="1.6.0_31" />
		<updateProduct os="linux" ws="gtk" arch="x86" jreVersion="1.6.0_26" />
		<updateProduct os="linux" ws="gtk" arch="x86_64" jreVersion="1.6.0_30" />
		<!--<updateProduct os="solaris" ws="gtk" arch="sparc" jreVersion="1.6.0_24" /> -->
		<updateProduct os="macosx" ws="cocoa" arch="x86_64" jreVersion="_" />
	</target>

	<!-- *************************************************************** -->
	<!-- MAIN RUN -->
	<!-- *************************************************************** -->
	<macrodef name="updateProduct">
		<attribute name="os" />
		<attribute name="ws" />
		<attribute name="arch" />
		<attribute name="jreVersion" />
		<sequential>
			<var name="productPath" value="${products-directory}/${product-name}/@{os}/@{ws}/@{arch}" />
			<var name="productConfigPath" value="${productPath}/configuration" />
			<var name="productPluginPath" value="${productPath}/plugins" />

			<!-- Add JRE 
			<if>
				<equals arg1="@{os}" arg2="macosx" />
				<then>
				</then>
			<else>
			<var name="jreResource" value="${resources-directory}/../jres/jre_@{jreVersion}_@{os}_@{arch}.zip" />
			<unzip src="${jreResource}" dest="${productPath}" />
			<chmod perm="ugo+x" dir="${productPath}/jre" includes="**/*" />
			</else>
			</if>
			-->

			<!-- Update Configuration Area -->
			<delete dir="${productConfigPath}/.settings" failonerror="false" quiet="true" />
			<delete dir="${productConfigPath}/org.eclipse.update" failonerror="false" quiet="true" />
			<mkdir dir="${productConfigPath}/.settings" />
			<!--<copy file="${resources-directory}/org.eclipse.core.net.prefs" tofile="${productConfigPath}/.settings/org.eclipse.core.net.prefs" overwrite="true" />-->

			<!-- Update Configuration INI -->
			<customizeConfigIni configpath="${productConfigPath}" pluginspath="${productPluginPath}" configarch="@{arch}" />

			<!-- Extra Launches -->
			<if>
				<equals arg1="@{os}" arg2="macosx" />
				<then>
					<!-- NO DEBUG EXEC for MACOSX -->
				</then>
				<else>
					<generateExecutable os="@{os}" productDir="${productPath}" execName="oseeDebug" eclipseArgs="-console${line.separator}-consoleLog" extravmargs="-Xmx1G${line.separator}-Xdebug${line.separator}-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=9009" additionalVmArgs="-Dosee.default.broker.uri=&lt;BROKER_ADDRESS&gt;${line.separator}-Dosee.application.server=http://localhost:8089${line.separator}-Dosee.authentication.protocol=demo${line.separator}${additionalExecIniArgs}" />
				</else>
			</if>

			<!-- Copy Icon if Win32 -->
			<if>
				<equals arg1="@{os}" arg2="win32" />
				<then>
					<copy file="${resources-directory}/../icons/win32/osee.ico" tofile="${productPath}/OSEE.ico" />
				</then>
			</if>

			<!-- Zip Product -->
			<var name="productZipName" value="${products-directory}/${product-name}-@{os}.@{ws}.@{arch}.zip" />
			<var name="productTarName" value="${products-directory}/${product-name}-@{os}.@{ws}.@{arch}.tar" />
			<if>
				<equals arg1="@{os}" arg2="win32" />
				<then>
					<zip destfile="${productZipName}" basedir="${productPath}" update="true" />
				</then>
				<elseif>
					<equals arg1="@{os}" arg2="solaris" />
					<then>
						<zip destfile="${productZipName}" basedir="${productPath}" update="true" />
					</then>
				</elseif>
				<else>
					<tar destfile="${productTarName}" basedir="${productPath}" longfile="gnu" />
					<gzip src="${productTarName}" destfile="${productTarName}.gz" />
					<delete file="${productTarName}" quiet="true" />
				</else>
			</if>
		</sequential>
	</macrodef>


	<!-- *************************************************************** -->
	<!-- GENERATE CONFIG.INI -->
	<!-- *************************************************************** -->
	<!-- update config area osgi.configuration.area=@user.home/.eclipse/osee.platform_${VERSION} 
		eclipse.p2.data.area=@config.dir/p2/ osgi.instance.area.default=@user.home/osee_shareRC_workspace -->
	<macrodef name="customizeConfigIni">
		<attribute name="configPath" />
		<attribute name="pluginsPath" />
		<attribute name="configarch" />
		<sequential>
			<pathconvert property="osee.framework.core.bundle.path" setonempty="false">
				<path>
					<fileset dir="@{pluginsPath}">
						<include name="org.eclipse.osee.framework.core_*.jar" />
					</fileset>
				</path>
			</pathconvert>
			<propertyregex property="osee.core.version" override="true" input="${osee.framework.core.bundle.path}" regexp="org\.eclipse\.osee\.framework\.core_(.*)\.jar" select="\1" casesensitive="false" />
			<echo message="Osee Core Version: ${osee.core.version}" />

			<echo file="${products-directory}/build_label.txt" append="false">${osee.core.version}</echo>

			<replaceregexp file="@{configPath}/config.ini" match="osgi.instance.area.default=(.*)" replace="" />
			<replaceregexp file="@{configPath}/config.ini" match="eclipse.p2.data.area=(.*)" replace="" />

			<echo file="@{configPath}/config.ini" append="true" message="osgi.instance.area.default=@user.home/${defaultWorkspaceName}/${line.separator}" />
			<echo file="@{configPath}/config.ini" append="true" message="osgi.configuration.area=@user.home/.eclipse/osee_@{configarch}_${osee.core.version}${line.separator}" />
			<echo file="@{configPath}/config.ini" append="true" message="eclipse.p2.data.area=@config.dir/p2/${line.separator}" />
		</sequential>
	</macrodef>

	<!-- *************************************************************** -->
	<!-- GENERATE Executables -->
	<!-- *************************************************************** -->
	<macrodef name="generateExecutable">
		<attribute name="os" />
		<attribute name="productDir" />
		<attribute name="execName" />

		<attribute name="eclipseArgs" />
		<attribute name="extraVmArgs" />
		<attribute name="additionalVmArgs" />
		<sequential>
			<if>
				<equals arg1="@{os}" arg2="win32" />
				<then>
					<var name="execExtension" value=".exe" />
				</then>
				<else>
					<var name="execExtension" value="" />
				</else>
			</if>

			<var name="outputIni" value="@{productDir}/@{execName}.ini" />

			<copy file="@{productDir}/osee${execExtension}" tofile="@{productDir}/@{execName}${execExtension}" overwrite="true" />
			<copy file="@{productDir}/osee.ini" tofile="${outputIni}" overwrite="true" />

			<!-- <replaceregexp file="@{outputIni}" match="-showsplash.*" replace="" 
				flags="s" /> -->

			<echo file="${outputIni}" append="false">
@{eclipseArgs}
-vmargs
@{extraVmArgs}
@{additionalVmArgs}
			</echo>
		</sequential>
	</macrodef>
</project>

Back to the top