2021-03-30 17:14:05 +03:00
|
|
|
CMD_ARGS = $(filter-out $@,$(MAKECMDGOALS))
|
|
|
|
|
|
|
|
%:
|
|
|
|
@:
|
|
|
|
|
2021-06-07 16:45:24 +03:00
|
|
|
NPM_RELEASE_TAG ?= latest
|
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-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-05-26 15:02:55 +03:00
|
|
|
binaries/client: node_modules
|
|
|
|
yarn download-bins
|
|
|
|
|
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
|
|
|
|
|
2021-04-29 18:05:13 +03:00
|
|
|
.PHONY: release-version
|
|
|
|
release-version:
|
|
|
|
npm version $(CMD_ARGS) --git-tag-version false
|
|
|
|
|
2021-05-12 15:03:45 +03:00
|
|
|
.PHONY: tag-release
|
|
|
|
tag-release:
|
|
|
|
scripts/tag-release.sh
|
|
|
|
|
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
|
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
|
2021-06-10 02:57:04 +03:00
|
|
|
build: node_modules binaries/client
|
2021-04-26 16:42:59 +03:00
|
|
|
yarn run npm:fix-build-version
|
2021-06-10 02:57:04 +03:00
|
|
|
$(MAKE) 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-22 15:00:51 +03:00
|
|
|
yarn run electron-builder --publish onTag --x64 --ia32
|
2020-03-15 10:52:02 +03:00
|
|
|
else
|
2021-04-22 15:00:51 +03:00
|
|
|
yarn run electron-builder --publish onTag
|
2020-03-15 10:52:02 +03:00
|
|
|
endif
|
|
|
|
|
2021-05-26 15:02:55 +03:00
|
|
|
$(extension_node_modules): node_modules
|
2021-04-23 15:26:58 +03:00
|
|
|
cd $(@:/node_modules=) && ../../node_modules/.bin/npm install --no-audit --no-fund
|
2020-11-17 13:25:27 +03:00
|
|
|
|
|
|
|
$(extension_dists): src/extensions/npm/extensions/dist
|
2021-04-23 15:26:58 +03:00
|
|
|
cd $(@:/dist=) && ../../node_modules/.bin/npm run build
|
2020-11-17 13:25:27 +03:00
|
|
|
|
2021-06-07 15:14:27 +03:00
|
|
|
.PHONY: clean-old-extensions
|
|
|
|
clean-old-extensions:
|
|
|
|
find ./extensions -mindepth 1 -maxdepth 1 -type d '!' -exec test -e '{}/package.json' \; -exec rm -rf {} \;
|
|
|
|
|
2020-11-16 16:09:16 +03:00
|
|
|
.PHONY: build-extensions
|
2021-06-07 15:14:27 +03:00
|
|
|
build-extensions: node_modules clean-old-extensions $(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
|
|
|
|
2021-05-26 15:02:55 +03:00
|
|
|
src/extensions/npm/extensions/dist: node_modules
|
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
|
2021-05-04 16:47:52 +03:00
|
|
|
build-extension-types: node_modules src/extensions/npm/extensions/dist
|
2020-11-16 16:09:16 +03:00
|
|
|
|
|
|
|
.PHONY: publish-npm
|
2021-04-23 15:26:58 +03:00
|
|
|
publish-npm: node_modules build-npm
|
|
|
|
./node_modules/.bin/npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
|
2021-06-07 16:45:24 +03:00
|
|
|
cd src/extensions/npm/extensions && npm publish --access=public --tag=$(NPM_RELEASE_TAG)
|
2021-06-07 10:40:39 +03:00
|
|
|
git restore src/extensions/npm/extensions/package.json
|
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)
|
2021-05-19 09:40:09 +03:00
|
|
|
$(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), rm $(dir)/*.tgz || true)
|
2020-11-17 13:25:27 +03:00
|
|
|
|
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/
|