-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce
gulp
build to build native/idl files
This change introduces `gulp` build system to build native/idl files. After this patch, we no longer need to create and modify `gyp/gypi` files to update the list of native/idl files. This change includes the following things: - Introduce `gulp` build (including some related packages) - Stop using `.gypi` files except `generator.gypi`. Once move TSC build to `gulp`, then we can remove it as well ISSUE=#98,#193
- Loading branch information
Showing
8 changed files
with
100 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/** | ||
* Copyright (c) 2017 The Absolute Authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import * as gulp from 'gulp'; | ||
import * as path from 'path'; | ||
import * as through from 'through2'; | ||
|
||
gulp.task('default', (callback) => { | ||
// FIXME(zino): Should print available commands in Bacardi. | ||
return; | ||
}); | ||
|
||
/** | ||
* This task will be used in binding.gyp to build native files. | ||
*/ | ||
gulp.task('list_cpp_files', (callback) => { | ||
return gulp | ||
.src([ | ||
'core/**/*.h', 'core/**/*.cc', 'examples/**/*.h', 'examples/**/*.cc', | ||
'test/**/*.h', 'test/**/*.cc' | ||
]) | ||
.pipe(printPath()); | ||
}); | ||
|
||
/** | ||
* This task will be used in binding.gyp to build idl files. | ||
*/ | ||
gulp.task('list_idl_files', (callback) => { | ||
return gulp.src(['examples/**/*.idl', 'test/**/*.idl']).pipe(printPath()); | ||
}); | ||
|
||
/** | ||
* This task will be used in binding.gyp to build idl files. | ||
*/ | ||
gulp.task('list_generated_cpp_files', (callback) => { | ||
// FIXME(zino): The following file list should be generated by idl generator | ||
// automatically. | ||
const genDir = 'build/Release/obj/gen/'; | ||
const genFiles = [ | ||
path.join(genDir, 'examples/calculator_bridge.cc'), | ||
path.join(genDir, 'examples/calculator_bridge.h'), | ||
path.join(genDir, 'examples/ternary_calculator_bridge.cc'), | ||
path.join(genDir, 'examples/ternary_calculator_bridge.h'), | ||
path.join(genDir, 'examples/electron/native/electron_native_bridge.cc'), | ||
path.join(genDir, 'examples/electron/native/electron_native_bridge.h'), | ||
path.join(genDir, 'test/test_interface_bridge.cc'), | ||
path.join(genDir, 'test/test_interface_bridge.h'), | ||
]; | ||
|
||
return genFiles.forEach((file) => { | ||
process.stdout.write('"' + file + '"\n'); | ||
}); | ||
}); | ||
|
||
/* Custom plugins */ | ||
function printPath() { | ||
return through.obj((files, encoding, callback) => { | ||
process.stdout.write('"' + path.relative(files.cwd, files.path) + '"\n'); | ||
callback(); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.