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

Unified Diff: sdk/lib/rules.gni

Issue 1692603002: Introduce dart_sdk_lib_copy and make all sdk lib gypi files regular (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | « sdk/lib/io/iolib_sources.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/rules.gni
diff --git a/sdk/lib/rules.gni b/sdk/lib/rules.gni
new file mode 100644
index 0000000000000000000000000000000000000000..93ade221871799e2642368200853891a869bf6a3
--- /dev/null
+++ b/sdk/lib/rules.gni
@@ -0,0 +1,44 @@
+# Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+# This build rule will copy the source for one Dart SDK library.
+#
+# Required arguments:
+# sdk_lib_name
+# The name of a Dart SDK library.
+#
+# Optional arguments:
+# dart_root
+# Path to the Dart SDK source root. Default value is "//dart".
+#
+# The sources will be copied into $root_gen_dir/dart_sdk_libs/$sdk_lib_name/.
+#
+template("dart_sdk_lib_copy") {
+ assert(defined(invoker.sdk_lib_name))
+ if (defined(invoker.dart_root)) {
+ dart_root = rebase_path(invoker.dart_root)
+ } else {
+ dart_root = rebase_path("//dart")
+ }
+ dart_sdk_sdk_lib_path =
+ rebase_path("sdk/lib", "", dart_root)
+ dart_sdk_tools_gypi_to_gn_path =
+ rebase_path("tools/gypi_to_gn.py", "", dart_root)
+ # The name of the SDK library being copied.
+ lib_name = invoker.sdk_lib_name
+ # The path to the libraries source directory.
+ lib_path = rebase_path(lib_name, "", dart_sdk_sdk_lib_path)
+ # The path to the sources gypi.
+ lib_sources_gypi = lib_name + "_sources.gypi"
+ # Get the contents of the gypi file.
+ sdk_lib_sources_gypi =
+ exec_script(dart_sdk_tools_gypi_to_gn_path,
+ [rebase_path(lib_sources_gypi, "", lib_path)],
+ "scope",
+ [rebase_path(lib_sources_gypi, "", lib_path)])
+ copy(target_name) {
+ sources = rebase_path(sdk_lib_sources_gypi.sources, "", lib_path)
+ outputs = [ "$root_gen_dir/dart_sdk_libs/$lib_name/{{source_file_part}}" ]
+ }
+}
« no previous file with comments | « sdk/lib/io/iolib_sources.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698