• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3# found in the LICENSE file.
4
5
6from recipe_engine import recipe_api
7
8
9INFRA_GO_PKG = 'go.skia.org/infra'
10UPDATE_GO_ATTEMPTS = 5
11UPLOAD_ATTEMPTS = 5
12
13
14class InfraApi(recipe_api.RecipeApi):
15  @property
16  def goroot(self):
17    return self.m.vars.workdir.join('go', 'go')
18
19  @property
20  def go_bin(self):
21    return self.goroot.join('bin')
22
23  @property
24  def go_env(self):
25    return {
26        'GOCACHE': self.m.vars.cache_dir.join('go_cache'),
27        'GOPATH': self.gopath,
28        'GOROOT': self.goroot,
29        'PATH': self.m.path.pathsep.join([
30            str(self.go_bin), str(self.gopath.join('bin')), '%(PATH)s']),
31    }
32
33  @property
34  def gopath(self):
35    return self.m.vars.cache_dir.join('gopath')
36