Index: sdk/lib/rules.gni |
diff --git a/sdk/lib/rules.gni b/sdk/lib/rules.gni |
new file mode 100644 |
index 0000000000000000000000000000000000000000..97e6fee5e3ac73968ecabd8e1e6b0011e83a31dd |
--- /dev/null |
+++ b/sdk/lib/rules.gni |
@@ -0,0 +1,30 @@ |
+# 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. |
+# |
+# Expected arguments: |
+# sdk_lib_name |
+# The name of a Dart SDK library. |
+# |
+# 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)) |
+ # 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/lib/") |
zra
2016/02/11 18:58:37
Can //dart be an argument instead of hardcoded?
Cutch
2016/02/11 19:34:32
Done.
|
+ # 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/tools/gypi_to_gn.py", |
zra
2016/02/11 18:58:37
ditto
Cutch
2016/02/11 19:34:33
Done.
|
+ [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}}" ] |
+ } |
+} |