@@ -10,107 +10,112 @@ var run = require('gulp-run');
1010build . addSuppression ( `Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.` ) ;
1111
1212let subTaskUpdateVersion = build . subTask ( 'update-version-subtask' , function ( gulp , buildOptions , done ) {
13- var self = this ;
14- let inputVersion = buildOptions . args [ PARAMETER_VERSION ] ;
15- let newVersion = "" ;
16- self . log ( `build parameter: ${ inputVersion } ` ) ;
17- return gulp . src ( './config/package-solution.json' )
18- . pipe ( jeditor ( function ( json ) {
19- let currentVersion = json . solution . version ;
20- let versionStrings = [ ] ;
21- //find the major and minor version and replace patch version with input
22- if ( currentVersion . indexOf ( '.' ) != - 1 ) {
23- versionStrings = currentVersion . split ( '.' ) ;
24- }
25- if ( versionStrings != null && versionStrings . length > 2 ) {
26- //check if input version includes "_"
27- self . log ( `inputVersion: ${ inputVersion } ` ) ;
28- if ( inputVersion && inputVersion . indexOf ( '_' ) != - 1 ) {
29- const inputVersionArray = inputVersion . split ( '_' ) ;
30- inputVersion = inputVersionArray [ inputVersionArray . length - 1 ] ;
31- //get last mmdd.ref
32- //inputVersion = inputVersion.substring(4, inputVersion.length);
33- newVersion = inputVersion . substring ( 4 , inputVersion . length ) ;
34- self . log ( `buildOptions parameter '${ buildOptions . args [ PARAMETER_VERSION ] } ' include '_' and use last segment ${ newVersion } ` ) ;
35- } else {
36- //auto increase the version
37- newVersion = + versionStrings [ 3 ] + 1 ;
38- }
39-
40- //json.solution.version = `${versionStrings[0]}.${versionStrings[1]}.${inputVersion}`;
41- json . solution . version = `${ versionStrings [ 0 ] } .${ versionStrings [ 1 ] } .${ versionStrings [ 2 ] } .${ newVersion } ` ;
42- self . log ( `version: ${ json . solution . version } ` ) ;
43- } else {
44- self . log ( `version entry is either empty or not as "major.minor.pathch" format. currentVersion: ${ currentVersion } ` ) ;
45- }
46-
47- return json ;
48- } , {
49- 'indent_char' : '\t' ,
50- 'indent_size' : 4
51- } ) )
52- . pipe ( gulp . dest ( './config' ) ) ;
13+ var self = this ;
14+ let inputVersion = buildOptions . args [ PARAMETER_VERSION ] ;
15+ let newVersion = "" ;
16+ self . log ( `build parameter: ${ inputVersion } ` ) ;
17+ return gulp . src ( './config/package-solution.json' )
18+ . pipe ( jeditor ( function ( json ) {
19+ let currentVersion = json . solution . version ;
20+ let versionStrings = [ ] ;
21+ //find the major and minor version and replace patch version with input
22+ if ( currentVersion . indexOf ( '.' ) != - 1 ) {
23+ versionStrings = currentVersion . split ( '.' ) ;
24+ }
25+ if ( versionStrings != null && versionStrings . length > 2 ) {
26+ //check if input version includes "_"
27+ self . log ( `inputVersion: ${ inputVersion } ` ) ;
28+ if ( inputVersion && inputVersion . indexOf ( '_' ) != - 1 ) {
29+ const inputVersionArray = inputVersion . split ( '_' ) ;
30+ inputVersion = inputVersionArray [ inputVersionArray . length - 1 ] ;
31+ //get last mmdd.ref
32+ //inputVersion = inputVersion.substring(4, inputVersion.length);
33+ newVersion = inputVersion . substring ( 4 , inputVersion . length ) ;
34+ self . log ( `buildOptions parameter '${ buildOptions . args [ PARAMETER_VERSION ] } ' include '_' and use last segment ${ newVersion } ` ) ;
35+ } else {
36+ //auto increase the version
37+ newVersion = + versionStrings [ 3 ] + 1 ;
38+ }
39+
40+ //json.solution.version = `${versionStrings[0]}.${versionStrings[1]}.${inputVersion}`;
41+ json . solution . version = `${ versionStrings [ 0 ] } .${ versionStrings [ 1 ] } .${ versionStrings [ 2 ] } .${ newVersion } ` ;
42+ self . log ( `version: ${ json . solution . version } ` ) ;
43+ } else {
44+ self . log ( `version entry is either empty or not as "major.minor.pathch" format. currentVersion: ${ currentVersion } ` ) ;
45+ }
46+
47+ return json ;
48+ } , {
49+ 'indent_char' : '\t' ,
50+ 'indent_size' : 4
51+ } ) )
52+ . pipe ( gulp . dest ( './config' ) ) ;
5353} ) ;
5454
5555let taskUpdateVersionTask = build . task ( 'update-version' , subTaskUpdateVersion ) ;
5656
5757//task - ExecPowerShell
5858let subTaskExecPowerShell = build . subTask ( 'exec-powershell-subtask' , function ( gulp , buildOptions , done ) {
59- // return run('write-host "Hello World"', {
60- // usePowerShell: true
61- // }).exec();
62- return run ( 'o365 version' ) . exec ( ) ;
59+ // return run('write-host "Hello World"', {
60+ // usePowerShell: true
61+ // }).exec();
62+ return run ( 'o365 version' ) . exec ( ) ;
6363} ) ;
6464let taskExecPowerShellTask = build . task ( 'exec-powershell' , subTaskExecPowerShell ) ;
6565
6666//Deployment
6767let subTaskDeploy = build . subTask ( 'deploy-subtask' , function ( gulp , buildOptions , done ) {
68- run ( './deploy.ps1' , {
69- usePowerShell : true
70- } ) . exec ( ) ;
71- // run('write-host "Hello World"', {
72- // usePowerShell: true
73- // }).exec();
74- // run('write-host "Hello World"', {
75- // usePowerShell: true
76- // }).exec();
77- // run('write-host "Hello World"', {
78- // usePowerShell: true
79- // }).exec();
68+ run ( './deploy.ps1' , {
69+ usePowerShell : true
70+ } ) . exec ( ) ;
71+ // run('write-host "Hello World"', {
72+ // usePowerShell: true
73+ // }).exec();
74+ // run('write-host "Hello World"', {
75+ // usePowerShell: true
76+ // }).exec();
77+ // run('write-host "Hello World"', {
78+ // usePowerShell: true
79+ // }).exec();
8080} ) ;
8181let taskDeploy = build . task ( 'deploy' , subTaskDeploy ) ;
8282
8383gulp . task ( 'custom-serve' , function ( done ) {
84- runSequence ( 'update-version' , 'serve' , function ( ) {
85- done ( ) ;
86- } )
84+ runSequence ( 'update-version' , 'serve' , function ( ) {
85+ done ( ) ;
86+ } )
8787} ) ;
8888
8989//WebPack
9090build . configureWebpack . mergeConfig ( {
91- additionalConfiguration : ( generatedConfiguration ) => {
92- generatedConfiguration . module . rules . push ( {
93- test : / \. m d $ / ,
94- use : [ {
95- loader : 'html-loader'
96- } ,
97- {
98- loader : 'markdown-loader'
99- }
100- ]
101- } ) ;
102-
103- return generatedConfiguration ;
104- }
91+ additionalConfiguration : ( generatedConfiguration ) => {
92+ generatedConfiguration . module . rules . push ( {
93+ test : / \. m d $ / ,
94+ use : [ {
95+ loader : 'html-loader'
96+ } ,
97+ {
98+ loader : 'markdown-loader'
99+ }
100+ ]
101+ } ) ;
102+
103+ return generatedConfiguration ;
104+ }
105105} ) ;
106106
107107var getTasks = build . rig . getTasks ;
108108build . rig . getTasks = function ( ) {
109- var result = getTasks . call ( build . rig ) ;
109+ var result = getTasks . call ( build . rig ) ;
110110
111- result . set ( 'serve' , result . get ( 'serve-deprecated' ) ) ;
111+ result . set ( 'serve' , result . get ( 'serve-deprecated' ) ) ;
112112
113- return result ;
113+ return result ;
114114} ;
115115
116+ // ********* ADDED *******
117+ // disable tslint
118+ build . tslintCmd . enabled = false ;
119+ // ********* ADDED *******
120+
116121build . initialize ( gulp ) ;
0 commit comments