07afc7d update release pipeline slightly (#327)
aba3950 I guess arguments work now (#326)
3730191 target: rework modtime comparison logic #323 (#324)
2ded30c Add -ldflags flag (#322)
50f568e get mage tests to pass on windows (#312)
707b7bd update the WorkDir (-w) flag to default to the Dir (-d) value as documented (#310)
9a10961 #285 add color output for mage list (#301)
310e198 update home page with a better example (#293)
cb825cb Ensure MAGEFILE_VERBOSE set in compiled magefile (#300)
7747d7c add copyright to license (#299)
8a5905f Improve error message for failed imports (#298)
fd985b9 update install docs on site for #229 (#292)
6076b08 Mage Code of Conduct (#284)
5d10b67 Set magefiles working directory (#277)
0c7e3de filter mageimport files (#281)
1e0dbb8 Set GOARCH to amd64 for TestListMagefilesIgnoresRespectsGOOSArg (#275)
e353334 Add missing dependency to example Magefile (#274)
9e2b3db Add RunVWith command (#261)
d6f8413 enable detail/stack printing for the Go 2 proposal for error values (#259)
1c36bf7 swallow error on no non-magefiles (#265)
e1fda1a add MAGEFILE_HASHFAST that intentionally doesn't rerun go build (#258)
05f8c9d Improve error message on wrong type of mg.Deps argument (#240) (#241)
d30a2cf fix tests when running in module mode (#257)
9a6d7fe Fix Debug() documentation (#253)
5bc3a8a If GOBIN is set when installing, prefer that over GOPATH (#232)
8dce728 improve lowercasing of target names: YAMLGenerate -> yamlGenerate (#225)
8c9aa25 Add expansion of envvars and a Glob function to target package (#219)
00c8eff Pass MAGEFILE_GOCMD to compiled binary (#210)
158fd4c Typo seen when running
5dee1ad Close sh.Copy destination file descriptor (#223)
8c70a98 Fix git clone link for Go modules in README (#218)
85b33f7 Sort target list (#212)
4d83845 Fix documentation for
6b5776c Typo in sh.OutputWith documentation (#206)
64997ca update readme
Several nice to have fixes that have been waiting for some TLC. The important ones:
- Binaries compiled with
-compilenow have support for all the applicable flags from Mage itself, so for example you can do
<your binary> -lto list the targets. see https://magefile.org/compiling/ for full details.
- Specifying GOOS and GOARCH now won't confuse mage. Previously if you attempted to use mage to run
go buildand specified a different GOOS or GOARCH in your environment variables, those environment variables would change the binary that mage builds out of your magefile, and generally made it not executable on your system. Now that won't happen. To run
-compileand create a binary for a different platform, use the
This fixes #188 - if you had mixed magefiles in with non-magefiles and then tried to import the magefiles... everything broke. This puts the behavior back to what it was previous to 1.7.0, where we did not set build the magefile itself with the mage build flag.
The big feature for this release is mage imports. You can now import targets from another package into another magefile. This is a huge benefit for anyone that wants to reuse common targets, like gofmt etc.
The big thing in this release is fixing mg.SerialDeps, which was broken in v1.6.0 (and now has tests ro prevent that from happening again).
PR #172 brought up a problem with systems where the magefile cachedir is on a different drive. On these machines, trying to move the generated mainfile fails because it's not a simple rename, you have to copy the data. However, this defeats the purpose of moving the mainfile, which was just to retain the modtime so the go tool wouldn't think it was newer than the compiled binary.
Upon more reflection the obvious thing to do is just to generate the mainfile tweak its mod time to be old. That's what this change does, which greatly simplifies that code, and fixes the bug.
Don't cache mainfiles, just set modtime (#173)
If you're running go 1.10 or above, Mage now use the go tool's built-in GOCACHE to determine whether or not to rebuild the binary it runs. This results in a ~100ms slower run time for small magefiles, but it removes the problem where if you change some library your magefile depends on, mage wouldn't realize it and wouldn't rebuild the binary, and thus you'd be running the old (unchanged) code.
Since go 1.9 and below don't have a GOCACHE, we maintain our (somewhat flawed) caching mechanism in those cases.
Note that this depends on the go command that mage uses to compile your magefiles, not the go command used to build mage itself.
Rely on GOCACHE rather than our own hashing mechanism (#168)
Add sh.Copy (#130)
make sure we test that the returned interface is non-nil before converting to error (#166)
Ensure dep error propagation (#164)
add code so mg.Deps understands namespaces (#163)
consider missing cache dir cleaned (#162)