1- var { series} = require ( 'gulp' ) ;
2- var execFile = require ( 'child_process' ) . execFile ;
3- var glob = require ( 'glob' ) ;
4- var fs = require ( 'fs' ) ;
1+ const { series} = require ( 'gulp' ) ;
2+ const execFile = require ( 'child_process' ) . execFile ;
3+ const glob = require ( 'glob' ) ;
54
65function exec ( command , cb ) {
76 execFile ( 'sh' , [ '-c' , command ] , cb ) ;
87}
98
10- var plugin = '--plugin=protoc-gen-js=bazel-bin/generator/protoc-gen-js' ;
11- var protoc = [ ( process . env . PROTOC || 'protoc' ) , plugin ] . join ( ' ' ) ;
12- var protocInc = process . env . PROTOC_INC || '../src' ;
9+ const plugin = '--plugin=protoc-gen-js=bazel-bin/generator/protoc-gen-js' ;
10+ const protoc = [ ( process . env . PROTOC || 'protoc' ) , plugin ] . join ( ' ' ) ;
11+ const protocInc = process . env . PROTOC_INC || '../src' ;
1312
14- var wellKnownTypes = [
13+ const wellKnownTypes = [
1514 'google/protobuf/any.proto' ,
1615 'google/protobuf/api.proto' ,
1716 'google/protobuf/compiler/plugin.proto' ,
@@ -26,9 +25,9 @@ var wellKnownTypes = [
2625 'google/protobuf/wrappers.proto' ,
2726] ;
2827
29- wellKnownTypes . forEach ( ( path , i ) => protocInc + '/' + path ) ;
28+ wellKnownTypes . forEach ( ( path ) => protocInc + '/' + path ) ;
3029
31- var group1Protos = [
30+ const group1Protos = [
3231 'data.proto' ,
3332 'test3.proto' ,
3433 'test5.proto' ,
@@ -45,14 +44,14 @@ var group1Protos = [
4544 'testlargenumbers.proto' ,
4645] ;
4746
48- var group2Protos = [
47+ const group2Protos = [
4948 'proto3_test.proto' ,
5049 'test2.proto' ,
5150 'test4.proto' ,
5251 'commonjs/test7/test7.proto' ,
5352] ;
5453
55- var group3Protos = [
54+ const group3Protos = [
5655 'test9.proto' ,
5756 'test10.proto'
5857] ;
@@ -119,9 +118,9 @@ function genproto_group3_commonjs_strict(cb) {
119118
120119
121120function getClosureCompilerCommand ( exportsFile , outputFile , keepSymbols ) {
122- var compilationLevel = 'ADVANCED_OPTIMIZATIONS ' ;
121+ let compilationLevel = 'ADVANCED ' ;
123122 if ( keepSymbols === true ) {
124- compilationLevel = 'SIMPLE_OPTIMIZATIONS ' ;
123+ compilationLevel = 'SIMPLE ' ;
125124 }
126125
127126 const closureLib = 'node_modules/google-closure-library' ;
@@ -132,8 +131,8 @@ function getClosureCompilerCommand(exportsFile, outputFile, keepSymbols) {
132131 '--js=message.js' , '--js=binary/arith.js' , '--js=binary/constants.js' ,
133132 '--js=binary/decoder.js' , '--js=binary/encoder.js' , '--js=binary/reader.js' ,
134133 '--js=binary/utils.js' , '--js=binary/writer.js' , `--js=${ exportsFile } ` ,
135- `--compilation_level=${ compilationLevel } "` , '--generate_exports' ,
136- '--export_local_property_definitions" ' ,
134+ `--compilation_level=" ${ compilationLevel } "` , '--generate_exports' ,
135+ '--export_local_property_definitions' ,
137136 `--entry_point=${ exportsFile } ` , `> ${ outputFile } `
138137 ] . join ( ' ' ) ;
139138}
@@ -170,7 +169,7 @@ function commonjs_testdeps(cb) {
170169function commonjs_out ( cb ) {
171170 // TODO(haberman): minify this more aggressively.
172171 // Will require proper externs/exports.
173- var cmd =
172+ let cmd =
174173 'mkdir -p commonjs_out/binary && mkdir -p commonjs_out/test_node_modules && ' ;
175174 function addTestFile ( file ) {
176175 cmd += 'node commonjs/rewrite_tests_for_commonjs.js < ' + file +
0 commit comments