Commit graph

13 commits

Author SHA1 Message Date
WeidiDeng
bff687835e
add ".exe" when cross compiling for windows (#179)
* add ".exe" when cross compiling for windows

* add ".exe" when cross compiling for windows or on windows without cross-compiling

* wait until 1.23 is released
2024-05-06 20:38:01 +03:00
Mohammed Al Sahaf
2887af6a01
feat: allow fs embedding with --embed (#160)
* feat: allow fs embedding with `--embed`

* code review

* remove utils/io.go

* don't shadow `err`

* add syntax and examples to README
2023-12-18 13:22:47 -07:00
Francis Lavoie
661655cf05
Add support for setcap from build command (#129) 2023-02-06 13:26:33 -05:00
Matthew Holt
e09becb9d1
Ignore vendor folder with mod=readonly 2022-09-30 11:26:05 -06:00
Matthew Holt
e4c5f53dd2 Don't include version in replacement source
Follow-up to #69

I had a situation where caddy/v2 v2.4.6 was in my go.mod and a replace
on it to use local caddy repo.

When I ran `xcaddy run` to test a caddy module, it failed to run because
the replace included the version v2.4.6, even though somehow the buildenv
go.mod had v2.6.1 (the latest), and the replace directive specified
@v2.4.6 only, so the replacement didn't happen.

I don't think versions in the replacement source/origin are
really that useful for xcaddy.

If experience proves this wrong, we can figure out a better solution.
2022-09-28 10:25:41 -06:00
ydylla
25c412f1ec
Always prepend caddy command with dot (#117)
Fix xcaddy run on windows with go 1.19

See https://github.com/golang/go/issues/43724
2022-09-12 13:41:27 -06:00
Mohammed Al Sahaf
e6eb334d4e
core: add XCADDY_GO_MOD_FLAGS env var to allow passing custom go mod flags (#113) 2022-08-16 21:27:48 +00:00
Matthew Holt
7577d60f61
Tolerate module file paths with @ in them
But version must also be specified to disambiguate.

Fix #109
2022-07-29 16:49:34 -06:00
Aapo Keskimölö
47f9ded5d8
Add XCADDY_GO_BUILD_FLAGS env var (#104)
Add environment variable

 XCADDY_GO_BUILD_FLAGS

to override default build arguments from environment (#102).

To support flags with variable arguments Unix-style quoting is supported.
2022-06-20 13:20:05 -06:00
Peter Magnusson
7abc7f5752
Do not use only hardcoded "go" (#97)
* fix: do not use only hardcoded "go"

* fixed comments and added env to readme

* move GetGo to an internal package

Co-authored-by: Mohammed Al Sahaf <msaa1990@gmail.com>
2022-04-25 10:13:12 -06:00
Mohammed Al Sahaf
996c8d9d08
fix: skip cleanup if build is skipped (#83) 2022-02-19 15:26:52 -07:00
Hyeon Kim (김지현)
3d8622df25
Handle replacements robustly (#69)
* Parse JSON output of 'go list'

It's more robust in this way

* Handle all possible replacements properly for runDev()

1.  Handle all possible replacements properly for runDev()

    Replacement targets are not always paths.

    Reference:
      https://pkg.go.dev/cmd/go/internal/list#pkg-variables

2.  Parse replacement info from 'go list -m -json all'

    It's more robust in this way

* Test the 'go list -m -json all' parsing logic

* Call 'go list' command only once

`go list -m -json all` contains all informations we need so we don't
need extra `go list -m -json` call.

* main_windows_test.go: Make tests for Windows

* Support Go 1.16

* Use struct instead of map[string]interface{}

* extract and unexport the `module` struct

Co-authored-by: Mohammed Al Sahaf <msaa1990@gmail.com>
2021-09-01 18:30:45 +00:00
Francis Lavoie
82e7b6aff2 cmd: Add xcaddy version command
cmd: Fix tests
2021-08-30 21:15:04 +03:00
Renamed from cmd/xcaddy/main.go (Browse further)