From b1438204c1d9674bdc53eca864f4cd04ec2419ad Mon Sep 17 00:00:00 2001 From: ArmandBahi <armand.bahi@veremes.com> Date: Wed, 17 Oct 2018 10:54:25 +0200 Subject: [PATCH] update app template --- .gitignore | 2 ++ conf/Gruntfile.js | 24 +++++++++++++++--------- utils/init_symlinks.sh | 1 + utils/pull_subtrees.sh | 1 + utils/push_subtrees.sh | 7 ++++++- 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 37badcac..d8b5d991 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ client vas conf/closure +conf/node_modules/ conf/properties.json +src/closure/conf/depswriter/ src/vitis/vas/log/ src/vitis/vas/public/ src/vitis/vas/server/ diff --git a/conf/Gruntfile.js b/conf/Gruntfile.js index 95716ae2..d86f3611 100755 --- a/conf/Gruntfile.js +++ b/conf/Gruntfile.js @@ -3,15 +3,21 @@ module.exports = function (grunt) { var compilerPackage = require('google-closure-compiler'); compilerPackage.grunt(grunt); + var devMode = grunt.option('dev'); + var sHome = '../'; + if (devMode) { + sHome = '../client/'; + } + var sClosureDepsHome = '../../../../../'; - // Project configuration. + // Project configuration. grunt.initConfig({ 'closure-compiler': { GTF: { files: { - '../javascript/gtf.min.js': [ + [sHome + '/javascript/gtf.min.js']: [ // Fichiers Vitis sHome + 'javascript/require/*.js', sHome + 'javascript/app/**/*.js', @@ -51,13 +57,13 @@ module.exports = function (grunt) { language_in: 'ECMASCRIPT5', language_out: 'ECMASCRIPT5', closure_entry_point: ['vitis.gtf', 'vitis', 'oVFB'], - create_source_map: '../javascript/gtf.min.js.map', + create_source_map: sHome + '/javascript/gtf.min.js.map', output_wrapper: '(function(){\n%output%\n}).call(this)\n//# sourceMappingURL=../javascript/gtf.min.js.map' } }, widget: { files: { - '../javascript/widget.min.js': [ + [sHome + '/javascript/widget.min.js']: [ // Fichiers Vitis sHome + 'modules/gtf/javascript/widget/deps.js', sHome + 'javascript/app/app.js', @@ -100,7 +106,7 @@ module.exports = function (grunt) { language_in: 'ECMASCRIPT5', language_out: 'ECMASCRIPT5', closure_entry_point: ['vitis.gtf.widget', 'vitis'], - create_source_map: '../javascript/widget.min.js.map', + create_source_map: sHome + '/javascript/widget.min.js.map', output_wrapper: '(function(){\n%output%\n}).call(this)\n//# sourceMappingURL=../javascript/widget.min.js.map' } } @@ -114,7 +120,7 @@ module.exports = function (grunt) { '"' + sHome + 'modules/vitis/javascript ' + sClosureDepsHome + 'modules/vitis/javascript"', '"' + sHome + 'javascript/externs/formReader ' + sClosureDepsHome + 'javascript/externs/formReader"', '"' + sHome + 'conf/requires ' + sClosureDepsHome + 'conf/requires"', - '"' + sHome + 'javascript/externs/mapJSON ' + sClosureDepsHome + 'javascript/externs/mapJSON"', + '"' + sHome + 'javascript/externs/mapJSON ' + sClosureDepsHome + 'javascript/externs/mapJSON"', // Fichiers gtf '"' + sHome + 'modules/gtf/javascript ' + sClosureDepsHome + 'modules/gtf/javascript"', // OpenLayers @@ -127,18 +133,18 @@ module.exports = function (grunt) { ] }, targetName: { - dest: '../javascript/gtf.deps.js' + dest: sHome + '/javascript/gtf.deps.js' } } }); grunt.loadNpmTasks('grunt-closure-tools'); - // Tache par défaut + // Tache par défaut // cmd: grunt grunt.registerTask('default', ['closureDepsWriter', 'closure-compiler:GTF', 'closure-compiler:widget']); // cmd: grunt generate-deps grunt.registerTask('generate-deps', ['closureDepsWriter']); // cmd: grunt compile grunt.registerTask('compile', ['closure-compiler:GTF', 'closure-compiler:widget']); -}; \ No newline at end of file +}; diff --git a/utils/init_symlinks.sh b/utils/init_symlinks.sh index 11be3da0..c98ed30e 100755 --- a/utils/init_symlinks.sh +++ b/utils/init_symlinks.sh @@ -94,6 +94,7 @@ if [[ $depsCount > 0 ]]; then if [ -d "${APP_EXISTING_PATH}/$folder_path" ]; then echo "copy $folder_path" cp -Rf "${APP_EXISTING_PATH}/$folder_path" "$(pwd)/$folder_path" + chmod 777 -R "$(pwd)/$folder_path" fi done diff --git a/utils/pull_subtrees.sh b/utils/pull_subtrees.sh index f8ba5fc5..c2793f2e 100755 --- a/utils/pull_subtrees.sh +++ b/utils/pull_subtrees.sh @@ -21,6 +21,7 @@ git subtree pull --prefix src/vitis --squash -m "pull subtree" "git@gitlab.vere # fichiers à ignorer git update-index --assume-unchanged conf/properties.json +git update-index --assume-unchanged conf/package.json git update-index --assume-unchanged src/vitis/vas/rest/.htaccess git update-index --assume-unchanged src/vitis/vas/rest/conf/properties.inc git update-index --assume-unchanged src/vitis/vas/rest/conf/properties_domain.inc diff --git a/utils/push_subtrees.sh b/utils/push_subtrees.sh index fb430d5f..b4949ea2 100755 --- a/utils/push_subtrees.sh +++ b/utils/push_subtrees.sh @@ -26,7 +26,12 @@ if [[ $depsCount > 0 ]]; then echo "---- Push ${aDeps[$i, name]} ----" # Push le dépôt - git subtree push --prefix src/${aDeps[$i, name]} "git@gitlab.veremes.net:Development/vitis_apps/sources/${aDeps[$i, name]}.git" master + + { # 'try' block + git subtree push --prefix src/${aDeps[$i, name]} "git@gitlab.veremes.net:Development/vitis_apps/sources/${aDeps[$i, name]}.git" master + } || { # 'catch' block + echo "could not push ${aDeps[$i, name]}" + } fi done fi -- GitLab