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

Unified Diff: tools/gn/bundle_file_rule.h

Issue 1752033002: Add "create_bundle" target in order to support bundle with gn. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn-bundle-data
Patch Set: Add unit tests, address comments, update docs and format with clang-format Created 4 years, 9 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/bundle_data.cc ('k') | tools/gn/bundle_file_rule.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/bundle_file_rule.h
diff --git a/tools/gn/bundle_file_rule.h b/tools/gn/bundle_file_rule.h
new file mode 100644
index 0000000000000000000000000000000000000000..3669cd26373e786ab45876a33c190f64ee2596a0
--- /dev/null
+++ b/tools/gn/bundle_file_rule.h
@@ -0,0 +1,43 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef TOOLS_GN_BUNDLE_FILE_RULE_H_
+#define TOOLS_GN_BUNDLE_FILE_RULE_H_
+
+#include <vector>
+
+#include "tools/gn/source_file.h"
+#include "tools/gn/substitution_pattern.h"
+
+class BundleData;
+class Settings;
+class SourceFile;
+class OutputFile;
+
+// BundleFileRule contains the information found in a "bundle_data" target.
+class BundleFileRule {
+ public:
+ BundleFileRule(const std::vector<SourceFile> sources,
+ const SubstitutionPattern& pattern);
+ ~BundleFileRule();
+
+ // Applies the substitution pattern to a source file, returning the result
+ // as either a SourceFile or an OutputFile.
+ SourceFile ApplyPatternToSource(const Settings* settings,
+ const BundleData& bundle_data,
+ const SourceFile& source_file) const;
+ OutputFile ApplyPatternToSourceAsOutputFile(
+ const Settings* settings,
+ const BundleData& bundle_data,
+ const SourceFile& source_file) const;
+
+ // Returns the list of SourceFiles.
+ const std::vector<SourceFile>& sources() const { return sources_; }
+
+ private:
+ std::vector<SourceFile> sources_;
+ SubstitutionPattern pattern_;
+};
+
+#endif // TOOLS_GN_BUNDLE_FILE_RULE_H_
« no previous file with comments | « tools/gn/bundle_data.cc ('k') | tools/gn/bundle_file_rule.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698