-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(build): Splits Makefile into smaller ones, moves scripts to …
…a separate folder
- Loading branch information
Showing
9 changed files
with
128 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Nuga build Makefile targets | ||
BUILD_PATH = app/build/bin | ||
PLATFORMS_DARWIN = darwin/arm64,darwin/amd64 | ||
LD_FLAGS = -X 'nuga_ui/internal/nuga.AppVersion=v$(VERSION)' -s -w | ||
|
||
define build_platforms | ||
cd app; wails build \ | ||
-clean \ | ||
-platform "$(1)" \ | ||
-trimpath \ | ||
-ldflags "$(LD_FLAGS)" | ||
endef | ||
|
||
define pack_darwin_release | ||
mkdir -p "$(DIST_PATH)/$(1)" | ||
mv "$(BUILD_PATH)/Nuga-$(1).app" "$(DIST_PATH)/$(1)/Nuga.app" | ||
cd "$(DIST_PATH)/$(1)"; codesign -fs 'Nuga Developer' --deep Nuga.app | ||
cd "$(DIST_PATH)/$(1)"; zip -9 -y -r -q Nuga.zip Nuga.app | ||
mv "$(DIST_PATH)/$(1)/Nuga.zip" "$(DIST_PATH)/Nuga-$(VERSION)-mac-$(1).zip" | ||
rm -rf "$(DIST_PATH)/$(1)" | ||
endef | ||
|
||
.PHONY: build/darwin | ||
build/darwin: | ||
$(call build_platforms,"$(PLATFORMS_DARWIN)") | ||
mkdir -p "$(DIST_PATH)" | ||
$(call pack_darwin_release,arm64) | ||
$(call pack_darwin_release,amd64) | ||
|
||
.PHONY: build/linux | ||
build/linux: | ||
cd app; wails build \ | ||
-clean \ | ||
-trimpath \ | ||
-ldflags "-X 'nuga_ui/internal/nuga.AppVersion=v$(VERSION)' -s -w" | ||
|
||
|
||
.PHONY: build | ||
build: | ||
make build/$(OS) | ||
|
||
.PHONY: build/dumper | ||
build/dumper: | ||
go build -o dist/k916-dumper utils/k916-dumper/main.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Nuga dev Makefile targets | ||
.PHONY: dev | ||
dev: | ||
cd app; wails dev -loglevel Debug -v 2 | ||
|
||
.PHONY: dev-universal | ||
dev-universal: | ||
cd app; wails dev -ldflags "-X 'nuga_ui/internal/nuga.Universal=true'" -loglevel Debug -v 2 | ||
|
||
.PHONY: dev-memtest | ||
dev-memtest: | ||
cd app; wails dev -tags memtest -loglevel Debug -v 2 | ||
|
||
.PHONY: memtest-view | ||
memtest-view: | ||
go tool pprof \ | ||
-http=:8081 \ | ||
-alloc_space \ | ||
http://localhost:8080/debug/pprof/heap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Nuga install Makefile targets | ||
.PHONY: install/darwin/arm64 | ||
install/darwin/arm64: | ||
rm -rf /Applications/Nuga.app | ||
cd dist; unzip Nuga-*-arm64.zip | ||
mv dist/Nuga.app /Applications/Nuga.app | ||
|
||
.PHONY: install/darwin/amd64 | ||
install/darwin/amd64: | ||
rm -rf /Applications/Nuga.app | ||
cd dist; unzip Nuga-*-amd64.zip | ||
mv dist/Nuga.app /Applications/Nuga.app | ||
|
||
.PHONY: install | ||
install: | ||
make install/$(OS)/$(ARCH) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
define go_lint | ||
golangci-lint run ./$(1)/... | ||
revive -config ./revive.toml ./$(1)/... | ||
endef | ||
|
||
.PHONY: lint | ||
lint: | ||
make lint-lib | ||
make lint-app | ||
|
||
.PHONY: lint-lib | ||
lint-lib: | ||
$(call go_lint,lib) | ||
|
||
.PHONY: lint-app | ||
lint-app: | ||
$(call go_lint,app) | ||
cd app/frontend; pnpm run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters