-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (46 loc) · 1.45 KB
/
Makefile
File metadata and controls
55 lines (46 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
PROJECT_VERSION := $(shell grep -m1 '<version>' pom.xml | sed -e 's/.*<version>\(.*\)<\/version>.*/\1/')
.PHONY: build
build:
@echo "ℹ️🔢 Project version: $(PROJECT_VERSION)"
@echo "👷 Building and installing project..."
@mvn clean verify install && \
echo "🧩 Testing with sample project" && \
(cd sample-project && mvn -T4C -Dksp.plugin.version=$(PROJECT_VERSION) clean test) && \
echo "✅ Done"
.PHONY: site
site:apidocs
mvn -Dgpg.sign=false clean site dokka:dokka -P release
.PHONY: apidocs
apidocs:
mvn dokka:dokka -P release
.PHONY: lint
lint:prepare
ktlint && \
mvn spotless:check
# https://docs.openrewrite.org/recipes/maven/bestpractices
.PHONY:format
format:prepare
ktlint --format && \
mvn spotless:apply && \
mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \
-Drewrite.activeRecipes=org.openrewrite.maven.BestPractices \
-Drewrite.exportDatatables=true
.PHONY:prepare
prepare:
brew install ktlint --quiet
.PHONY:all
all: format lint build
.PHONY:ci
ci:
@echo "ℹ️🔢 Project version: $(PROJECT_VERSION)"
@echo "👷 Building project..."
@mvn -Dgpg.skip=true verify site -P release && \
echo "🚚📦 Installing..." && \
mvn install -DskipTests && \
echo "🧩 Testing with sample project" && \
(cd sample-project && mvn -Dksp.plugin.version=$(PROJECT_VERSION) test) && \
echo "✅ Done"
.PHONY:sample
sample:
@echo "🖼️ Building sample project"
@(cd sample-project && mvn test)