Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: mojo/public/js/BUILD.gn

Issue 2347783004: [Experiment] Transpile mojo public js.
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | mojo/public/js/main.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/js/BUILD.gn
diff --git a/mojo/public/js/BUILD.gn b/mojo/public/js/BUILD.gn
index eda7e04d07ef67f2e819bcbfb6fa1da79803f8bc..a2e2fc3da50f7f95f4d06fd53ca76596967d7a8d 100644
--- a/mojo/public/js/BUILD.gn
+++ b/mojo/public/js/BUILD.gn
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//build/util/java_action.gni")
+
source_set("js") {
sources = [
"constants.cc",
@@ -27,6 +29,50 @@ group("bindings") {
]
}
+template("js_binary") {
+ closure_compiler_path = "//third_party/closure_compiler/compiler/compiler.jar"
+ output_file_path = "$target_gen_dir/$target_name.js"
+
+ java_action(target_name) {
+ script = closure_compiler_path
+ sources = invoker.sources
+ outputs = [
+ "$output_file_path",
+ ]
+ args = [
+ "--compilation_level",
+ "WHITESPACE_ONLY",
+ "--dependency_mode",
+ "STRICT",
+ "--transform_amd_modules",
+ "--process_common_js_modules",
+ "--language_out",
+ "ECMASCRIPT5",
+ "--formatting",
+ "PRETTY_PRINT",
+ "--js_output_file",
+ rebase_path("$output_file_path", root_build_dir),
+ "--entry_point",
+ rebase_path("main.js", root_build_dir),
+ "--js",
+ ] + rebase_path(sources, root_build_dir)
+ }
+}
+
+js_binary("lib") {
+ sources = [
+ "bindings.js",
+ "buffer.js",
+ "codec.js",
+ "connection.js",
+ "connector.js",
+ "main.js",
+ "router.js",
+ "unicode.js",
+ "validator.js",
+ ]
+}
+
group("tests") {
testonly = true
« no previous file with comments | « no previous file | mojo/public/js/main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698