root/branches/1.0.x/build/buildjbt.php

Revision 421, 2.2 kB (checked in by laurentj, 2 years ago)

ticket #167: jtpl and jbuildtools build are not generated at the right place

Line 
1 <?php
2 /**
3 * @package     jelix
4 * @author      Jouanneau Laurent
5 * @contributor
6 * @copyright   2006-2007 Jouanneau laurent
7 * @link        http://www.jelix.org
8 * @licence     GNU General Public Licence see LICENCE file or http://www.gnu.org/licenses/gpl.html
9 */
10 $BUILD_OPTIONS = array(
11 'MAIN_TARGET_PATH'=> array(
12     "main directory where sources will be copied"// signification (false = option cachée)
13     '_dist',                                        // valeur par défaut (boolean = option booleene)
14     '',                                             // regexp pour la valeur ou vide=tout (seulement pour option non booleene)
15     ),
16 'PACKAGE_TAR_GZ'=>array(
17     "create a tar.gz package",
18     false,
19     ),
20 'PACKAGE_ZIP'=>array(
21     "create a zip package",
22     false,
23     ),
24 'VERSION'=> array(
25     false,
26     'SVN',
27     '',
28     ),
29 'IS_NIGHTLY'=> array(
30     false,
31     false,
32     ),
33 'SVN_REVISION'=> array(
34     false,
35     ),
36 );
37 include(dirname(__FILE__).'/lib/jBuild.inc.php');
38
39 //----------------- Preparation des variables d'environnement
40
41 Env::setFromFile('VERSION','build/VERSION', true);
42 $SVN_REVISION = Subversion::revision('build/');
43
44 if($VERSION == 'SVN'){
45     $VERSION = 'SVN-'.$SVN_REVISION;
46     $IS_NIGHTLY = true;
47 }else{
48     $IS_NIGHTLY = false;
49 }
50
51 if($PACKAGE_TAR_GZ || $PACKAGE_ZIP ){
52     if($IS_NIGHTLY)
53         $PACKAGE_NAME='jbuildtools-nightly';
54     else
55         $PACKAGE_NAME='jbuildtools-'.$VERSION;
56
57     $BUILD_TARGET_PATH = jBuildUtils::normalizeDir($MAIN_TARGET_PATH).$PACKAGE_NAME.'/';
58 }else{
59     $BUILD_TARGET_PATH = jBuildUtils::normalizeDir($MAIN_TARGET_PATH);
60 }
61
62
63 //----------------- Génération des sources
64
65 //... creation des repertoires
66 jBuildUtils::createDir($BUILD_TARGET_PATH);
67
68 //... execution des manifests
69 jManifest::process('build/manifests/jbuildtools.mn', 'build/', $BUILD_TARGET_PATH, ENV::getAll());
70
71
72 file_put_contents($BUILD_TARGET_PATH.'/VERSION', $VERSION);
73
74 //... packages
75
76 if($PACKAGE_TAR_GZ){
77     exec('tar czf '.$MAIN_TARGET_PATH.'/'.$PACKAGE_NAME.'.tar.gz -C '.$MAIN_TARGET_PATH.' '.$PACKAGE_NAME);
78 }
79
80 if($PACKAGE_ZIP){
81     chdir($MAIN_TARGET_PATH);
82     exec('zip -r '.$PACKAGE_NAME.'.zip '.$PACKAGE_NAME);
83     chdir(dirname(__FILE__));
84 }
85
86 exit(0);
87 ?>
Note: See TracBrowser for help on using the browser.
Download in other formats: Plain Text Original Format