work

package
v0.7.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Copyright 2020 The GoPlus Authors (goplus.org)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 The GoPlus Authors (goplus.org)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 The GoPlus Authors (goplus.org)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenGo

func GenGo(dir, toDir string) error

Types

type Build

type Build struct {
	Pkgs          ast.Package // Pkg list parsed from "go list -json ./..." command
	NewGOPATH     string      // the new GOPATH
	OriGOPATH     string      // the original GOPATH
	WorkingDir    string      // the working directory
	TmpDir        string      // the temporary directory to build the project
	TmpWorkingDir string      // the working directory in the temporary directory, which is corresponding to the current directory in the project directory
	Target        string      // the binary name that go build generate
	// keep compatible with go commands:
	// gop build [-o output] [-i] [build flags] [packages]
	// gop install [-i] [build flags] [packages]
	BuildFlags string // Build flags
	Packages   string // Packages that needs to build
}

Build is to describe the building/installing process of a gop build/install

func NewBuild

func NewBuild(buildflags string, args []string, workingDir string, outputDir string) (*Build, error)

NewBuild creates a Build struct which can build from gop temporary directory, and generate binary in current working directory

func NewInstall

func NewInstall(buildflags string, args []string, workingDir string) (*Build, error)

NewInstall creates a Build struct which can install from goc temporary directory

func (*Build) Build

func (b *Build) Build() error

Build calls 'go build' tool to do building

func (*Build) CreateTmpWorkingDir

func (b *Build) CreateTmpWorkingDir() error

CreateTmpWorkingDir moves the projects into a temporary directory

func (*Build) Install

func (b *Build) Install() error

Install use the 'go install' tool to install packages

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL