Nate Finch
31893b98f3
filter mageimport files
...
When calling mage import, we weren't prefiltering the list of go
files, so we'd get files with build tags and test files and such.
What we want is just the normal go files for building the library.
Using go list returns us that, so use that.
2020-01-13 23:45:52 -05:00
Siddhesh Poyarekar
1e0dbb82b6
Set GOARCH to amd64 for TestListMagefilesIgnoresRespectsGOOSArg ( #275 )
...
The TestListMagefilesIgnoresRespectsGOOSArg test tries to list go
files with a different GOOS arg by setting GOOS to windows on Linux
systems and vice versa. This test works fine on amd64, but breaks on
arm64 because a windows/arm64 pair is not available yet and as a
result, the `go list` command underlying the `Magefiles` function
fails.
Fix this problem by keeping GOARCH as amd64 so that the go list
command does not fail.
2020-01-13 14:53:11 -05:00
Arve Knudsen
e353334464
Add missing dependency to example Magefile ( #274 )
...
Add the missing dependency github.com/magefile/mage/sh to example Magefile.
2019-11-14 12:58:32 -05:00
Erik Berkun-Drevnig
9e2b3db4c4
Add RunVWith command ( #261 )
...
* Add RunVWith command
2019-10-03 16:59:45 -04:00
Hǎi-Liàng "Hal" Wáng
d6f8413e8c
enable detail/stack printing for the Go 2 proposal for error values ( #259 )
2019-09-12 15:57:38 -04:00
Nate Finch
1c36bf78a9
swallow error on no non-magefiles ( #265 )
...
* swallow error on no non-magefiles
This fixes #262 . go list will error out if there are no go files. So we ignore that specific error.
v1.9.0
2019-09-12 15:43:23 -04:00
Nate Finch
e1fda1a0ff
add MAGEFILE_HASHFAST that intentionally doesn't rerun go build ( #258 )
2019-07-18 12:55:27 -04:00
Mikhail Gusarov
05f8c9d751
Improve error message on wrong type of mg.Deps argument ( #240 ) ( #241 )
...
This change adds a location of mg.Deps invocation, shrinking the search space
from "all your build scripts" to "this particular mg.Deps invocation"
2019-07-17 23:56:08 -04:00
Nate Finch
d30a2cfe41
fix tests when running in module mode ( #257 )
...
* fix tests when running in module mode
* add 1.12.x explicitly to the travis build
2019-07-17 23:47:39 -04:00
James Bowes
9a6d7fe3be
Fix Debug() documentation ( #253 )
2019-07-01 22:56:01 -04:00
Justin Clift
5bc3a8ab86
If GOBIN is set when installing, prefer that over GOPATH ( #232 )
2019-04-05 06:47:45 -07:00
Mikhail Gusarov
8dce728c57
improve lowercasing of target names: YAMLGenerate -> yamlGenerate ( #225 )
...
Previously lowercasing caused awkwardly-looking yAMLGenerate and pC targets.
2019-03-14 09:23:16 -05:00
Kent Quirk
8c9aa25d55
Add expansion of envvars and a Glob function to target package ( #219 )
2019-03-13 22:00:42 -05:00
Ian Gann
00c8eff9b9
Pass MAGEFILE_GOCMD to compiled binary ( #210 )
...
Pass the `MAGEFILE_GOCMD` environment variable into the compiled binary
when running with `-gocmd` set.
Testing Done:
- Validated that running `mage -debug -gocmd <go-runtime> <target>`
properly sets the environment variable `MAGEFILE_GOCMD=<go-runtime>`
into the temporary binary.
- Validated that compiled magefiles will not persist the initial
`-gocmd` when executing - though this is still toggleable by providing
the environment variable manually.
fixes #208
2019-03-13 21:34:46 -05:00
Aaron Miller
158fd4c1ae
Typo seen when running mage ( #230 )
2019-03-07 11:22:02 -06:00
Jonas Michel
5dee1ad6ef
Close sh.Copy destination file descriptor ( #223 )
2019-01-24 12:52:26 -05:00
Jordan Taylor
8c70a98ec4
Fix git clone link for Go modules in README ( #218 )
2018-12-31 10:22:54 -05:00
Andrew Kroh
85b33f7bc8
Sort target list ( #212 )
...
When using the mage:import feature the target list (`mage -l`) will now be sorted.
2018-12-29 09:00:43 -05:00
Ian Gann
4d83845376
Fix documentation for GoCmdEnv ( #207 )
...
`GoCmdEnv` documentation was a copy of the verbose mode documentation
- this change specifies the intention of the `-gocmd` flag.
2018-12-12 18:47:29 -05:00
Miguel Angel
6b5776c141
Typo in sh.OutputWith documentation ( #206 )
2018-12-12 18:38:42 -05:00
Nate Finch
64997cad46
update readme
2018-12-11 23:05:55 -05:00
Nate Finch
aedfce64c1
fix one line imports as mage:imports ( #204 )
...
* fix one line imports as mage:imports
fixes #194
v1.8.0
2018-12-11 16:18:45 -05:00
Nate Finch
edea463951
refactor alias/default parsing to support imported packages and namespaces ( #203 )
...
fixes #192
2018-12-11 14:22:28 -05:00
Nate Finch
bddeffbd31
example magefile on main site page
2018-12-10 13:50:26 -05:00
Nate Finch
98264f3689
GOOS and GOARCH fixes ( #202 )
...
* GOOS and GOARCH fixes
this fixes #169 - mage now ignores GOOS and GOARCH in the environment
when building its own binaries. The exception is if you use -goos or -goarch
when running -compile.
2018-12-10 13:34:17 -05:00
Nate Finch
fe724d1caa
Compiled flags ( #201 )
...
* Add mage flags to the compiled mage binary (#180 )
Adding following flags:
* -v (verbose)
* -l (list)
* -h (help)
* -t (timeout)
fixes #180
2018-12-09 00:32:45 -05:00
Nate Finch
f89c4cb2c6
update readme
...
Adds install instructions for using modules, as well as adding the
new google group link. Fixes #200 .
2018-11-30 11:37:59 -05:00
Nate Finch
11d15918ff
dont use -tags=mage when doing mage:imports and compiling ( #189 )
...
fixes #188
v1.7.1
2018-10-17 13:03:14 -04:00
Nate Finch
0f9693c143
implement importing magefiles ( #187 )
...
implement mageimports
v1.7.0
2018-10-10 23:44:18 -04:00
Nate Finch
a7a8e067f4
Support namespace functions with aliases and defaults ( #183 )
...
* support namespace funcs as aliases and defaults
fixes #181
2018-09-25 23:46:37 -04:00
Nate Finch
eb66d62c43
badges ( #179 )
2018-09-23 23:32:13 -04:00
Nate Finch
1de6d88631
another badge
2018-09-23 09:37:41 -04:00
Nate Finch
d3c88d8b5b
another badge
2018-09-22 09:24:31 -04:00
Nate Finch
1acc1deeb0
another badge
2018-09-22 09:15:53 -04:00
Nate Finch
28a13b112d
another badge
2018-09-22 09:13:37 -04:00
Nate Finch
193b58b27b
badge3
2018-09-22 08:48:32 -04:00
Nate Finch
43c89660ec
badge2
2018-09-22 08:35:36 -04:00
Nate Finch
ddf6c425c7
badge
2018-09-22 08:30:09 -04:00
Nate Finch
a8460f7aa9
Ensure we print an error if running the compiled magefile fails ( #171 )
...
* print an error if one comes back from running compiled binary
* rework the code a little bit and make sure mage -version prints to stdout
* export CmdRan and use it so we only log an error of not being able to run the magefile
v1.6.2
2018-09-21 07:31:15 -04:00
Nate Finch
39f09edf38
actually parse the MAGEFILE_VERBOSE flag ( #175 )
...
* actually parse the verbose flag in case someone sets it to 0
2018-09-21 00:03:57 -04:00
Nate Finch
821dc3d6dc
fix serial deps ( #177 )
2018-09-20 23:41:57 -04:00
Rene Zbinden
1426fb6b97
fix error handling when failing to list magefiles ( #174 )
2018-09-20 11:14:03 -04:00
Nate Finch
8c5bce8a20
Don't cache mainfiles, just set modtime ( #173 )
...
Remove caching of mainfiles, instead just recreate it each time and set the modtime to be old. This fixes a problem where we can't move the file to a different drive (seen in #172 )
v1.6.1
2018-09-19 19:31:37 -04:00
Nate Finch
4a8104737c
fix some code blocks
v1.6.0
2018-09-18 23:35:48 -04:00
Nate Finch
a9a0e40d28
Rely on GOCACHE rather than our own hashing mechanism ( #168 )
...
use gocache and add some debug timing logs
2018-09-18 23:05:49 -04:00
Nate Finch
f0ff90fe6c
MAGEFILE_IGNOREDEFAULT flag ( #167 )
...
* implement ignore default environment variable
v1.5.0
2018-09-16 22:44:37 -04:00
Nate Finch
84e9ed0aea
make sure we test that the returned interface is non-nil before converting to error ( #166 )
2018-09-16 22:01:04 -04:00
Nate Finch
87fe26a399
Ensure dep error propagation ( #164 )
...
If you had a tree of deps and the same dep was called from two different branches... it only gets called once. That works, but the error wasn't getting propagated to the other branch, so it wouldn't stop execution. Now it does.
2018-09-16 09:22:23 -04:00
Nate Finch
c7b4ff9e70
add code so mg.Deps understands namespaces ( #163 )
...
* add code so mg.Deps understands namespaces
* unexport all the functype stuff
2018-09-15 23:32:08 -04:00
Gil Raphaelli
832a425b45
consider missing cache dir cleaned ( #162 )
...
consider missing cache dir cleaned
2018-09-14 22:19:31 -04:00