Skip to content

Commit

Permalink
Merge pull request #303 from brave/copying_midl_files
Browse files Browse the repository at this point in the history
Copying our pre-generated midl files to overwrite upstream midl files
  • Loading branch information
simonhong authored Jun 26, 2018
2 parents 437d50e + 79f70c9 commit 6613501
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/updatePatches.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const updatePatches = (options) => {
let modifiedDiff = util.run('git', modifiedDiffArgs, runOptions)
let moddedFileList = modifiedDiff.stdout.toString()
.split('\n')
.filter(s => s.length > 0 && !s.endsWith('.xtb') && !s.endsWith('.png'))
.filter(s => s.length > 0 && !s.endsWith('.xtb') && !s.endsWith('.png') && !s.includes('google_update_idl'))

let n = moddedFileList.length

Expand Down
14 changes: 14 additions & 0 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,23 @@ const util = {
fs.copySync(path.join(braveAppDir, 'strings'), path.join(chromeComponentsDir, 'strings'))
},

// Chromium compares pre-installed midl files and generated midl files from IDL during the build to check integrity.
// Generated files during the build time and upstream pre-installed files are different because we use different IDL file.
// So, we should copy our pre-installed files to overwrite upstream pre-installed files.
// After checking, pre-installed files are copied to gen dir and they are used to compile.
// So, this copying in every build doesn't affect compile performance.
updateOmahaMidlFiles: () => {
console.log('update omaha midl files...')
const srcDir = path.join(config.projects['brave-core'].dir, 'win_build_output', 'midl', 'google_update')
const dstDir = path.join(config.srcDir, 'third_party', 'win_build_output', 'midl', 'google_update')
fs.copySync(srcDir, dstDir)
},

buildTarget: (options = config.defaultOptions) => {
console.log('building ' + config.buildTarget + '...')

util.updateOmahaMidlFiles()

const args = util.buildArgsToString(config.buildArgs())
util.run('gn', ['gen', config.outputDir, '--args="' + args + '"'], options)
util.run('ninja', ['-C', config.outputDir, config.buildTarget], options)
Expand Down

0 comments on commit 6613501

Please sign in to comment.