2021-03-30 17:14:05 +03:00
|
|
|
CMD_ARGS = $(filter-out $@,$(MAKECMDGOALS))
|
|
|
|
|
|
|
|
%:
|
|
|
|
@:
|
|
|
|
|
2020-10-19 11:41:07 +03:00
|
|
|
EXTENSIONS_DIR = ./extensions
|
2020-11-17 13:25:27 +03:00
|
|
|
extensions = $(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), ${dir})
|
|
|
|
extension_node_modules = $(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), ${dir}/node_modules)
|
|
|
|
extension_dists = $(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), ${dir}/dist)
|
2020-10-19 11:41:07 +03:00
|
|
|
|
2020-03-15 10:52:02 +03:00
|
|
|
ifeq ($(OS),Windows_NT)
|
|
|
|
DETECTED_OS := Windows
|
|
|
|
else
|
|
|
|
DETECTED_OS := $(shell uname)
|
|
|
|
endif
|
|
|
|
|
2021-02-25 17:32:40 +03:00
|
|
|
binaries/client: node_modules
|
2020-06-30 14:35:16 +03:00
|
|
|
yarn download-bins
|
|
|
|
|
2021-01-28 20:03:33 +03:00
|
|
|
node_modules: yarn.lock
|
2021-04-15 15:22:55 +03:00
|
|
|
yarn install --frozen-lockfile --network-timeout=100000
|
2020-11-13 20:32:15 +03:00
|
|
|
yarn check --verify-tree --integrity
|
2020-06-05 22:47:30 +03:00
|
|
|
|
2021-03-30 17:14:05 +03:00
|
|
|
static/build/LensDev.html: node_modules
|
2020-11-17 13:25:27 +03:00
|
|
|
yarn compile:renderer
|
|
|
|
|
2020-11-16 16:09:16 +03:00
|
|
|
.PHONY: compile-dev
|
2021-03-30 17:14:05 +03:00
|
|
|
compile-dev: node_modules
|
2020-06-30 14:35:16 +03:00
|
|
|
yarn compile:main --cache
|
|
|
|
yarn compile:renderer --cache
|
2020-03-15 10:52:02 +03:00
|
|
|
|
2020-11-16 16:09:16 +03:00
|
|
|
.PHONY: dev
|
2021-03-30 17:14:05 +03:00
|
|
|
dev: binaries/client build-extensions static/build/LensDev.html
|
2020-08-25 11:08:46 +03:00
|
|
|
yarn dev
|
2020-06-30 14:35:16 +03:00
|
|
|
|
2020-11-16 16:09:16 +03:00
|
|
|
.PHONY: lint
|
2020-06-30 14:35:16 +03:00
|
|
|
lint:
|
|
|
|
yarn lint
|
|
|
|
|
2020-11-16 16:09:16 +03:00
|
|
|
.PHONY: test
|
2020-11-17 13:25:27 +03:00
|
|
|
test: binaries/client
|
2021-03-30 17:14:05 +03:00
|
|
|
yarn run jest $(or $(CMD_ARGS), "src")
|
2020-03-15 10:52:02 +03:00
|
|
|
|
2020-11-16 16:09:16 +03:00
|
|
|
.PHONY: integration-linux
|
2021-02-25 17:32:40 +03:00
|
|
|
integration-linux: binaries/client build-extension-types build-extensions
|
|
|
|
# ifdef XDF_CONFIG_HOME
|
|
|
|
# rm -rf ${XDG_CONFIG_HOME}/.config/Lens
|
|
|
|
# else
|
|
|
|
# rm -rf ${HOME}/.config/Lens
|
|
|
|
# endif
|
2020-06-09 13:18:24 +03:00
|
|
|
yarn build:linux
|
|
|
|
yarn integration
|
|
|
|
|
2020-11-16 16:09:16 +03:00
|
|
|
.PHONY: integration-mac
|
2021-02-25 17:32:40 +03:00
|
|
|
integration-mac: binaries/client build-extension-types build-extensions
|
|
|
|
# rm ${HOME}/Library/Application\ Support/Lens
|
2020-06-09 13:18:24 +03:00
|
|
|
yarn build:mac
|
|
|
|
yarn integration
|
|
|
|
|
2020-11-16 16:09:16 +03:00
|
|
|
.PHONY: integration-win
|
2021-02-25 17:32:40 +03:00
|
|
|
integration-win: binaries/client build-extension-types build-extensions
|
|
|
|
# rm %APPDATA%/Lens
|
2020-06-09 13:18:24 +03:00
|
|
|
yarn build:win
|
|
|
|
yarn integration
|
|
|
|
|
2020-11-16 16:09:16 +03:00
|
|
|
.PHONY: build
|
2020-11-17 13:25:27 +03:00
|
|
|
build: node_modules binaries/client build-extensions
|
2021-04-20 16:35:37 +03:00
|
|
|
yarn run compile
|
2020-03-15 10:52:02 +03:00
|
|
|
ifeq "$(DETECTED_OS)" "Windows"
|
2021-04-20 16:35:37 +03:00
|
|
|
./node_modules/.bin/electron-builder --publish onTag --x64 --ia32
|
2020-03-15 10:52:02 +03:00
|
|
|
else
|
2021-04-20 16:35:37 +03:00
|
|
|
./node_modules/.bin/electron-builder --publish onTag
|
2020-03-15 10:52:02 +03:00
|
|
|
endif
|
|
|
|
|
2020-11-17 13:25:27 +03:00
|
|
|
$(extension_node_modules):
|
|
|
|
cd $(@:/node_modules=) && npm install --no-audit --no-fund
|
|
|
|
|
|
|
|
$(extension_dists): src/extensions/npm/extensions/dist
|
|
|
|
cd $(@:/dist=) && npm run build
|
|
|
|
|
2020-11-16 16:09:16 +03:00
|
|
|
.PHONY: build-extensions
|
2021-03-30 17:14:05 +03:00
|
|
|
build-extensions: node_modules $(extension_node_modules) $(extension_dists)
|
2020-10-27 14:02:31 +03:00
|
|
|
|
2020-11-16 16:09:16 +03:00
|
|
|
.PHONY: test-extensions
|
2020-11-17 13:25:27 +03:00
|
|
|
test-extensions: $(extension_node_modules)
|
|
|
|
$(foreach dir, $(extensions), (cd $(dir) && npm run test || exit $?);)
|
2020-11-04 13:49:37 +03:00
|
|
|
|
2020-11-16 16:09:16 +03:00
|
|
|
.PHONY: copy-extension-themes
|
|
|
|
copy-extension-themes:
|
|
|
|
mkdir -p src/extensions/npm/extensions/dist/src/renderer/themes/
|
|
|
|
cp $(wildcard src/renderer/themes/*.json) src/extensions/npm/extensions/dist/src/renderer/themes/
|
|
|
|
|
|
|
|
src/extensions/npm/extensions/__mocks__:
|
|
|
|
cp -r __mocks__ src/extensions/npm/extensions/
|
2020-10-27 14:02:31 +03:00
|
|
|
|
2020-11-16 16:09:16 +03:00
|
|
|
src/extensions/npm/extensions/dist:
|
2020-11-04 13:49:37 +03:00
|
|
|
yarn compile:extension-types
|
|
|
|
|
2020-11-16 16:09:16 +03:00
|
|
|
.PHONY: build-npm
|
|
|
|
build-npm: build-extension-types copy-extension-themes src/extensions/npm/extensions/__mocks__
|
|
|
|
yarn npm:fix-package-version
|
|
|
|
|
|
|
|
.PHONY: build-extension-types
|
|
|
|
build-extension-types: src/extensions/npm/extensions/dist
|
|
|
|
|
|
|
|
.PHONY: publish-npm
|
2020-10-27 14:02:31 +03:00
|
|
|
publish-npm: build-npm
|
2020-10-27 22:54:08 +03:00
|
|
|
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
|
2020-10-27 18:06:56 +03:00
|
|
|
cd src/extensions/npm/extensions && npm publish --access=public
|
2020-10-19 11:41:07 +03:00
|
|
|
|
2020-11-23 12:37:30 +03:00
|
|
|
.PHONY: docs
|
|
|
|
docs:
|
|
|
|
yarn mkdocs-serve-local
|
|
|
|
|
2020-11-17 13:25:27 +03:00
|
|
|
.PHONY: clean-extensions
|
|
|
|
clean-extensions:
|
|
|
|
$(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), rm -rf $(dir)/dist)
|
|
|
|
$(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), rm -rf $(dir)/node_modules)
|
|
|
|
|
2020-11-16 16:09:16 +03:00
|
|
|
.PHONY: clean-npm
|
|
|
|
clean-npm:
|
|
|
|
rm -rf src/extensions/npm/extensions/dist
|
|
|
|
rm -rf src/extensions/npm/extensions/__mocks__
|
|
|
|
rm -rf src/extensions/npm/extensions/node_modules
|
|
|
|
|
|
|
|
.PHONY: clean
|
2020-11-17 13:25:27 +03:00
|
|
|
clean: clean-npm clean-extensions
|
|
|
|
rm -rf binaries/client
|
2020-03-15 10:52:02 +03:00
|
|
|
rm -rf dist/*
|
2020-08-25 11:08:46 +03:00
|
|
|
rm -rf static/build/*
|
2021-01-08 17:45:11 +03:00
|
|
|
rm -rf node_modules/
|