gex

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2018 License: MIT Imports: 12 Imported by: 3

README

gex

Build Status GoDoc Go project version Go Report Card License

The implementation of clarify best practice for tool dependencies.

See https://github.com/golang/go/issues/25922#issuecomment-412992431

Features

  • Manage versions of tools dependencies, and build them with specified version
  • Does not introduce new mechanisms to manage tool dependencies
  • Only 2 commands that you use: --add and --build

Usage

gex --add [packages...]

Add a new tool to dependencies:

$ gex --add github.com/golang/mock/mockgen

The tool will be managed in tools.go and its version will be managed by Modules or dep.

$ cat tools.go
// Code generated by github.com/izumin5210/gex. DO NOT EDIT.

// +build tools

package tools

// tool dependencies
import (
        _ "github.com/golang/mock/mockgen"
)

$ cat go.mod | grep mock
        github.com/golang/mock v1.1.1 // indirect
gex --build

Build executable binaries into $PWD/bin.

$ gex --build
gex [command] [args...]

Execute command that managed in tools.go and go.mod. gex will build the executable binary automatically if needed.

$ gex mockgen
# prints mockgen's help text...

Installation

To install gex, you can use go get.

$ go get github.com/izumin5210/gex/cmd/gex

Requirements

gex depends on dep or Modules to manage tool dependencies,

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = createDefaultConfig()

Default contains default configuration.

Functions

This section is empty.

Types

type Config

type Config struct {
	OutWriter io.Writer
	ErrWriter io.Writer
	InReader  io.Reader

	FS     afero.Fs
	Execer exec.Interface

	WorkingDir   string
	RootDir      string
	ManifestName string
	BinDirName   string
	Mode         Mode

	Verbose bool
	Logger  *log.Logger
}

Config specifies the configration for managing development tools.

func (*Config) Create

func (c *Config) Create() (tool.Repository, error)

Create creates a new instance of tool.Repository to manage developemnt tools.

func (*Config) DetectMode

func (c *Config) DetectMode()

DetectMode detects a current Mode and sets a root directory.

type Mode

type Mode int

Mode represents the dependencies management tool that is used.

const (
	ModeUnknown Mode = iota
	ModeModules
	ModeDep
)

Mode values

Directories

Path Synopsis
cmd
gex
pkg
tests
e2e Module

Jump to

Keyboard shortcuts

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