1
0
mirror of https://github.com/golang/go synced 2024-10-04 14:41:25 -06:00
go/src
Russ Cox ebe1664d27 go/build: replace FindTree, ScanDir, Tree, DirInfo with Import, Package
This is an API change, but one I have been promising would
happen when it was clear what the go command needed.

This is basically a complete replacement of what used to be here.

build.Tree is gone.

build.DirInfo is expanded and now called build.Package.

build.FindTree is now build.Import(package, srcDir, build.FindOnly).
The returned *Package contains information that FindTree returned,
but applicable only to a single package.

build.ScanDir is now build.ImportDir.

build.FindTree+build.ScanDir is now build.Import.

The new Import API allows specifying the source directory,
in order to resolve local imports (import "./foo") and also allows
scanning of packages outside of $GOPATH.  They will come back
with less information in the Package, but they will still work.

The old go/build API exposed both too much and too little.
This API is much closer to what the go command needs,
and it works well enough in the other places where it is
used.  Path is gone, so it can no longer be misused.  (Fixes issue 2749.)

This CL updates clients of go/build other than the go command.
The go command changes are in a separate CL, to be submitted
at the same time.

R=golang-dev, r, alex.brainman, adg
CC=golang-dev
https://golang.org/cl/5713043
2012-03-01 12:12:09 -05:00
..
cmd go/build: replace FindTree, ScanDir, Tree, DirInfo with Import, Package 2012-03-01 12:12:09 -05:00
lib9 build: delete make paraphernalia 2012-02-06 13:34:25 -05:00
libbio build: delete make paraphernalia 2012-02-06 13:34:25 -05:00
libmach runtime/pprof: support OS X CPU profiling 2012-02-28 16:18:24 -05:00
pkg go/build: replace FindTree, ScanDir, Tree, DirInfo with Import, Package 2012-03-01 12:12:09 -05:00
all.bash cmd/dist: cross-compiling fixes 2012-02-13 22:31:51 -05:00
all.bat build: use setlocal in run.bat 2012-02-16 10:44:55 +11:00
clean.bash build: fix clean.bash 2012-02-15 23:52:07 +09:00
clean.bat build: implement clean.bat 2012-02-20 12:17:27 +11:00
make.bash build: add make.bash --no-clean option 2012-02-15 11:48:17 -05:00
make.bat make.bat, run.bat: echo newlines 2012-02-16 20:49:50 +00:00
Make.dist cmd/dist: make 'make' quieter for developers 2012-02-08 15:26:47 -05:00
run.bash cmd/dist: cross-compiling fixes 2012-02-13 22:31:51 -05:00
run.bat make.bat, run.bat: echo newlines 2012-02-16 20:49:50 +00:00
sudo.bash build: fix sudo.bash. 2012-02-15 08:42:16 +11:00