Merge branch 'sprint/hufangzhou_minify' into 'master'
* Change the minify tools. See merge request easycorp/zentaopms!3888
This commit is contained in:
@@ -143,8 +143,9 @@ zentaoxx:
|
||||
mkdir zentaoxx/tools; cp tools/cn2tw.php zentaoxx/tools; cd zentaoxx/tools; php cn2tw.php
|
||||
cp tools/en2de.php zentaoxx/tools; cd zentaoxx/tools; php en2de.php ../
|
||||
rm -rf zentaoxx/tools
|
||||
zip -rqm -9 zentaoxx.$(VERSION).zip zentaoxx/*
|
||||
rm -rf xuan.zip xuan zentaoxx
|
||||
#zip -rqm -9 zentaoxx.$(VERSION).zip zentaoxx/*
|
||||
#rm -rf xuan.zip xuan zentaoxx
|
||||
rm -rf xuan.zip xuan
|
||||
package:
|
||||
# change mode.
|
||||
chmod -R 777 zentaopms/tmp/
|
||||
@@ -244,18 +245,31 @@ ciCommon:
|
||||
|
||||
ifneq ($(XUANPATH), )
|
||||
make zentaoxx
|
||||
unzip zentaoxx.*.zip
|
||||
cp zentaoxx/* zentaopms/ -r
|
||||
rm -rf zentaoxx
|
||||
endif
|
||||
|
||||
make package
|
||||
zip -rq -9 ZenTaoPMS.$(VERSION).zip zentaopms
|
||||
rm -fr zentaopms zentaoxx zentaoxx.*.zip
|
||||
make en
|
||||
rm -fr zentaopms zentaoxx zentaoxx.*.zip
|
||||
# en
|
||||
cd zentaopms/; grep -rl 'zentao.net'|xargs sed -i 's/zentao.net/zentao.pm/g';
|
||||
cd zentaopms/; grep -rl 'http://www.zentao.pm'|xargs sed -i 's/http:\/\/www.zentao.pm/https:\/\/www.zentao.pm/g';
|
||||
cd zentaopms/config/; echo >> config.php; echo '$$config->isINT = true;' >> config.php
|
||||
mv zentaopms zentaoalm
|
||||
zip -r -9 ZenTaoALM.$(VERSION).int.zip zentaoalm
|
||||
rm -fr zentaoalm
|
||||
# move pms zip to build and release path.
|
||||
rm -f $(BUILD_PATH)/ZenTao*.zip $(RELEASE_PATH)/ZenTaoPMS.$(VERSION).zip $(RELEASE_PATH)/ZenTaoALM.$(VERSION).int.zip
|
||||
cp ZenTaoPMS.$(VERSION).zip $(BUILD_PATH)
|
||||
cp ZenTaoPMS.$(VERSION).zip ZenTaoALM.$(VERSION).int.zip $(RELEASE_PATH)
|
||||
cizip:
|
||||
make ciCommon
|
||||
php tools/packZip.php $(VERSION)
|
||||
sh zip.sh
|
||||
rm -rf tmp/ *.sh
|
||||
rm -rf zentaobiz* zentaomax* $(RELEASE_PATH)/ZenTaoALM.$(VERSION)*.zip $(RELEASE_PATH)/ZenTaoPMS.$(VERSION)*.zip $(RELEASE_PATH)/pmsPack/*.zip
|
||||
mv ZenTaoPMS.$(VERSION).zip ZenTaoALM.$(VERSION).int.zip $(RELEASE_PATH)
|
||||
mv ZenTaoALM.$(VERSION).int.php*.zip ZenTaoPMS.$(VERSION).php*.zip $(RELEASE_PATH)/pmsPack
|
||||
ci:
|
||||
make ciCommon
|
||||
php tools/packZip.php $(VERSION)
|
||||
@@ -267,7 +281,8 @@ ci:
|
||||
php tools/packRpm.php $(VERSION)
|
||||
sh rpm.sh
|
||||
rm -rf tmp/
|
||||
rm -f zentaobiz*.zip zentaomax*.zip $(RELEASE_PATH)/ZenTaoALM.$(VERSION)*.zip $(RELEASE_PATH)/ZenTaoPMS.$(VERSION)*.zip $(RELEASE_PATH)/*.deb $(RELEASE_PATH)/*.rpm *.sh $(RELEASE_PATH)/pmsPack/*.zip $(RELEASE_PATH)/pmsPack/deb/* $(RELEASE_PATH)/pmsPack/rpm/*
|
||||
rm -rf zentaobiz* zentaomax* $(RELEASE_PATH)/ZenTaoALM.$(VERSION)*.zip $(RELEASE_PATH)/ZenTaoPMS.$(VERSION)*.zip $(RELEASE_PATH)/*.deb $(RELEASE_PATH)/*.rpm *.sh $(RELEASE_PATH)/pmsPack/*.zip $(RELEASE_PATH)/pmsPack/deb/* $(RELEASE_PATH)/pmsPack/rpm/*
|
||||
mv ZenTaoPMS.$(VERSION).zip ZenTaoALM.$(VERSION).int.zip $(RELEASE_PATH)
|
||||
mv ZenTaoALM.$(VERSION).int.php*.zip ZenTaoPMS.$(VERSION).php*.zip $(RELEASE_PATH)/pmsPack
|
||||
mv *.deb $(RELEASE_PATH)/pmsPack/deb
|
||||
mv *.rpm $(RELEASE_PATH)/pmsPack/rpm
|
||||
|
||||
Executable → Regular
+5
-4
@@ -3,8 +3,9 @@
|
||||
* This file is used to compress css and js files.
|
||||
*/
|
||||
|
||||
$baseDir = dirname(dirname(__FILE__));
|
||||
$jarPath = getenv('JAR_YUI_PATH');
|
||||
$baseDir = dirname(dirname(__FILE__));
|
||||
$miniCSSTool = getenv('MINIFY_CSS_PATH');
|
||||
$miniJSTool = getenv('MINIFY_JS_PATH');
|
||||
|
||||
//--------------------------------- PROCESS JS FILES ------------------------------ //
|
||||
|
||||
@@ -26,7 +27,7 @@ foreach($jsFiles as $jsFile) $jsCode .= "\n". str_replace('/*!', '/*', file_get_
|
||||
file_put_contents($allJSFile, $jsCode);
|
||||
|
||||
/* Compress it. */
|
||||
`java -jar $jarPath/yuicompressor.jar --type js $allJSFile -o $allJSFile`;
|
||||
`php $miniJSTool $allJSFile $allJSFile`;
|
||||
|
||||
//-------------------------------- PROCESS CSS FILES ------------------------------ //
|
||||
|
||||
@@ -79,6 +80,6 @@ foreach($langs as $lang)
|
||||
file_put_contents($cssFile, $cssCode);
|
||||
|
||||
/* Compress it. */
|
||||
`java -jar $jarPath/yuicompressor.jar --type css $cssFile -o $cssFile`;
|
||||
`php $miniCSSTool $cssFile $cssFile`;
|
||||
}
|
||||
}
|
||||
|
||||
+18
-17
@@ -28,6 +28,15 @@ $fileList[] = "{$basePath}/zentaomax.php7.2_7.4.zip";
|
||||
|
||||
foreach($fileList as $file) if(!file_exists($file)) echo basename($file) . " is not exists\n";
|
||||
|
||||
`unzip {$basePath}/zentaobiz.php5.4_5.6.zip; mv biz zentaobiz.php5.4_5.6`;
|
||||
`unzip {$basePath}/zentaobiz.php7.0.zip; mv biz zentaobiz.php7.0`;
|
||||
`unzip {$basePath}/zentaobiz.php7.1.zip; mv biz zentaobiz.php7.1`;
|
||||
`unzip {$basePath}/zentaobiz.php7.2_7.4.zip; mv biz zentaobiz.php7.2_7.4`;
|
||||
`unzip {$basePath}/zentaomax.php5.4_5.6.zip; mv max zentaomax.php5.4_5.6`;
|
||||
`unzip {$basePath}/zentaomax.php7.0.zip; mv max zentaomax.php7.0`;
|
||||
`unzip {$basePath}/zentaomax.php7.1.zip; mv max zentaomax.php7.1`;
|
||||
`unzip {$basePath}/zentaomax.php7.2_7.4.zip; mv max zentaomax.php7.2_7.4`;
|
||||
|
||||
/* Create shells to make zip format packages. */
|
||||
$shellList = array();
|
||||
foreach(array('zh-cn', 'en') as $langType)
|
||||
@@ -36,36 +45,28 @@ foreach(array('zh-cn', 'en') as $langType)
|
||||
$packPrefix = $langType == 'zh-cn' ? 'ZenTaoPMS' : 'ZenTaoALM';
|
||||
$version = $langType == 'zh-cn' ? $pmsVersion : $pmsVersion . '.int';
|
||||
$dirName = $langType == 'zh-cn' ? 'zentaopms' : 'zentaoalm';
|
||||
if(!empty($liteVersion)) $liteVersionAB = $langType == 'zh-cn' ? $liteVersion : $liteVersion . '.int';
|
||||
|
||||
/* Cycle the php versions. */
|
||||
foreach(array('5.4_5.6', '7.0', '7.1', '7.2_7.4', '8.0') as $phpVersion)
|
||||
{
|
||||
/* File name. */
|
||||
$workDir = "tmp/$packPrefix.{$version}.{$phpVersion}/";
|
||||
$shellName = $workDir . "make.sh";
|
||||
$workDir = "tmp/$packPrefix.{$version}.{$phpVersion}/";
|
||||
$shellName = $workDir . "make.sh";
|
||||
$encryptedPhpVersion = $phpVersion == '8.0' ? '7.2_7.4' : $phpVersion;
|
||||
echo "Creating $shellName\n";
|
||||
|
||||
mkdir($workDir, 0777, true);
|
||||
|
||||
/* The commands of the shell. */
|
||||
$command = "cd $workDir\n";
|
||||
$command .= "if [ ! -d ../$dirName ]; then unzip ../../$packPrefix.{$version}.zip -d ../ ; fi\n";
|
||||
$command .= "cp -raf ../$dirName .\n";
|
||||
$command .= "unzip ../../zentaobiz.php{$phpVersion}.zip\n";
|
||||
$command .= "unzip ../../zentaomax.php{$phpVersion}.zip\n";
|
||||
$command .= "cp -rf biz/* $dirName/\n";
|
||||
$command .= "cp -rf max/* $dirName/\n";
|
||||
//$command .= "if [ ! -d ../$dirName ]; then unzip ../../$packPrefix.{$version}.zip -d ../ ; fi\n";
|
||||
$command .= "unzip ../../$packPrefix.{$version}.zip\n";
|
||||
//$command .= "cp -raf ../$dirName .\n";
|
||||
$command .= "cp -rf ../../zentaobiz.php$encryptedPhpVersion/* $dirName/\n";
|
||||
$command .= "cp -rf ../../zentaomax.php$encryptedPhpVersion/* $dirName/\n";
|
||||
$command .= "zip -r ../../$packPrefix.{$version}.php{$phpVersion}.zip $dirName\n";
|
||||
|
||||
if(!empty($liteVersion))
|
||||
{
|
||||
$command .= "cd $dirName/config/ext; touch visions.php; echo '<?php\n\$config->visions = \",lite,\";' > visions.php\n";
|
||||
$command .= "echo $liteVersionAB > $dirName/VERSION\n";
|
||||
$command .= "zip -r ../../$packPrefix.{$liteVersionAB}.php{$phpVersion}.zip $dirName\n";
|
||||
}
|
||||
|
||||
$command .= "rm -rf $dirName/ biz/ max/\n";
|
||||
$command .= "rm -rf $dirName/\n";
|
||||
|
||||
file_put_contents($shellName, $command);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user