]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 5 Sep 2013 15:24:42 +0000 (15:24 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 5 Sep 2013 15:24:42 +0000 (15:24 +0000)
inc/ws/Util/class.ws.exporter.php
inc/ws/Util/html5/app/class.ws.html5.app.compiler.php

index 3381b6ba73e1175ec40355f5943bf5829760ac42..6323ff8314a4d692f1a03f604d80157e7d69abf5 100644 (file)
@@ -23,6 +23,24 @@ class wsExporter {
                $d = str_replace('.', '/', $collection->settings['namespace']);
                $dest = $d . '/www/';
 
+               $phonegap = new CubeIT_Mobile_Phonegap();
+               $phonegap->setName($collection->nom);
+               $phonegap->setId($collection->settings['namespace']);
+               $phonegap->setAuthor('Fluidbook', 'contact@fluidbook.com', 'http://www.fluidbook.com');
+               $phonegap->setVersion('1.0.0');
+               $phonegap->setPlatform($os);
+               $phonegap->getWWWDirectory($dir);
+               if ($os == 'ios') {
+                       $phonegap->setDistantCompiler('paris.cubedesigners.com', 'vincent', '/Phonegap/Projects/' . $d, '22022');
+               } else if ($os == 'android') {
+                       $phonegap->setDistantCompiler('paris.cubedesigners.com', 'Vincent', '/Phonegap/Projects/' . $d, '22322');
+               }
+               $phonegap->setPreference('orientation', CubeIT_Mobile_Phonegap::ORIENTATION_PORTRAIT);
+               $phonegap->setPreference('target-device', CubeIT_Mobile_Phonegap::TARGET_TABLET);
+               $phonegap->setPreference('show-splash-screen-spinner', false);
+               $phonegap->setPreference('auto-hide-splash-screen', false);
+               $phonegap->addFeatures(array('Device','Connection',''));
+
                $this->_createProject($os, $collection->nom, $collection->settings['namespace']);
                $this->_collectionAssets($os, $compiler);
                $this->_transfertPhonegap($os, $dir, $dest);
@@ -35,58 +53,69 @@ class wsExporter {
         */
        protected function _collectionAssets($os, $compiler) {
                if ($os == 'ios') {
-                       $collection = $compiler->collection;
-                       $src = $compiler->wdir . '/' . $collection->theme['icon'];
-                       // icones
-                       $icons = array(57 => 'icon', 72 => 'icon-72', 114 => 'icon@2x', 144 => 'icon-72@2x');
-                       $d = WS_COLLECTIONS . '/resources/' . $collection->collection_id . '/' . $os . '/icons/';
-                       if (!file_exists($d)) {
-                               mkdir($d, 0777, true);
-                       }
-                       foreach ($icons as $s => $n) {
+                       $this->_collectionAssetsIOS($os, $compiler);
+               } else if ($os == 'android') {
+                       $this->_collectionAssetsAndroid($os, $compiler);
+               }
+       }
 
-                               $dest = $d . $n . '.png';
-                               if (!$this->_testFile($src, $dest)) {
-                                       wsPackagerPhonegap::__makeIcon($src, $dest, $s);
-                               }
+       protected function _collectionAssetsAndroid($os, $compiler) {
+               $collection = $compiler->collection;
+               $src = $compiler->wdir . '/' . $collection->theme['icon'];
+       }
+
+       protected function _collectionAssetsIOS($os, $compiler) {
+               $collection = $compiler->collection;
+               $src = $compiler->wdir . '/' . $collection->theme['icon'];
+               // icones
+               $icons = array(57 => 'icon', 72 => 'icon-72', 114 => 'icon@2x', 144 => 'icon-72@2x');
+               $d = WS_COLLECTIONS . '/resources/' . $collection->collection_id . '/' . $os . '/icons/';
+               if (!file_exists($d)) {
+                       mkdir($d, 0777, true);
+               }
+               foreach ($icons as $s => $n) {
+
+                       $dest = $d . $n . '.png';
+                       if (!$this->_testFile($src, $dest)) {
+                               wsPackagerPhonegap::__makeIcon($src, $dest, $s);
                        }
+               }
 
-                       // splashs
-                       $splashs = array('320x480' => 'Default~iphone', '640x960' => 'Default@2x~iphone', '1024x748' => 'Default-Landscape~ipad', '768x1004' => 'Default-Portrait~ipad', '2048x1496' => 'Default-Landscape@2x~ipad', '1536x2008' => 'Default-Portrait@2x~ipad', '640x1136' => 'Default-568h@2x~iphone');
+               // splashs
+               $splashs = array('320x480' => 'Default~iphone', '640x960' => 'Default@2x~iphone', '1024x748' => 'Default-Landscape~ipad', '768x1004' => 'Default-Portrait~ipad', '2048x1496' => 'Default-Landscape@2x~ipad', '1536x2008' => 'Default-Portrait@2x~ipad', '640x1136' => 'Default-568h@2x~iphone');
 
-                       $langs = $compiler->langs;
+               $langs = $compiler->langs;
 
-                       foreach ($langs as $l) {
-                               $src = $compiler->wdir . '/' . $collection->theme['splash_' . $l];
-                               if (!file_exists($src)) {
-                                       continue;
-                               }
+               foreach ($langs as $l) {
+                       $src = $compiler->wdir . '/' . $collection->theme['splash_' . $l];
+                       if (!file_exists($src)) {
+                               continue;
+                       }
 
-                               $d = WS_COLLECTIONS . '/resources/' . $collection->collection_id . '/' . $os . '/splash/' . $l . '.lproj/';
-                               if (!file_exists($d)) {
-                                       mkdir($d, 0777, true);
-                               }
+                       $d = WS_COLLECTIONS . '/resources/' . $collection->collection_id . '/' . $os . '/splash/' . $l . '.lproj/';
+                       if (!file_exists($d)) {
+                               mkdir($d, 0777, true);
+                       }
 
 
-                               foreach ($splashs as $size => $name) {
-                                       list($width, $height) = explode('x', $size);
+                       foreach ($splashs as $size => $name) {
+                               list($width, $height) = explode('x', $size);
 
-                                       $dest = $d . $name . '.png';
+                               $dest = $d . $name . '.png';
 
-                                       if (!$this->_testFile($src, $dest)) {
-                                               $it = new cubeImageTools();
-                                               $it->loadImage($src);
-                                               $it->resize($width, $height, 'crop', false, 'C', 'M', 'transparent');
-                                               $it->output('png', $dest);
-                                       }
+                               if (!$this->_testFile($src, $dest)) {
+                                       $it = new cubeImageTools();
+                                       $it->loadImage($src);
+                                       $it->resize($width, $height, 'crop', false, 'C', 'M', 'transparent');
+                                       $it->output('png', $dest);
                                }
                        }
+               }
 
 
-                       // Transfert
-                       `sudo /usr/local/bin/remountmac`;
-                       $this->_rsync(WS_COLLECTIONS . '/resources/' . $collection->collection_id . '/' . $os, "/mnt/macbox" . $this->_iosProjectDir($collection->settings['namespace']) . '/' . CubeIT_Text::str2URL($collection->nom) . '/Resources', false);
-               }
+               // Transfert
+               `sudo /usr/local/bin/remountmac`;
+               $this->_rsync(WS_COLLECTIONS . '/resources/' . $collection->collection_id . '/' . $os, "/mnt/macbox" . $this->_iosProjectDir($collection->settings['namespace']) . '/' . CubeIT_Text::str2URL($collection->nom) . '/Resources', false);
        }
 
        protected function _testFile($ref, $dest) {
@@ -245,8 +274,8 @@ class wsExporter {
 
        protected function _transfertPhonegap($os, $package, $destination) {
                if ($os == 'android') {
-                       $this->_rsync($package, '/home/dev/Phonegap/Projects/' . $destination, true);
-                       `/usr/local/bin/updatephonegapandroid`;
+                       `sudo /usr/local/bin/remountvincent`;
+                       $this->_rsync($package, '/mnt/vincent/cygdrive/h/Works/Phonegap/Projects/' . $destination, true);
                } else if ($os == 'ios') {
                        `sudo /usr/local/bin/remountmac`;
                        $this->_rsync($package, '/mnt/macbox/Phonegap/Projects/' . $destination, true);
index 80460861c71ba7c301469ce3fba51a01ebb082af..3f1834c18ff297b6a5e70c820beb7e68465cbc08 100644 (file)
@@ -135,6 +135,10 @@ class wsHTML5AppCompiler {
                
        }
 
+       function writeConfig(){
+               $xml=new simplexml_load_string('');
+       }
+       
        function writeStyle() {
                $c = array();