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

Unified Diff: tools/gn/target.h

Issue 524623005: Add testonly flag to GN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 | « tools/gn/substitution_writer_unittest.cc ('k') | tools/gn/target.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/target.h
diff --git a/tools/gn/target.h b/tools/gn/target.h
index 9b7ff6d10201778c13e88dbe0b4c14bd1f0d4775..19cb49284778af1c60f0a36847549068c7e9fe45 100644
--- a/tools/gn/target.h
+++ b/tools/gn/target.h
@@ -53,7 +53,7 @@ class Target : public Item {
// Item overrides.
virtual Target* AsTarget() OVERRIDE;
virtual const Target* AsTarget() const OVERRIDE;
- virtual void OnResolved() OVERRIDE;
+ virtual bool OnResolved(Err* err) OVERRIDE;
OutputType output_type() const { return output_type_; }
void set_output_type(OutputType t) { output_type_ = t; }
@@ -91,6 +91,9 @@ class Target : public Item {
const FileList& public_headers() const { return public_headers_; }
FileList& public_headers() { return public_headers_; }
+ bool testonly() const { return testonly_; }
+ void set_testonly(bool value) { testonly_ = value; }
+
// Compile-time extra dependencies.
const FileList& inputs() const { return inputs_; }
FileList& inputs() { return inputs_; }
@@ -198,6 +201,8 @@ class Target : public Item {
}
private:
+ void ExpandGroups();
+
// Pulls necessary information from dependencies to this one when all
// dependencies have been resolved.
void PullDependentTargetInfo();
@@ -210,6 +215,10 @@ class Target : public Item {
// Fills the link and dependency output files when a target is resolved.
void FillOutputFiles();
+ // Validates the given thing when a target is resolved.
+ bool CheckVisibility(Err* err) const;
+ bool CheckTestonly(Err* err) const;
+
OutputType output_type_;
std::string output_name_;
std::string output_extension_;
@@ -217,6 +226,7 @@ class Target : public Item {
FileList sources_;
bool all_headers_public_;
FileList public_headers_;
+ bool testonly_;
FileList inputs_;
FileList data_;
« no previous file with comments | « tools/gn/substitution_writer_unittest.cc ('k') | tools/gn/target.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698