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

Side by Side Diff: tools/gn/substitution_writer.h

Issue 461153002: Fix GN action target writing with no sources list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/gn/ninja_action_target_writer_unittest.cc ('k') | tools/gn/substitution_writer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef TOOLS_GN_SUBSTITUTION_WRITER_H_ 5 #ifndef TOOLS_GN_SUBSTITUTION_WRITER_H_
6 #define TOOLS_GN_SUBSTITUTION_WRITER_H_ 6 #define TOOLS_GN_SUBSTITUTION_WRITER_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 15 matching lines...) Expand all
26 class SubstitutionWriter { 26 class SubstitutionWriter {
27 public: 27 public:
28 enum OutputStyle { 28 enum OutputStyle {
29 OUTPUT_ABSOLUTE, // Dirs will be absolute "//foo/bar". 29 OUTPUT_ABSOLUTE, // Dirs will be absolute "//foo/bar".
30 OUTPUT_RELATIVE, // Dirs will be relative to a given directory. 30 OUTPUT_RELATIVE, // Dirs will be relative to a given directory.
31 }; 31 };
32 32
33 SubstitutionWriter(); 33 SubstitutionWriter();
34 ~SubstitutionWriter(); 34 ~SubstitutionWriter();
35 35
36 // Converts the given SubstitutionList to OutputFiles assuming there are
37 // no substitutions (it will assert if there are). This is used for cases
38 // like actions where the outputs are explicit, but the list is stored as
39 // a SubstitutionList.
40 static void GetListAsSourceFiles(
41 const Settings* settings,
42 const SubstitutionList& list,
43 std::vector<SourceFile>* output);
44 static void GetListAsOutputFiles(
45 const Settings* settings,
46 const SubstitutionList& list,
47 std::vector<OutputFile>* output);
48
36 // Applies the substitution pattern to a source file, returning the result 49 // Applies the substitution pattern to a source file, returning the result
37 // as either a SourceFile or OutputFile. 50 // as either a SourceFile or OutputFile.
38 static SourceFile ApplyPatternToSource( 51 static SourceFile ApplyPatternToSource(
39 const Settings* settings, 52 const Settings* settings,
40 const SubstitutionPattern& pattern, 53 const SubstitutionPattern& pattern,
41 const SourceFile& source); 54 const SourceFile& source);
42 static OutputFile ApplyPatternToSourceAsOutputFile( 55 static OutputFile ApplyPatternToSourceAsOutputFile(
43 const Settings* settings, 56 const Settings* settings,
44 const SubstitutionPattern& pattern, 57 const SubstitutionPattern& pattern,
45 const SourceFile& source); 58 const SourceFile& source);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 // to, otherwise it is ignored. 111 // to, otherwise it is ignored.
99 static std::string GetSourceSubstitution( 112 static std::string GetSourceSubstitution(
100 const Settings* settings, 113 const Settings* settings,
101 const SourceFile& source, 114 const SourceFile& source,
102 SubstitutionType type, 115 SubstitutionType type,
103 OutputStyle output_style, 116 OutputStyle output_style,
104 const SourceDir& relative_to); 117 const SourceDir& relative_to);
105 }; 118 };
106 119
107 #endif // TOOLS_GN_SUBSTITUTION_WRITER_H_ 120 #endif // TOOLS_GN_SUBSTITUTION_WRITER_H_
OLDNEW
« no previous file with comments | « tools/gn/ninja_action_target_writer_unittest.cc ('k') | tools/gn/substitution_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698