Skip to content

@natefinch natefinch released this Dec 29, 2020

Changelog

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)

Assets 14

@natefinch natefinch released this Jul 8, 2020

Changelog

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)

Assets 20

@natefinch natefinch released this Sep 13, 2019

Changelog

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 mage (#230)
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 GoCmdEnv (#207)
6b5776c Typo in sh.OutputWith documentation (#206)
64997ca update readme

Assets 20

@natefinch natefinch released this Dec 12, 2018

Details

Several nice to have fixes that have been waiting for some TLC. The important ones:

  • Binaries compiled with -compile now have support for all the applicable flags from Mage itself, so for example you can do <your binary> -l to 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 build and 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 -compile and create a binary for a different platform, use the -goos and -goarch flags.

Changelog

fix one line imports as mage:imports (#204)
refactor alias/default parsing to support imported packages and namespaces (#203)
GOOS and GOARCH fixes (#202)
Compiled flags (#201)

Assets 20

@natefinch natefinch released this Oct 17, 2018

Bug Fix

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.

Changelog

11d1591 dont use -tags=mage when doing mage:imports and compiling (#189)

Assets 20

@natefinch natefinch released this Oct 11, 2018

Mage:Import

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.

Changelog

0f9693c implement importing magefiles (#187)
a7a8e06 Support namespace functions with aliases and defaults (#183)
eb66d62 badges (#179)

Assets 20

@natefinch natefinch released this Sep 21, 2018

Fixes

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).

Changelog

Ensure we print an error if running the compiled magefile fails (#171)
actually parse the MAGEFILE_VERBOSE flag (#175)
fix serial deps (#177)
fix error handling when failing to list magefiles (#174)

Assets 20

@natefinch natefinch released this Sep 20, 2018

Fixed

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.

Changelog

Don't cache mainfiles, just set modtime (#173)

Assets 20

@natefinch natefinch released this Sep 19, 2018

New Features

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.

Changelog

Rely on GOCACHE rather than our own hashing mechanism (#168)

Assets 20

@natefinch natefinch released this Sep 17, 2018

v1.5.0 Changelog

New Features

MAGEFILE_IGNOREDEFAULT flag (#167)
Add -d flag to set the working directory (#159)

Library Changes

Add sh.Copy (#130)

Bug Fixes

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)

Assets 20