OLD | NEW |
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 package local | 5 package local |
6 | 6 |
7 import ( | 7 import ( |
8 "archive/zip" | 8 "archive/zip" |
9 "bytes" | 9 "bytes" |
10 "fmt" | 10 "fmt" |
11 "io" | 11 "io" |
12 "io/ioutil" | 12 "io/ioutil" |
13 "os" | 13 "os" |
14 "strings" | 14 "strings" |
15 "time" | 15 "time" |
16 | 16 |
17 » "infra/libs/logging" | 17 » "github.com/luci/luci-go/common/logging" |
| 18 |
18 "infra/tools/cipd/common" | 19 "infra/tools/cipd/common" |
19 ) | 20 ) |
20 | 21 |
21 // BuildInstanceOptions defines options for BuildInstance function. | 22 // BuildInstanceOptions defines options for BuildInstance function. |
22 type BuildInstanceOptions struct { | 23 type BuildInstanceOptions struct { |
23 // List of files to add to the package. | 24 // List of files to add to the package. |
24 Input []File | 25 Input []File |
25 // Where to write the package file to. | 26 // Where to write the package file to. |
26 Output io.Writer | 27 Output io.Writer |
27 // Package name, e.g. 'infra/tools/cipd'. | 28 // Package name, e.g. 'infra/tools/cipd'. |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 err := writeManifest(&Manifest{ | 174 err := writeManifest(&Manifest{ |
174 FormatVersion: manifestFormatVersion, | 175 FormatVersion: manifestFormatVersion, |
175 PackageName: opts.PackageName, | 176 PackageName: opts.PackageName, |
176 }, buf) | 177 }, buf) |
177 if err != nil { | 178 if err != nil { |
178 return nil, err | 179 return nil, err |
179 } | 180 } |
180 out := manifestFile(buf.Bytes()) | 181 out := manifestFile(buf.Bytes()) |
181 return &out, nil | 182 return &out, nil |
182 } | 183 } |
OLD | NEW |