source: versions/3.5.201/Bui_Core/xBuildModel.xml @ 11847

Revision 11847, 8.9 KB checked in by sys, 4 years ago (diff)

cleanup errors

Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!--
3 * LICENCE[[
4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1/CeCILL 2.O
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 1.1 (the "License"); you may not use this file except in compliance with
8 * the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
9 *
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
14 *
15 * The Original Code is utc.fr code.
16 *
17 * The Initial Developer of the Original Code is
18 * Universite de Technologie de Compiegne.
19 *
20 * Portions created by the Initial Developer are Copyright (C) 2005
21 * the Initial Developer. All Rights Reserved.
22 *
23 * Contributor(s):
24 *
25 *
26 * Alternatively, the contents of this file may be used under the terms of
27 * either of the GNU General Public License Version 2 or later (the "GPL"),
28 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 * or the CeCILL Licence Version 2.0 (http://www.cecill.info/licences.en.html),
30 * in which case the provisions of the GPL, the LGPL or the CeCILL are applicable
31 * instead of those above. If you wish to allow use of your version of this file
32 * only under the terms of either the GPL or the LGPL, and not to allow others
33 * to use your version of this file under the terms of the MPL, indicate your
34 * decision by deleting the provisions above and replace them with the notice
35 * and other provisions required by the GPL or the LGPL. If you do not delete
36 * the provisions above, a recipient may use your version of this file under
37 * the terms of any one of the MPL, the GPL, the LGPL or the CeCILL.
38 * ]]LICENCE
39  -->
40
41<project name="Bui_Models" basedir="."><!-- basedir toujours déja défini par l'appelant. niveau "project" -->
42        <!-- Emplacement des sources -->
43        <property name="coreResourcesDir" value="${coredir}/resources"/>
44        <property name="coreXslGeneratePackages" value="${coreResourcesDir}/models/generatePackages.xsl"/>
45        <property name="baseDirDestModel" value="${basedir}/../../releases/wspPacks"/>
46        <property name="currentFilePath" value="${wspdir}/Bui_Core/xBuildModel.xml"/>
47        <property name="destinstallerdir" value="${basedir}/../../releases"/>
48        <property name="extensionPack" value="wsppack"/>
49        <property name="descriptionFile" value="${projectPath}/description.xml"/>
50       
51<!--**
52         * Création des différents packages et du .wspPack à partir d'un fichier de description
53         * Paramètres d'entrée :
54         *   - descriptionFile
55         *   - packageListFile
56         *   - fichier xmlproperty "description.xml"
57         **-->
58        <target name="xCreateWspPack" description="Création du wspPack">
59                <!-- # ini -->
60                <echo message="initialisations"/>
61                <property name="tmpDir" value="${basedir}/tmp.genModels"/>
62                <property name="vAntFile" value="${tmpDir}/build.xml"/>
63                <property name="destapprootdir" value="${baseDirDestModel}/${model(name)}"/>
64                <property name="destpath" value=" "/>
65                <delete failonerror="false" dir="${tmpDir}"/>
66                <mkdir dir="${tmpDir}"/>
67                <!-- # résolution des variables dans descriptionFile -->
68                <copy file="${descriptionFile}" tofile="${tmpDir}/descriptionFile.xml.tmp">
69                        <filterchain>
70                                <expandproperties/>
71                        </filterchain>
72                </copy>
73                <xmlproperty file="${tmpDir}/descriptionFile.xml.tmp"/>
74                <property name="model.version" value="${model.version(major)}.${model.version(medium)}.${model.version(minor)}"/><!-- si non défini dans descriptionFile -->
75                <!-- # résolution des variables dans packageListFile -->
76                <copy file="${packageListFile}" tofile="${tmpDir}/packageListFile.xml.tmp">
77                        <filterchain>
78                                <expandproperties/>
79                        </filterchain>
80                </copy>
81                <!-- # création du ant -->
82                <echo message="création du ant"/>
83                <xslt in="${tmpDir}/descriptionFile.xml.tmp" out="${vAntFile}" style="${coreXslGeneratePackages}">
84                  <outputproperty name="method" value="xml"/>
85                  <param name="packageListFile" expression="${tmpDir}/packageListFile.xml.tmp"/>
86                  <param name="antFile" expression="${vAntFile}"/>
87                  <param name="destapprootdir" expression="${destapprootdir}"/>
88                  <param name="destinstallerdir" expression="${destinstallerdir}"/>
89                  <param name="extensionPack" expression="${extensionPack}"/>
90                  <param name="destpath" expression="${destpath}"/>
91                  <param name="tmpDir" expression="${tmpDir}"/>
92                </xslt>
93                <!-- # execution du ant pour créer les packages -->
94                <echo message="execution du ant pour création des packages"/>
95                <ant antfile="${vAntFile}" target="main"/>
96                <!-- # finally -->
97                <echo message="finally"/>
98                <delete dir="${tmpDir}"/>
99        </target>
100<!--**
101         *  Création des XPIs
102         **-->
103        <target name="xCreatePack" description="permet de creer un xpi. ATTENTION la declaratin de certaines variables est indispensable">
104                <!--
105                        A déclarer ds l'appelant:
106                                - vId;
107                                - vVersion;
108                                - vDescription;
109                                - vName;
110                                - vPublisher;
111                                - vUrl;
112                                - vUpdateUrl;
113                                - vPathContent;
114                                - vApp.id
115                                - vApp.maxVersion
116                                - vApp.minVersion
117                                - (vNumScGeneration) optionnel;
118                -->
119                <!-- elements applicatifs -->
120                <property name="vCurrentRepTmp" value="${basedir}/tmp"/>
121                <mkdir dir="${vCurrentRepTmp}/chrome"/>
122                <zip basedir="${vPathContent}" excludes="*.*,**/SVN/**,.*" destfile="${vCurrentRepTmp}/chrome/${vName}.jar" compress="no"/>
123                <property name="vXpiUrl" value="${destModelDir}/${vName}_${vVersion}.xpi"/>
124                <!-- Création de install.rdf -->
125                <concat destfile="${vCurrentRepTmp}/install.rdf" append="false"><![CDATA[<?xml version="1.0" encoding="ISO-8859-1"?>
126                        <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
127                                <Description about="urn:mozilla:install-manifest">
128                                        <em:id>${vId}</em:id>
129                                        <em:name>${vName}</em:name>
130                                        <em:type>2</em:type>
131                                        <em:version>${vVersion}</em:version>
132                                        <em:description>${vDescription}</em:description>
133                                        <em:creator>${vPublisher}</em:creator>
134                                        <em:homepageURL>${vPublisher}</em:homepageURL>
135                                        <!--
136                                        <em:iconURL>.png</em:iconURL>
137                                        <em:aboutURL>chrome://.../about.xul</em:aboutURL>
138                                        -->
139                                        <em:updateURL>${vUpdateUrl}</em:updateURL>
140                                        <em:targetApplication>
141                                                <Description>
142                                                        <em:id>{${vApp.id}}</em:id>
143                                                        <em:minVersion>${vApp.minVersion}</em:minVersion>
144                                                        <em:maxVersion>${vApp.maxVersion}</em:maxVersion>
145                                                </Description>
146                                        </em:targetApplication>
147                                </Description>
148                        </RDF>
149                ]]></concat>
150                <!-- Création de chrome.manifest -->
151                <concat append="true" destfile="${vCurrentRepTmp}/chrome.manifest">
152                        <fileset dir="${vPathContent}">
153                                <include name="*.manifest"/>
154                        </fileset>
155                </concat>
156                <replaceregexp match="##baseContentUri##" replace="jar:chrome/${vName}.jar!" flags="g" byline="true">
157                        <fileset dir="${vCurrentRepTmp}" includes="*.manifest"/>
158                </replaceregexp>
159                <replaceregexp match="##baseLocaleUri##" replace="jar:chrome/${vName}.jar!/locale" flags="g" byline="true">
160                        <fileset dir="${vCurrentRepTmp}" includes="*.manifest"/>
161                </replaceregexp>
162                <!-- on crée le .xpi-->
163                <zip basedir="${vCurrentRepTmp}" destfile="${vXpiUrl}" compress="yes" />
164                <delete dir="${vCurrentRepTmp}"/>
165        </target>
166
167<!--**
168         *  Création des .jar
169         **-->
170        <target name="xCreateScInstaller" description="permet de creer un installer pour un systemSpace donné">
171                <!--
172                        A déclarer ds l'appelant:
173                                - vId;
174                                - vVersion;
175                                - vJarPath ou vFilePath : on ajoute un .jar ou un fichier
176                                - destModelDir
177                -->
178                <property name="vCurrentRepTmp" value="${basedir}/tmp"/>
179                <ant target="xCreateScInstaller.createInstallFile.jar" antfile="${currentFilePath}"/>
180                <ant target="xCreateScInstaller.createInstallFile.file" antfile="${currentFilePath}"/>
181                <!-- on crée le .jar-->
182                <zip basedir="${vCurrentRepTmp}" destfile="${destModelDir}/install_${vId}_${vVersion}.jar" compress="no" />
183                <delete dir="${vCurrentRepTmp}"/>
184        </target>
185        <target name="xCreateScInstaller.createInstallFile.jar" if="vJarPath">
186                <copy file="${vJarPath}" tofile="${vCurrentRepTmp}/${vId}.jar"/>
187                <concat destfile="${vCurrentRepTmp}/installResScenari.xml" append="false"><![CDATA[<?xml version="1.0" encoding="ISO-8859-1"?> 
188                        <installRes xmlns="http://utc.fr/scenari/resourceUpdates">
189                                <res key="${vId}">
190                                        <version num="${vVersion}" url="${vId}.jar" uncompress="true"/>
191                                </res>
192                        </installRes>
193                ]]></concat>
194        </target>
195        <target name="xCreateScInstaller.createInstallFile.file" if="vFilePath">
196                <copy file="${vFilePath}" tofile="${vCurrentRepTmp}/content"/>
197                <concat destfile="${vCurrentRepTmp}/installResScenari.xml" append="false"><![CDATA[<?xml version="1.0" encoding="ISO-8859-1"?>
198                        <installRes xmlns="http://utc.fr/scenari/resourceUpdates">
199                                <res key="${vId}">
200                                        <version num="${vVersion}" url="content" uncompress="false"/>
201                                </res>
202                        </installRes>
203                ]]></concat>
204        </target>
205</project>
206
Note: See TracBrowser for help on using the repository browser.