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

Unified Diff: mojo/public/dart/rules.gni

Issue 1259873002: Dart: Runs dartanalyzer for the dart_pkg build rule. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 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
Index: mojo/public/dart/rules.gni
diff --git a/mojo/public/dart/rules.gni b/mojo/public/dart/rules.gni
index d4adbb1ef6dc39f08eaaf3940dd0c7b1a28a16b0..8b06039aca7f3904c837c22c7dd17d1d407c30be 100644
--- a/mojo/public/dart/rules.gni
+++ b/mojo/public/dart/rules.gni
@@ -6,7 +6,9 @@
# Rules to generate dart-pkg and dart-pkg/packages.
import("//build/module_args/mojo.gni")
+import("//build/module_args/dart.gni")
+# Creates a dartzip package.
template("dartzip_package") {
package_target_name = "$target_name"
package_output = "$target_out_dir/$target_name.dartzip"
@@ -113,7 +115,11 @@ template("dartzip_package") {
]
args = [
+ "--dart-sdk",
+ rebase_path(dart_sdk_root),
+ "--dartzip-file",
rebase_path(package_output),
+ "--stamp-file",
rebase_path("$target_gen_dir/${package_target_name}_analyze.stamp"),
"--no-hints",
]
@@ -210,14 +216,20 @@ template("dartzip_packaged_application") {
# Creates a gen/dart-pkg/package_name directory containing symlinks to package
# sources. Also copies any mojom dependencies into lib/mojom.
#
+# entrypoints (optional)
Cutch 2015/07/27 22:13:58 If this is optional it should go below.
zra 2015/07/27 22:46:49 Done.
+# List of package entrypoints to pass to the analyzer. If no entry points
+# are defined, the analyzer is not run.
+#
# sources
-# List of sources to include in the package.
+# List of other sources to include in the package.
#
# pkg_dir (optional)
-# Directory containing the package sources. This overrides sources.
+# Directory containing the package sources. This overrides sources and
+# entrypoints. The analyzer will not be run.
#
# deps (optional)
-# Note: this can only contain mojom targets.
+# List of other dart_pkg targets for Dart packages imported by this
+# dart_pkg, as well as the mojom targets needed by this dart_pkg.
#
# datadeps (optional)
#
@@ -299,17 +311,23 @@ template("dart_pkg") {
stamp_file,
]
+ entrypoints = []
+ if (defined(invoker.entrypoints)) {
+ entrypoints += invoker.entrypoints
+ }
+
+ sources = []
if (defined(invoker.sources)) {
- sources = invoker.sources
+ sources += invoker.sources
} else {
assert(defined(invoker.pkg_dir))
list_script = rebase_path("build/ls.py", ".", mojo_sdk_root)
- sources = exec_script(list_script,
- [
- "--target-directory",
- rebase_path(invoker.pkg_dir),
- ],
- "list lines")
+ sources += exec_script(list_script,
+ [
+ "--target-directory",
+ rebase_path(invoker.pkg_dir),
+ ],
+ "list lines")
}
inputs = [
@@ -320,6 +338,8 @@ template("dart_pkg") {
args = [
"--package-name",
package_name,
+ "--dart-sdk",
+ rebase_path(dart_sdk_root),
"--gen-directory",
rebase_path("$root_gen_dir/dart-gen"),
"--pkg-directory",
@@ -329,7 +349,8 @@ template("dart_pkg") {
"--stamp-file",
rebase_path(stamp_file),
"--package-sources",
- ] + rebase_path(sources) + [ "--mojom-sources" ] +
+ ] + rebase_path(sources) + [ "--package-entrypoints" ] +
+ rebase_path(entrypoints) + [ "--mojom-sources" ] +
rebase_path(mojom_sources, "", mojo_sdk_root) +
[ "--sdk-ext-directories" ] + rebase_path(sdk_ext_directory) +
[ "--sdk-ext-files" ] + rebase_path(sdk_ext_files) +

Powered by Google App Engine
This is Rietveld 408576698