Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: libadblockplus.gyp

Issue 9846017: Make JavaScript sources compile into the library; convert JavaScript files on the fly (Closed)
Patch Set: Created March 14, 2013, 10:02 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: libadblockplus.gyp
===================================================================
--- a/libadblockplus.gyp
+++ b/libadblockplus.gyp
@@ -8,22 +8,57 @@
'include',
'third_party/v8/include'
],
'dependencies': ['third_party/v8/tools/gyp/v8.gyp:v8'],
'sources': [
'src/ConsoleJsObject.cpp',
'src/ErrorCallback.cpp',
'src/FileReader.cpp',
- 'src/JsEngine.cpp'
+ 'src/JsEngine.cpp',
+ '<(INTERMEDIATE_DIR)/adblockplus.js.cc'
],
'direct_dependent_settings': {
'include_dirs': ['include']
},
- 'export_dependent_settings': ['third_party/v8/tools/gyp/v8.gyp:v8']
+ 'export_dependent_settings': ['third_party/v8/tools/gyp/v8.gyp:v8'],
+ 'actions': [{
+ 'action_name': 'convert_js',
+ 'variables': {
+ 'core_library_files': [
+ 'adblockplus/lib/filterNotifier.js',
+ 'adblockplus/lib/filterClasses.js',
+ 'adblockplus/lib/subscriptionClasses.js',
+ 'adblockplus/lib/filterStorage.js',
+ 'adblockplus/lib/elemHide.js',
+ 'adblockplus/lib/matcher.js',
+ 'adblockplus/lib/filterListener.js',
+ 'adblockplus/lib/synchronizer.js',
+ ],
+ 'additional_library_files': [
+ 'lib/adblockplus_compat.js'
+ ],
+ },
+ 'inputs': [
+ 'convert_js.py',
+ '<@(core_library_files)',
+ '<@(additional_library_files)',
+ ],
+ 'outputs': [
+ '<(INTERMEDIATE_DIR)/adblockplus.js.cpp'
+ ],
+ 'action': [
+ 'python',
+ 'convert_js.py',
+ '<@(core_library_files)',
+ '--',
+ '<@(additional_library_files)',
+ '<@(_outputs)',
+ ]
+ }]
},
{
'target_name': 'tests',
'type': 'executable',
'dependencies': [
'third_party/googletest.gyp:googletest_main',
'libadblockplus'
],

Powered by Google App Engine
This is Rietveld