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
|
|
|
|
|
2020-11-17 13:25:27 +03:00
|
|
|
binaries/client:
|
2020-06-30 14:35:16 +03:00
|
|
|
yarn download-bins
|
|
|
|
|
2020-11-17 13:25:27 +03:00
|
|
|
node_modules:
|
2020-12-18 13:41:17 +03:00
|
|
|
yarn install --frozen-lockfile
|
2020-11-13 20:32:15 +03:00
|
|
|
yarn check --verify-tree --integrity
|
2020-06-05 22:47:30 +03:00
|
|
|
|
2020-11-17 13:25:27 +03:00
|
|
|
static/build/LensDev.html:
|
|
|
|
yarn compile:renderer
|
|
|
|
|
2020-11-16 16:09:16 +03:00
|
|
|
.PHONY: compile-dev
|
2020-06-30 14:35:16 +03:00
|
|
|
compile-dev:
|
|
|
|
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
|
2020-11-17 13:25:27 +03:00
|
|
|
dev: node_modules 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
|
2020-06-30 14:35:16 +03:00
|
|
|
yarn test
|
2020-03-15 10:52:02 +03:00
|
|
|
|
2020-11-16 16:09:16 +03:00
|
|
|
.PHONY: integration-linux
|
2020-11-04 13:49:37 +03:00
|
|
|
integration-linux: 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
|
2020-11-04 13:49:37 +03:00
|
|
|
integration-mac: build-extension-types build-extensions
|
2020-06-09 13:18:24 +03:00
|
|
|
yarn build:mac
|
|
|
|
yarn integration
|
|
|
|
|
2020-11-16 16:09:16 +03:00
|
|
|
.PHONY: integration-win
|
2020-11-04 13:49:37 +03:00
|
|
|
integration-win: build-extension-types build-extensions
|
2020-06-09 13:18:24 +03:00
|
|
|
yarn build:win
|
|
|
|
yarn integration
|
|
|
|
|
2020-11-16 16:09:16 +03:00
|
|
|
.PHONY: test-app
|
2020-03-15 10:52:02 +03:00
|
|
|
test-app:
|
|
|
|
yarn test
|
|
|
|
|
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
|
2020-03-15 10:52:02 +03:00
|
|
|
ifeq "$(DETECTED_OS)" "Windows"
|
|
|
|
yarn dist:win
|
|
|
|
else
|
|
|
|
yarn dist
|
|
|
|
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
|
2020-11-17 13:25:27 +03:00
|
|
|
build-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
|
|
|
|
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:
|
|
|
|
ifeq "$(DETECTED_OS)" "Windows"
|
|
|
|
$(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), if exist $(dir)\dist del /s /q $(dir)\dist)
|
|
|
|
$(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), if exist $(dir)\node_modules del /s /q $(dir)\node_modules)
|
|
|
|
else
|
|
|
|
$(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), rm -rf $(dir)/dist)
|
|
|
|
$(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), rm -rf $(dir)/node_modules)
|
|
|
|
endif
|
|
|
|
|
2020-11-16 16:09:16 +03:00
|
|
|
.PHONY: clean-npm
|
|
|
|
clean-npm:
|
|
|
|
ifeq "$(DETECTED_OS)" "Windows"
|
|
|
|
if exist src\extensions\npm\extensions\dist del /s /q src\extensions\npm\extensions\dist
|
|
|
|
if exist src\extensions\npm\extensions\__mocks__ del /s /q src\extensions\npm\extensions\__mocks__
|
|
|
|
if exist src\extensions\npm\extensions\node_modules del /s /q src\extensions\npm\extensions\node_modules
|
|
|
|
else
|
|
|
|
rm -rf src/extensions/npm/extensions/dist
|
|
|
|
rm -rf src/extensions/npm/extensions/__mocks__
|
|
|
|
rm -rf src/extensions/npm/extensions/node_modules
|
|
|
|
endif
|
|
|
|
|
|
|
|
.PHONY: clean
|
2020-11-17 13:25:27 +03:00
|
|
|
clean: clean-npm clean-extensions
|
2020-08-25 11:08:46 +03:00
|
|
|
ifeq "$(DETECTED_OS)" "Windows"
|
2020-11-17 13:25:27 +03:00
|
|
|
if exist binaries\client del /s /q binaries\client
|
2020-08-25 11:08:46 +03:00
|
|
|
if exist dist del /s /q dist\*.*
|
|
|
|
if exist static\build del /s /q static\build\*.*
|
|
|
|
else
|
2020-11-17 13:25:27 +03:00
|
|
|
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/*
|
2020-10-19 11:41:07 +03:00
|
|
|
endif
|