Flutter Engine
The Flutter Engine
Functions | Variables
tools.infra.go Namespace Reference

Functions

def check ()
 
def get (pkg)
 
def update_infra ()
 
def mod_download (*pkgs)
 
def install (pkg)
 

Variables

string INFRA_GO = 'go.skia.org/infra'
 
string WHICH = 'win32' else 'which'
 

Function Documentation

◆ check()

def tools.infra.go.check ( )
Verify that golang is properly installed. If not, exit with an error.

Definition at line 18 of file go.py.

18def check():
19 '''Verify that golang is properly installed. If not, exit with an error.'''
20 def _fail(msg):
21 print >> sys.stderr, msg
22 sys.exit(1)
23
24 try:
25 go_exe = subprocess.check_output([WHICH, 'go'])
26 except (subprocess.CalledProcessError, OSError):
27 go_exe = None
28 if not go_exe:
29 _fail('Unable to find Golang installation; see '
30 'https://golang.org/doc/install')
31 if not os.environ.get('GOPATH'):
32 _fail('GOPATH environment variable is not set; is Golang properly '
33 'installed?')
34 go_bin = os.path.join(os.environ['GOPATH'], 'bin')
35 for entry in os.environ.get('PATH', '').split(os.pathsep):
36 if entry == go_bin:
37 break
38 else:
39 _fail('%s not in PATH; is Golang properly installed?' % go_bin)
40
41
def check()
Definition: go.py:18

◆ get()

def tools.infra.go.get (   pkg)
Obtain/update the given package/module via "go get".

Definition at line 42 of file go.py.

42def get(pkg):
43 '''Obtain/update the given package/module via "go get".'''
44 check()
45 subprocess.check_call(['go', 'get', '-u', pkg])
46
47
def get(pkg)
Definition: go.py:42

◆ install()

def tools.infra.go.install (   pkg)
"go install" the given package.

Definition at line 59 of file go.py.

59def install(pkg):
60 '''"go install" the given package.'''
61 check()
62 subprocess.check_call(['go', 'install', pkg])
static bool install(SkBitmap *bm, const SkImageInfo &info, const SkRasterHandleAllocator::Rec &rec)
Definition: SkCanvas.cpp:2856

◆ mod_download()

def tools.infra.go.mod_download ( pkgs)
Run "go mod download" to obtain the given package(s).

Definition at line 53 of file go.py.

53def mod_download(*pkgs):
54 '''Run "go mod download" to obtain the given package(s).'''
55 check()
56 subprocess.check_call(['go', 'mod', 'download']+list(pkgs))
57
58
def mod_download(*pkgs)
Definition: go.py:53

◆ update_infra()

def tools.infra.go.update_infra ( )
Update the local checkout of the Skia infra codebase.

Definition at line 48 of file go.py.

48def update_infra():
49 '''Update the local checkout of the Skia infra codebase.'''
50 get(INFRA_GO + '/...')
51
52
def update_infra()
Definition: go.py:48

Variable Documentation

◆ INFRA_GO

string tools.infra.go.INFRA_GO = 'go.skia.org/infra'

Definition at line 14 of file go.py.

◆ WHICH

string tools.infra.go.WHICH = 'win32' else 'which'

Definition at line 15 of file go.py.