@@ -8,13 +8,19 @@ const Listr = require('listr');
88const mkdirp = require ( 'mkdirp' ) ;
99
1010const common = require ( './common' ) ;
11- const util = require ( './util' ) ;
11+ const {
12+ getNodeV8Version,
13+ filterForVersion,
14+ addToGitignore,
15+ replaceGitignore
16+ } = require ( './util' ) ;
1217const {
1318 moveGypfilesOut,
1419 moveGypfilesIn,
1520 updateGypfiles
1621} = require ( './gypfiles' ) ;
17- const { chromiumGit } = require ( './constants' ) ;
22+ const applyNodeChanges = require ( './applyNodeChanges' ) ;
23+ const { chromiumGit, v8Deps } = require ( './constants' ) ;
1824
1925module . exports = function ( ) {
2026 return {
@@ -28,6 +34,7 @@ module.exports = function() {
2834 cloneLocalV8 ( ) ,
2935 removeDepsV8Git ( ) ,
3036 updateV8Deps ( ) ,
37+ applyNodeChanges ( ) ,
3138 moveGypfilesIn ( ) ,
3239 updateGypfiles ( )
3340 ] ) ;
@@ -102,8 +109,8 @@ function updateV8Deps() {
102109 return {
103110 title : 'Update V8 DEPS' ,
104111 task : async ( ctx ) => {
105- const newV8Version = util . getNodeV8Version ( ctx . nodeDir ) ;
106- const deps = util . getV8Deps ( newV8Version ) ;
112+ const newV8Version = getNodeV8Version ( ctx . nodeDir ) ;
113+ const deps = filterForVersion ( v8Deps , newV8Version ) ;
107114 if ( deps . length === 0 ) return ;
108115 /* eslint-disable no-await-in-loop */
109116 for ( const dep of deps ) {
@@ -123,18 +130,6 @@ function updateV8Deps() {
123130 } ;
124131}
125132
126- async function addToGitignore ( nodeDir , value ) {
127- const gitignorePath = path . join ( nodeDir , 'deps/v8/.gitignore' ) ;
128- await fs . appendFile ( gitignorePath , `${ value } \n` ) ;
129- }
130-
131- async function replaceGitignore ( nodeDir , options ) {
132- const gitignorePath = path . join ( nodeDir , 'deps/v8/.gitignore' ) ;
133- let gitignore = await fs . readFile ( gitignorePath , 'utf8' ) ;
134- gitignore = gitignore . replace ( options . match , options . replace ) ;
135- await fs . writeFile ( gitignorePath , gitignore ) ;
136- }
137-
138133async function readDeps ( nodeDir , depName ) {
139134 const depsStr = await fs . readFile ( path . join ( nodeDir , 'deps/v8/DEPS' ) , 'utf8' ) ;
140135 const start = depsStr . indexOf ( 'deps = {' ) ;
0 commit comments