mirror of
https://github.com/lensapp/lens.git
synced 2024-09-20 05:47:24 +03:00
648dbfee98
* Remove Makefile from all intree extensions - Makefiles are not really common (rightly so) in JS projects and script entries in the package.json are good enough and what they're there for. - Move to using yarn for installing dependencies and running scripts as that is what we mostly use for the rest of the project. - Move from using make syntax to a dedicated script for building and testing extensions. - add jest as extension devDep, go back to using makefile foreach syntax - add correct exit code - add yarn check call to install-deps - add yarn invokation to find deps Signed-off-by: Sebastian Malton <sebastian@malton.name>
85 lines
1.7 KiB
Makefile
85 lines
1.7 KiB
Makefile
EXTENSIONS_DIR = ./extensions
|
|
|
|
ifeq ($(OS),Windows_NT)
|
|
DETECTED_OS := Windows
|
|
else
|
|
DETECTED_OS := $(shell uname)
|
|
endif
|
|
|
|
.PHONY: init dev build test clean
|
|
|
|
init: install-deps download-bins compile-dev
|
|
echo "Init done"
|
|
|
|
download-bins:
|
|
yarn download-bins
|
|
|
|
install-deps:
|
|
yarn install --frozen-lockfile --verbose
|
|
yarn check --verify-tree --integrity
|
|
|
|
compile-dev:
|
|
yarn compile:main --cache
|
|
yarn compile:renderer --cache
|
|
|
|
dev:
|
|
ifeq ("$(wildcard static/build/main.js)","")
|
|
make init
|
|
endif
|
|
yarn dev
|
|
|
|
lint:
|
|
yarn lint
|
|
|
|
test: download-bins
|
|
yarn test
|
|
|
|
integration-linux: build-extension-types build-extensions
|
|
yarn build:linux
|
|
yarn integration
|
|
|
|
integration-mac: build-extension-types build-extensions
|
|
yarn build:mac
|
|
yarn integration
|
|
|
|
integration-win: build-extension-types build-extensions
|
|
yarn build:win
|
|
yarn integration
|
|
|
|
test-app:
|
|
yarn test
|
|
|
|
build: install-deps download-bins build-extensions
|
|
ifeq "$(DETECTED_OS)" "Windows"
|
|
yarn dist:win
|
|
else
|
|
yarn dist
|
|
endif
|
|
|
|
build-extensions:
|
|
$(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), (cd $(dir) && npm install && npm run build || exit $?);)
|
|
|
|
test-extensions:
|
|
$(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), (cd $(dir) && npm install --dev && npm run test || exit $?);)
|
|
|
|
build-npm: build-extension-types
|
|
yarn npm:fix-package-version
|
|
|
|
build-extension-types:
|
|
yarn compile:extension-types
|
|
|
|
publish-npm: build-npm
|
|
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
|
|
cd src/extensions/npm/extensions && npm publish --access=public
|
|
|
|
clean:
|
|
ifeq "$(DETECTED_OS)" "Windows"
|
|
if exist binaries\client del /s /q binaries\client\*.*
|
|
if exist dist del /s /q dist\*.*
|
|
if exist static\build del /s /q static\build\*.*
|
|
else
|
|
rm -rf binaries/client/*
|
|
rm -rf dist/*
|
|
rm -rf static/build/*
|
|
endif
|