1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-12-18 15:41:54 +03:00
tabby/Makefile

105 lines
3.9 KiB
Makefile
Raw Normal View History

2016-12-23 12:06:53 +03:00
MAC_WS="/tmp/elements-build"
MAC_OUTPUT="./dist/Elements-Electron.pkg"
FULL_VERSION=$(shell python -c 'import subprocess; v = subprocess.check_output("git describe --tags --long", shell=True).strip()[1:]; print(v.split("-0-g")[0])')
SHORT_VERSION=$(shell python -c 'import subprocess; v = subprocess.check_output("git describe --tags --long", shell=True).strip()[1:].split("-")[0]; print(v)')
2017-04-30 01:25:01 +03:00
builtin_plugins = terminus-core terminus-settings terminus-terminal
2016-12-23 12:06:53 +03:00
all: run
run:
2017-04-17 00:04:29 +03:00
DEV=1 TERMINUS_PLUGINS=$$PWD ./node_modules/.bin/electron ./app --debug
2016-12-23 12:06:53 +03:00
lint:
tslint -c tslint.json app/src/*.ts app/src/**/*.ts
build:
2017-04-11 23:45:59 +03:00
DEV=1 ./node_modules/.bin/webpack --progress --display-modules
2016-12-23 12:06:53 +03:00
watch:
DEV=1 ./node_modules/.bin/webpack --progress -w
2017-04-16 21:38:42 +03:00
install-deps:
npm install
npm prune
2017-04-30 01:25:01 +03:00
for dir in app $(builtin_plugins) ; do \
2017-04-17 15:57:22 +03:00
cd $$dir; \
npm install; \
npm prune; \
2017-04-16 21:38:42 +03:00
cd ..; \
done
make build-native
2017-04-11 23:45:59 +03:00
build-native:
./node_modules/.bin/electron-rebuild -f -w terminus-terminal/node_modules/node-pty -m terminus-terminal
./node_modules/.bin/electron-rebuild -f -w terminus-terminal/node_modules/font-manager -m terminus-terminal
2017-04-30 01:25:01 +03:00
build-windows:
2016-12-23 12:06:53 +03:00
echo :: Building application
./node_modules/.bin/build --dir --win --em.version=$(FULL_VERSION)
cp ./app/assets/img/disk.ico dist/win-unpacked/
2017-04-30 01:25:01 +03:00
build-mac:
2016-12-23 12:06:53 +03:00
echo :: Building application
./node_modules/.bin/build --dir --mac --em.version=$(FULL_VERSION)
2017-04-30 01:25:01 +03:00
build-linux:
2016-12-23 12:06:53 +03:00
echo :: Building application
2017-04-30 01:25:01 +03:00
mkdir builtin-plugins || true
echo '{}' > builtin-plugins/package.json
cd builtin-plugins && for dir in $(builtin_plugins) ; do \
npm install ../$$dir; \
done
cd builtin-plugins && npm dedupe
./node_modules/.bin/electron-rebuild -f -m builtin-plugins -w node-pty,font-manager
2016-12-23 12:06:53 +03:00
./node_modules/.bin/build --linux --em.version=$(FULL_VERSION)
2017-04-30 01:25:01 +03:00
rm -r builtin-plugins || true
2016-12-23 12:06:53 +03:00
package-windows-app:
echo :: Building app MSI $(SHORT_VERSION)
heat dir dist/win-unpacked/ -cg Files -gg -scom -sreg -sfrag -srd -dr INSTALLDIR -var var.SourceDir -out build/files.wxs
candle -dSourceDir=dist\\win-unpacked -dProductVersion=$(SHORT_VERSION) -arch x64 -o dist/ build/files.wxs build/windows/elements.wxs
light -o dist/elements-app.msi dist/files.wixobj dist/elements.wixobj
build/windows/signtool.exe sign /f "build\\certificates\\Code Signing.p12" dist/elements-app.msi
package-windows-bundle:
echo :: Building installer
candle -dVersion=$(SHORT_VERSION) -ext WixBalExtension -arch x64 -o dist/build.wixobj build/windows/build.wxs
light -ext WixBalExtension -o bundle.exe dist/build.wixobj
insignia -ib bundle.exe -o engine.exe
build/windows/signtool.exe sign /f "build\\certificates\\Code Signing.p12" engine.exe
insignia -ab engine.exe bundle.exe -o dist/Elements-Electron.exe
build/windows/signtool.exe sign /f "build\\certificates\\Code Signing.p12" dist/Elements-Electron.exe
rm engine.exe bundle.exe || true
package-windows: build-windows package-windows-app package-windows-bundle
package-mac: driver-mac build-mac
rm -rf $(MAC_WS) || true
mkdir -p $(MAC_WS)
mkdir -p $(MAC_WS)/app/Applications
mkdir -p $(MAC_WS)/driver/Library/Extensions
cp -Rv dist/mac/ELEMENTS.app $(MAC_WS)/app/Applications/
cp -Rv dist/ElementsDriver.kext $(MAC_WS)/driver/Library/Extensions
pkgbuild --root $(MAC_WS)/app \
--component-plist ./build/mac/Elements.component.plist \
--version $(SHORT_VERSION) \
--scripts ./build/mac \
$(MAC_WS)/Elements.pkg
pkgbuild --root $(MAC_WS)/driver \
--component-plist ./build/mac/ElementsDriver.component.plist \
--scripts ./build/mac \
$(MAC_WS)/ElementsDriver.pkg
cp ./build/mac/AFPTuner.pkg $(MAC_WS)/
productbuild --distribution "./build/mac/Distribution.xml" \
--package-path $(MAC_WS) \
--version $(SHORT_VERSION) \
--sign "Developer ID Installer: Syslink GmbH (V4JSMC46SY)" \
$(MAC_OUTPUT)
.PHONY: run native build coverage