|
| 1 | +SHELL=/bin/zsh |
| 2 | +MVN_AVAILABLE := $(shell command -v mvn 2> /dev/null) |
| 3 | +SDK_AVAILABLE := $(shell [[ -s "${HOME}/.sdkman/bin/sdkman-init.sh" ]] && source "${HOME}/.sdkman/bin/sdkman-init.sh" && command -v sdk) |
| 4 | +sdk = source "${HOME}/.sdkman/bin/sdkman-init.sh" && sdk |
| 5 | + |
| 6 | +.PHONY: check |
| 7 | +check: |
| 8 | +ifndef MVN_AVAILABLE |
| 9 | + $(error "Maven is not available. Please install it before continuing.") |
| 10 | +endif |
| 11 | +ifndef SDK_AVAILABLE |
| 12 | + $(error "Sdkman is not available. Please install it before continuing.") |
| 13 | +endif |
| 14 | + @echo "Tools installed and ready" |
| 15 | + |
| 16 | + |
1 | 17 | .PHONY: default |
2 | 18 | default: | help |
3 | 19 |
|
4 | 20 | .PHONY: help |
5 | 21 | help: |
6 | 22 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' |
7 | 23 |
|
8 | | -.PHONY: build-all |
9 | | -build-all: |
10 | | - mvn -B clean install --settings=.maven.settings.xml --file pom.xml -DskipTests -P nexus |
| 24 | +.PHONY: build-klass-forvaltning |
| 25 | +build-klass-forvaltning: |
| 26 | + pushd klass-forvaltning && \ |
| 27 | + ${sdk} env && \ |
| 28 | + mvn -B install -P nexus; \ |
| 29 | + popd; \ |
| 30 | + ${sdk} env clear |
| 31 | + |
| 32 | +.PHONY: build-klass-api |
| 33 | +build-klass-api: |
| 34 | + pushd klass-api && \ |
| 35 | + mvn -B install -P nexus; \ |
| 36 | + popd |
11 | 37 |
|
12 | 38 | .PHONY: run-klass-forvaltning-local |
13 | 39 | run-klass-forvaltning-local: |
14 | | - pushd klass-forvaltning && mvn spring-boot\:run --settings=../.maven.settings.xml -P nexus && popd |
| 40 | + pushd klass-forvaltning && \ |
| 41 | + mvn spring-boot\:run --settings=../.maven.settings.xml -P nexus; \ |
| 42 | + popd |
15 | 43 |
|
16 | 44 | .PHONY: run-klass-forvaltning-local-mariadb |
17 | 45 | # Requires that a MariaDB instance is already running with a database called klass and a user called klass. |
18 | 46 | # The environment variable KLASS_ENV_MARIADB_PASSWORD must be specified with the password for the klass user. |
19 | 47 | run-klass-forvaltning-local-mariadb: |
20 | 48 | pushd klass-forvaltning && \ |
21 | | - mvn spring-boot\:run -Dspring.profiles.active=mariadb,embedded-solr,frontend,skip-indexing,small-import,ad-offline -P nexus && \ |
| 49 | + mvn spring-boot\:run -Dspring.profiles.active=mariadb,embedded-solr,frontend,skip-indexing,small-import,ad-offline -P nexus; \ |
22 | 50 | popd |
23 | 51 |
|
24 | 52 | # The environment variable KLASS_ENV_SECURITY_IGNORED must be set to "/**" in order to skip authentication |
25 | 53 | run-klass-api-local-mariadb: |
26 | 54 | pushd klass-api && \ |
27 | | - mvn spring-boot\:run -Dspring.profiles.active=mariadb,embedded-solr,mock-mailserver,skip-indexing,small-import,ad-offline -P nexus && \ |
| 55 | + mvn spring-boot\:run -Dspring.profiles.active=mariadb,embedded-solr,mock-mailserver,skip-indexing,small-import,ad-offline -P nexus; \ |
28 | 56 | popd |
0 commit comments