Skip to content

Commit

Permalink
Makefile based build.
Browse files Browse the repository at this point in the history
Use `make` to build. Only those dependencies which have changed will be built.
For example `node_modules` will only be installed if package.json has been changed or if it is missing.
React app will only be built if web-app sources have been changed.

Fixes shzlw#23
  • Loading branch information
chr15m committed Jul 26, 2019
1 parent 9b0eac7 commit 4121c11
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version=$(shell git describe --abbrev=0 --tags | tr -d 'v')
javasrc=$(shell find src)
websrc=$(shell find web-app/public web-app/src) web-app/package.json
webapptarget=src/main/resources/static/index.html

target/poli-$(version).jar: $(javasrc) $(webapptarget)
mvn clean install -DskipTests

web-app/node_modules: web-app/package.json
cd web-app && npm install

web-app/build/index.html: $(websrc) web-app/node_modules
cd web-app && npm run build

$(webapptarget): web-app/build/index.html
mkdir -p src/main/resources/static/
rm -rf src/main/resources/static/*
cp -r web-app/build/* src/main/resources/static/

0 comments on commit 4121c11

Please # to comment.