'atom/common/api/lib/original-fs.coffee',
'atom/common/api/lib/shell.coffee',
'atom/common/lib/init.coffee',
- 'atom/common/lib/asar.coffee',
'atom/renderer/lib/chrome-api.coffee',
'atom/renderer/lib/init.coffee',
'atom/renderer/lib/inspector.coffee',
'atom/renderer/api/lib/screen.coffee',
'atom/renderer/api/lib/web-frame.coffee',
],
+ 'coffee2c_sources': [
+ 'atom/common/lib/asar.coffee',
+ ],
'lib_sources': [
'atom/app/atom_content_client.cc',
'atom/app/atom_content_client.h',
'chromium_src/library_loaders/libspeechd_loader.cc',
'chromium_src/library_loaders/libspeechd.h',
'<@(native_mate_files)',
+ '<(SHARED_INTERMEDIATE_DIR)/atom_natives.h',
],
'lib_sources_win': [
'chromium_src/chrome/browser/ui/views/color_chooser_dialog.cc',
'target_name': '<(project_name)_lib',
'type': 'static_library',
'dependencies': [
+ 'atom_coffee2c',
'vendor/brightray/brightray.gyp:brightray',
'vendor/node/node.gyp:node_lib',
],
'chromium_src',
'vendor/brightray',
'vendor/native_mate',
+ # Include atom_natives.h.
+ '<(SHARED_INTERMEDIATE_DIR)',
# Include directories for uv and node.
'vendor/node/src',
'vendor/node/deps/http_parser',
},
],
}, # target compile_coffee
+ {
+ 'target_name': 'atom_coffee2c',
+ 'type': 'none',
+ 'actions': [
+ {
+ 'action_name': 'atom_coffee2c',
+ 'inputs': [
+ '<@(coffee2c_sources)',
+ ],
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/atom_natives.h',
+ ],
+ 'action': [
+ 'python',
+ 'tools/coffee2c.py',
+ '<@(_outputs)',
+ '<@(_inputs)',
+ ],
+ }
+ ],
+ }, # target atom_coffee2c
{
'target_name': '<(project_name)_dump_symbols',
'type': 'none',
--- /dev/null
+#!/usr/bin/env python
+
+import os
+import subprocess
+import sys
+
+
+SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
+
+
+def main():
+ natives = sys.argv[1]
+ coffee_source_files = sys.argv[2:]
+
+ output_dir = os.path.dirname(natives)
+ js_source_files = compile_coffee(coffee_source_files, output_dir)
+ call_js2c(natives, js_source_files)
+
+
+def compile_coffee(coffee_source_files, output_dir):
+ js_source_files = []
+ for source_file in coffee_source_files:
+ output_filename = os.path.splitext(source_file)[0] + '.js'
+ output_path = os.path.join(output_dir, output_filename)
+ js_source_files.append(output_path)
+ call_compile_coffee(source_file, output_path)
+ return js_source_files
+
+
+def call_compile_coffee(source_file, output_filename):
+ compile_coffee = os.path.join(SOURCE_ROOT, 'tools', 'compile-coffee.py')
+ subprocess.check_call([sys.executable, compile_coffee, source_file,
+ output_filename])
+
+
+def call_js2c(natives, js_source_files):
+ js2c = os.path.join(SOURCE_ROOT, 'vendor', 'node', 'tools', 'js2c.py')
+ subprocess.check_call([sys.executable, js2c, natives] + js_source_files)
+
+
+if __name__ == '__main__':
+ sys.exit(main())