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

Side by Side Diff: mojom/generators/common/common.go

Issue 1930603004: mojom: move mojom/mojom_tool/generated -> mojom/generated. Update consumers (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix paths to new `generated/` in mojom_tool/BUILD.gn Created 4 years, 7 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
« no previous file with comments | « mojom/generators/common/cli.go ('k') | mojom/mojom_tool/BUILD.gn » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 package common 5 package common
6 6
7 import ( 7 import (
8 » "mojom/mojom_tool/generated/mojom_files" 8 » "mojom/generated/mojom_files"
9 ) 9 )
10 10
11 // common groups together functions which make it easier for generators 11 // common groups together functions which make it easier for generators
12 // implemented in go to implement the same interface. 12 // implemented in go to implement the same interface.
13 13
14 // GeneratorConfig is used to specify configuration for a generator. 14 // GeneratorConfig is used to specify configuration for a generator.
15 type GeneratorConfig interface { 15 type GeneratorConfig interface {
16 // FileGraph returns a parsed MojomFileGraph. 16 // FileGraph returns a parsed MojomFileGraph.
17 FileGraph() *mojom_files.MojomFileGraph 17 FileGraph() *mojom_files.MojomFileGraph
18 18
(...skipping 29 matching lines...) Expand all
48 // GenerateOutput iterates through the files in the file graph in |config| and 48 // GenerateOutput iterates through the files in the file graph in |config| and
49 // for all the files for which an output should be generated, it uses 49 // for all the files for which an output should be generated, it uses
50 // writeOutput to write the generated output. 50 // writeOutput to write the generated output.
51 func GenerateOutput(writeOutput writeOutput, config GeneratorConfig) { 51 func GenerateOutput(writeOutput writeOutput, config GeneratorConfig) {
52 for fileName, file := range config.FileGraph().Files { 52 for fileName, file := range config.FileGraph().Files {
53 if config.GenImports() || *file.SpecifiedFileName != "" { 53 if config.GenImports() || *file.SpecifiedFileName != "" {
54 writeOutput(fileName, config) 54 writeOutput(fileName, config)
55 } 55 }
56 } 56 }
57 } 57 }
OLDNEW
« no previous file with comments | « mojom/generators/common/cli.go ('k') | mojom/mojom_tool/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698