Commit 0cea0c1ad0b2db47a59c5ab0eafb8737840ea3a8

Authored by Mauricio Cattafi
1 parent 58e0355c80
Exists in fix_configuracion

se agregan datos faltantes para la configuración de ejemplo

Showing 2 changed files with 9 additions and 5 deletions   Show diff stats
1 const gulp = require('gulp'); 1 const gulp = require('gulp');
2 const sass = require('gulp-sass'); 2 const sass = require('gulp-sass');
3 const concat = require('gulp-concat'); 3 const concat = require('gulp-concat');
4 const rename = require('gulp-rename'); 4 const rename = require('gulp-rename');
5 const uglify = require('gulp-uglify'); 5 const uglify = require('gulp-uglify');
6 const pump = require('pump'); 6 const pump = require('pump');
7 const jshint = require('gulp-jshint'); 7 const jshint = require('gulp-jshint');
8 const replace = require('gulp-replace'); 8 const replace = require('gulp-replace');
9 const connect = require('gulp-connect'); 9 const connect = require('gulp-connect');
10 const watch = require('gulp-watch'); 10 const watch = require('gulp-watch');
11 const gulpSequence = require('gulp-sequence') 11 const gulpSequence = require('gulp-sequence')
12 var paths = { 12 var paths = {
13 srcHTML : 'src/views/*.html', 13 srcHTML : 'src/views/*.html',
14 srcJS : 'src/js/*.js', 14 srcJS : 'src/js/*.js',
15 confJS : 'src/etc/develop.js', 15 confJS : 'src/etc/develop.js',
16 dist : 'dist/', 16 dist : 'dist/',
17 distHTML : 'dist/views/' 17 distHTML : 'dist/views/'
18 }; 18 };
19 19
20 gulp.task('uglify', function() { 20 gulp.task('uglify', function() {
21 pump( 21 pump(
22 [ 22 [
23 gulp.src([paths.srcJS, paths.confJS]), 23 gulp.src([paths.srcJS, paths.confJS]),
24 concat('wrapper-facturador.js'), 24 concat('wrapper-facturador.js'),
25 replace('/src/', '/dist/'), 25 replace('/src/', '/dist/'),
26 gulp.dest(paths.dist), 26 gulp.dest(paths.dist),
27 rename('wrapper-facturador.min.js'), 27 rename('wrapper-facturador.min.js'),
28 uglify(), 28 uglify(),
29 gulp.dest(paths.dist) 29 gulp.dest(paths.dist)
30 ] 30 ]
31 ); 31 );
32 }); 32 });
33 33
34 gulp.task('html', function() { 34 gulp.task('html', function() {
35 pump([ 35 pump([
36 gulp.src('index.html'), 36 gulp.src('index.html'),
37 replace(/\<!\-\- BUILD \-\-\>.*\<!\-\- \/BUILD \-\-\>/sgm, '<script src="wrapper-facturador.min.js"></script>'), 37 replace(/\<!\-\- BUILD \-\-\>.*\<!\-\- \/BUILD \-\-\>/sgm, '<script src="wrapper-facturador.min.js"></script>'),
38 gulp.dest(paths.dist) 38 gulp.dest(paths.dist)
39 ]); 39 ]);
40 pump([ 40 pump([
41 gulp.src(paths.srcHTML), 41 gulp.src(paths.srcHTML),
42 gulp.dest(paths.distHTML) 42 gulp.dest(paths.distHTML)
43 ]); 43 ]);
44 }); 44 });
45 45
46 gulp.task('sass', function() { 46 gulp.task('sass', function() {
47 return gulp.src('src/sass/*.scss') 47 return gulp.src('src/sass/*.scss')
48 .pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError)) 48 .pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))
49 .pipe(gulp.dest('css')); 49 .pipe(gulp.dest('css'));
50 }); 50 });
51 51
52 gulp.task('pre-install', function() { 52 gulp.task('pre-install', function() {
53 pump([ 53 pump([
54 gulp.src('package.json'), 54 gulp.src('package.json'),
55 replace('ssh://git@debonline.dyndns.org:', 'http://git.focasoftware.com/'), 55 replace('ssh://git@debonline.dyndns.org:', 'http://git.focasoftware.com/'),
56 replace('.git', '.git#develop'), 56 replace('.git', '.git#develop'),
57 replace('foca-login.git#develop', 'foca-login.git#demo'),
58 replace('foca-nombre-empresa.git#develop', 'foca-nombre-empresa.git#demo'),
57 gulp.dest('') 59 gulp.dest('')
58 ]); 60 ]);
59 }); 61 });
60 62
61 gulp.task('post-install', function() { 63 gulp.task('post-install', function() {
62 pump([ 64 pump([
63 gulp.src('package.json'), 65 gulp.src('package.json'),
64 replace('http://git.focasoftware.com/', 'ssh://git@debonline.dyndns.org:'), 66 replace('http://git.focasoftware.com/', 'ssh://git@debonline.dyndns.org:'),
65 replace('#develop', ''), 67 replace('#develop', ''),
68 replace('#demo', ''),
66 gulp.dest('') 69 gulp.dest('')
67 ]); 70 ]);
68 }); 71 });
69 72
70 gulp.task('pre-commit', function() { 73 gulp.task('pre-commit', function() {
71 return pump( 74 return pump(
72 [ 75 [
73 gulp.src(paths.srcJS), 76 gulp.src(paths.srcJS),
74 jshint('.jshintrc'), 77 jshint('.jshintrc'),
75 jshint.reporter('default'), 78 jshint.reporter('default'),
76 jshint.reporter('fail') 79 jshint.reporter('fail')
77 ] 80 ]
78 ); 81 );
79 }); 82 });
80 83
81 gulp.task('webserver', function() { 84 gulp.task('webserver', function() {
82 pump [ 85 pump [
83 connect.server( 86 connect.server(
84 { 87 {
85 port: 8086, 88 port: 8086,
86 host: '0.0.0.0', 89 host: '0.0.0.0',
87 livereload: true 90 livereload: true
88 } 91 }
89 ) 92 )
90 ] 93 ]
91 }); 94 });
92 95
93 gulp.task('watch', function() { 96 gulp.task('watch', function() {
94 gulp.watch([paths.srcJS], ['uglify']); 97 gulp.watch([paths.srcJS], ['uglify']);
95 gulp.watch('src/sass/*.scss', ['sass']); 98 gulp.watch('src/sass/*.scss', ['sass']);
96 }); 99 });
97 100
98 gulp.task('reload', function() { 101 gulp.task('reload', function() {
99 gulp.src(['src/sass/*.scss', 'index.html']) 102 gulp.src(['src/sass/*.scss', 'index.html'])
100 .pipe(connect.reload()); 103 .pipe(connect.reload());
101 }); 104 });
102 105
103 gulp.task('livereload', function() { 106 gulp.task('livereload', function() {
104 gulp.watch('css/*.css', ['reload']); 107 gulp.watch('css/*.css', ['reload']);
105 gulp.watch('js/dist/*.js', ['reload']); 108 gulp.watch('js/dist/*.js', ['reload']);
106 gulp.watch('vistas/**/*.html', ['reload']); 109 gulp.watch('vistas/**/*.html', ['reload']);
107 gulp.watch('index.html', ['reload']); 110 gulp.watch('index.html', ['reload']);
108 }); 111 });
109 112
110 gulp.task('default', gulpSequence(['sass', 'webserver', 'livereload', 'watch'])); 113 gulp.task('default', gulpSequence(['sass', 'webserver', 'livereload', 'watch']));
111 114
src/etc/develop.ejemplo.js
1 angular.module('appWrapperDemo') 1 angular.module('appWrapperFacturador')
2 .constant('API_ENDPOINT', { 2 .constant('API_ENDPOINT', {
3 'URL': '//127.0.0.1:9000' 3 'URL': 'http://localhost:9900',
4 }) 4 'ENDPOINT_BASE': 'http://ypf.app.focasoftware.com:3030',
5 .constant("APP", ''); // Posibles valores '', 'distribuidor', 'transportista' 5 })
6 .constant("APP", 'facturador'); // Posibles valores '', 'distribuidor', 'transportista', 'facturador'