예제 #1
0
파일: build.go 프로젝트: ches/gb
For more about specifying packages, see 'gb help packages'. For more about where packages and binaries are installed, run 'gb help project'.`,
	Run: func(ctx *gb.Context, args []string) error {
		// TODO(dfc) run should take a *gb.Context not a *gb.Project
		ctx.Force = F
		ctx.SkipInstall = FF

		pkgs, err := cmd.ResolvePackages(ctx, args...)
		if err != nil {
			return err
		}

		build, err := gb.BuildPackages(pkgs...)
		if err != nil {
			return err
		}

		if dotfile != "" {
			f, err := os.Create(dotfile)
			if err != nil {
				return err
			}
			defer f.Close()
			printActions(f, build)
		}

		return gb.ExecuteConcurrent(build, P)
	},
	AddFlags: addBuildFlags,
}
예제 #2
0
파일: test.go 프로젝트: torfuzx/gb
		test, err := test.TestPackages(TestFlags(tfs), pkgs...)
		if err != nil {
			return err
		}

		if dotfile != "" {
			f, err := os.Create(dotfile)
			if err != nil {
				return err
			}
			defer f.Close()
			printActions(f, test)
		}

		startSigHandlers()
		return gb.ExecuteConcurrent(test, P, interrupted)
	},
	AddFlags: addTestFlags,
	FlagParse: func(flags *flag.FlagSet, args []string) error {
		var err error
		debug.Debugf("%s", args)
		args, tfs, err = TestFlagsExtraParse(args[2:])
		debug.Debugf("%s %s", args, tfs)
		if err != nil {
			fmt.Fprintf(os.Stderr, "gb test: %s\n", err)
			fmt.Fprintf(os.Stderr, `run "go help test" or "go help testflag" for more information`+"\n")
			exit(2)
		}
		return flags.Parse(args)
	},
}
예제 #3
0
파일: build.go 프로젝트: tompao/gb
`,
	Run: func(ctx *gb.Context, args []string) error {
		// TODO(dfc) run should take a *gb.Context not a *gb.Project
		ctx.Force = F
		ctx.Install = !FF

		pkgs, err := resolvePackages(ctx, args...)
		if err != nil {
			return err
		}

		build, err := gb.BuildPackages(pkgs...)
		if err != nil {
			return err
		}

		if dotfile != "" {
			f, err := os.Create(dotfile)
			if err != nil {
				return err
			}
			defer f.Close()
			printActions(f, build)
		}

		startSigHandlers()
		return gb.ExecuteConcurrent(build, P, interrupted)
	},
	AddFlags: addBuildFlags,
}
예제 #4
0
파일: test.go 프로젝트: kalafut/gb
		}

		test, err := test.TestPackages(TestFlags(tfs), pkgs...)
		if err != nil {
			return err
		}

		if dotfile != "" {
			f, err := os.Create(dotfile)
			if err != nil {
				return err
			}
			defer f.Close()
			printActions(f, test)
		}

		return gb.ExecuteConcurrent(test, P)
	},
	AddFlags: addTestFlags,
	FlagParse: func(flags *flag.FlagSet, args []string) error {
		var err error
		args, tfs, err = TestFlagsExtraParse(args[2:])
		if err != nil {
			fmt.Fprintf(os.Stderr, "gb test: %s\n", err)
			fmt.Fprintf(os.Stderr, `run "go help test" or "go help testflag" for more information`+"\n")
			os.Exit(2)
		}
		return flags.Parse(args)
	},
}