2016-03-14 10:26:59 +00:00
|
|
|
########################################################################
|
|
|
|
#
|
|
|
|
# pgAdmin 4 - PostgreSQL Tools
|
|
|
|
#
|
2018-01-05 10:42:49 +00:00
|
|
|
# Copyright (C) 2013 - 2018, The pgAdmin Development Team
|
2016-03-14 10:26:59 +00:00
|
|
|
# This software is released under the PostgreSQL Licence
|
|
|
|
#
|
|
|
|
#########################################################################
|
|
|
|
|
|
|
|
SHELL = /bin/sh
|
|
|
|
|
2019-09-19 08:58:44 +00:00
|
|
|
APP_NAME := $(shell grep ^APP_NAME web/config.py | awk -F"=" '{print $$NF}' | tr -d '[:space:]' | tr -d "'" | awk '{print tolower($$0)}')
|
|
|
|
APP_RELEASE := $(shell grep ^APP_RELEASE web/config.py | awk -F"=" '{print $$NF}' | tr -d '[:space:]')
|
|
|
|
APP_REVISION := $(shell grep ^APP_REVISION web/config.py | awk -F"=" '{print $$NF}' | tr -d '[:space:]')
|
|
|
|
|
2016-03-14 10:26:59 +00:00
|
|
|
#########################################################################
|
|
|
|
# High-level targets
|
|
|
|
#########################################################################
|
|
|
|
|
2016-06-03 09:56:53 +00:00
|
|
|
# Include only platform-independent builds in all
|
2018-03-22 13:47:26 +00:00
|
|
|
all: docs pip src runtime
|
2016-03-14 10:26:59 +00:00
|
|
|
|
2021-01-29 08:08:27 +00:00
|
|
|
appbundle:
|
2016-06-02 12:56:56 +00:00
|
|
|
./pkg/mac/build.sh
|
|
|
|
|
2017-06-23 08:23:31 +00:00
|
|
|
install-node:
|
2019-08-02 13:05:09 +00:00
|
|
|
cd web && npm install
|
|
|
|
cd web && npm audit fix
|
|
|
|
rm -f web/yarn.lock
|
|
|
|
cd web && yarn import
|
2020-07-02 10:51:00 +00:00
|
|
|
# Commented the below line to avoid vulnerability in lodash package.
|
|
|
|
# Refer https://www.npmjs.com/advisories/1523.
|
|
|
|
# Once fixed we will uncomment it.
|
2020-02-28 11:59:32 +00:00
|
|
|
# cd web && yarn audit
|
2019-08-02 13:05:09 +00:00
|
|
|
rm -f package-lock.json
|
2019-08-07 10:27:39 +00:00
|
|
|
rm -f web/package-lock.json
|
2017-06-23 08:23:31 +00:00
|
|
|
|
2017-07-06 12:02:43 +00:00
|
|
|
bundle:
|
|
|
|
cd web && yarn run bundle
|
2017-06-14 13:11:51 +00:00
|
|
|
|
2017-09-13 08:47:01 +00:00
|
|
|
bundle-dev:
|
|
|
|
cd web && yarn run bundle:dev
|
|
|
|
|
2017-07-06 12:02:43 +00:00
|
|
|
linter:
|
|
|
|
cd web && yarn run linter
|
2017-06-14 13:11:51 +00:00
|
|
|
|
2019-05-15 09:03:29 +00:00
|
|
|
check: install-node bundle linter check-pep8
|
|
|
|
cd web && yarn run karma start --single-run && python regression/runtests.py
|
2017-06-14 13:11:51 +00:00
|
|
|
|
2019-08-02 13:05:09 +00:00
|
|
|
check-audit:
|
|
|
|
cd web && yarn run audit
|
|
|
|
|
|
|
|
check-auditjs:
|
2020-02-28 11:59:32 +00:00
|
|
|
# Commented the below line to avoid vulnerability in decompress package and
|
|
|
|
# audit only dependencies folder. Refer https://www.npmjs.com/advisories/1217.
|
|
|
|
# Pull request is already been send https://github.com/kevva/decompress/pull/73,
|
|
|
|
# once fixed we will uncomment it.
|
|
|
|
# cd web && yarn run auditjs
|
|
|
|
cd web && yarn run auditjs --groups dependencies
|
2019-08-02 13:05:09 +00:00
|
|
|
|
|
|
|
check-auditjs-html:
|
|
|
|
cd web && yarn run auditjs-html
|
|
|
|
|
|
|
|
check-auditpy:
|
|
|
|
cd web && yarn run auditpy
|
|
|
|
|
2018-01-29 12:45:32 +00:00
|
|
|
check-pep8:
|
2019-03-20 11:17:51 +00:00
|
|
|
pycodestyle --config=.pycodestyle docs/
|
|
|
|
pycodestyle --config=.pycodestyle pkg/
|
|
|
|
pycodestyle --config=.pycodestyle web/
|
|
|
|
pycodestyle --config=.pycodestyle tools/
|
2018-01-29 12:45:32 +00:00
|
|
|
|
2017-11-16 12:01:22 +00:00
|
|
|
check-python:
|
2017-07-06 12:02:43 +00:00
|
|
|
cd web && python regression/runtests.py --exclude feature_tests
|
|
|
|
|
2019-06-18 13:28:25 +00:00
|
|
|
check-resql:
|
|
|
|
cd web && python regression/runtests.py --pkg resql --exclude feature_tests
|
|
|
|
|
2018-04-30 16:15:44 +00:00
|
|
|
check-feature: install-node bundle
|
2017-07-06 12:02:43 +00:00
|
|
|
cd web && python regression/runtests.py --pkg feature_tests
|
|
|
|
|
|
|
|
check-js: install-node linter
|
2018-01-22 11:29:07 +00:00
|
|
|
cd web && yarn run karma start --single-run
|
2017-03-25 20:54:40 +00:00
|
|
|
|
2020-08-07 11:06:48 +00:00
|
|
|
check-js-coverage:
|
|
|
|
cd web && yarn run test:karma-coverage
|
|
|
|
|
2018-03-22 11:19:42 +00:00
|
|
|
runtime-debug:
|
|
|
|
cd runtime && qmake CONFIG+=debug && make
|
|
|
|
|
|
|
|
runtime:
|
|
|
|
cd runtime && qmake CONFIG+=release && make
|
|
|
|
|
2017-04-18 14:05:32 +00:00
|
|
|
# Include all clean sub-targets in clean
|
2020-03-18 12:51:11 +00:00
|
|
|
clean: clean-appbundle clean-debian clean-dist clean-docs clean-node clean-pip clean-redhat clean-src clean-runtime
|
2018-04-30 15:13:43 +00:00
|
|
|
rm -rf web/pgadmin/static/js/generated/*
|
|
|
|
rm -rf web/pgadmin/static/js/generated/.cache
|
|
|
|
rm -rf web/pgadmin/static/css/generated/*
|
|
|
|
rm -rf web/pgadmin/static/css/generated/.cache
|
2018-03-22 11:19:42 +00:00
|
|
|
|
|
|
|
clean-runtime:
|
2019-03-15 09:33:42 +00:00
|
|
|
if [ -f runtime/Makefile ]; then (cd runtime && make clean); fi;
|
|
|
|
rm -rf build-*
|
2017-04-05 12:27:32 +00:00
|
|
|
|
2017-04-18 14:05:32 +00:00
|
|
|
clean-appbundle:
|
|
|
|
rm -rf mac-build/
|
2017-04-05 12:27:32 +00:00
|
|
|
|
2020-03-12 15:22:23 +00:00
|
|
|
clean-debian:
|
|
|
|
rm -rf debian-build/
|
|
|
|
|
2017-04-18 14:05:32 +00:00
|
|
|
clean-dist:
|
|
|
|
rm -rf dist/
|
2017-04-05 12:27:32 +00:00
|
|
|
|
2017-04-18 14:05:32 +00:00
|
|
|
clean-docs:
|
|
|
|
LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 $(MAKE) -C docs/en_US -f Makefile.sphinx clean
|
2016-06-02 12:56:56 +00:00
|
|
|
|
2018-04-10 10:15:57 +00:00
|
|
|
clean-node:
|
|
|
|
rm -rf web/node-modules/
|
|
|
|
|
2016-03-14 10:26:59 +00:00
|
|
|
clean-pip:
|
2016-06-15 16:09:05 +00:00
|
|
|
rm -rf pip-build/
|
2016-06-02 12:56:56 +00:00
|
|
|
|
2020-03-18 12:51:11 +00:00
|
|
|
clean-redhat:
|
|
|
|
rm -rf redhat-build/
|
|
|
|
|
2016-06-03 09:56:53 +00:00
|
|
|
clean-src:
|
2016-06-15 16:09:05 +00:00
|
|
|
rm -rf src-build/
|
|
|
|
|
2020-03-12 15:22:23 +00:00
|
|
|
debian:
|
2020-03-18 12:51:11 +00:00
|
|
|
./pkg/debian/build.sh
|
2020-03-12 15:22:23 +00:00
|
|
|
|
2017-09-21 15:49:37 +00:00
|
|
|
docker:
|
2019-09-19 08:58:44 +00:00
|
|
|
echo $(APP_NAME)
|
|
|
|
docker build -t ${APP_NAME} -t $(APP_NAME):latest -t $(APP_NAME):$(APP_RELEASE) -t $(APP_NAME):$(APP_RELEASE).$(APP_REVISION) .
|
2017-09-21 15:49:37 +00:00
|
|
|
|
2017-04-18 14:05:32 +00:00
|
|
|
docs:
|
|
|
|
LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 $(MAKE) -C docs/en_US -f Makefile.sphinx html
|
2016-06-03 09:56:53 +00:00
|
|
|
|
2017-10-11 13:57:58 +00:00
|
|
|
docs-pdf:
|
|
|
|
LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 $(MAKE) -C docs/en_US -f Makefile.sphinx latexpdf
|
|
|
|
|
2019-03-12 14:33:46 +00:00
|
|
|
docs-epub:
|
|
|
|
LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 $(MAKE) -C docs/en_US -f Makefile.sphinx epub
|
|
|
|
|
2018-07-12 09:00:40 +00:00
|
|
|
messages: msg-extract msg-update msg-compile
|
|
|
|
|
2017-04-18 14:05:32 +00:00
|
|
|
msg-compile:
|
2017-10-31 09:16:47 +00:00
|
|
|
cd web && pybabel compile --statistics -d pgadmin/translations
|
2017-04-18 14:05:32 +00:00
|
|
|
|
|
|
|
msg-extract:
|
|
|
|
cd web && pybabel extract -F babel.cfg -o pgadmin/messages.pot pgadmin
|
|
|
|
|
|
|
|
msg-update:
|
|
|
|
cd web && pybabel update -i pgadmin/messages.pot -d pgadmin/translations
|
2017-02-16 11:31:13 +00:00
|
|
|
|
2016-06-02 12:56:56 +00:00
|
|
|
.PHONY: docs
|
2017-04-18 14:05:32 +00:00
|
|
|
|
|
|
|
pip: docs
|
|
|
|
./pkg/pip/build.sh
|
|
|
|
|
2020-03-18 12:51:11 +00:00
|
|
|
redhat:
|
|
|
|
./pkg/redhat/build.sh
|
|
|
|
|
2017-04-18 14:05:32 +00:00
|
|
|
src:
|
|
|
|
./pkg/src/build.sh
|