This repository has been archived by the owner on Jul 29, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Makefile
52 lines (41 loc) · 1.55 KB
/
Makefile
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
########################################
help:
@echo "You have the following options when using this Makefile:"
@echo
@echo "$(OK_COLOR)Development related:"
@echo "$(OK_COLOR) b $(NO_COLOR)- builds EE"
@echo "$(OK_COLOR) docker-build $(NO_COLOR)- builds EE using Docker"
########################################
DOCKER_IMAGE := weihao/enchantmentsenhance
RELEASE_VERSION := $(shell mvn -q -Dexec.executable="echo" -Dexec.args='$${project.version}' --non-recursive exec:exec)
NEXT_VERSION := $(shell echo $(RELEASE_VERSION) | perl -pe 's{^(([0-9]\.)+)?([0-9]+)$$}{$$1 . ($$3 + 1)}e')
NO_COLOR=\x1b[0m
OK_COLOR=\x1b[32;01m
ERROR_COLOR=\x1b[31;01m
WARN_COLOR=\x1b[33;01m
########################################
maven-build:
@mvn clean package
docker-build:
@printf "$(OK_COLOR)Building EnchantmentsEnhance ${RELEASE_VERSION} jar...$(NO_COLOR)\n"
@printf "$(OK_COLOR)Launching Docker...$(NO_COLOR)\n"
docker build -t ${DOCKER_IMAGE}:${RELEASE_VERSION} ./
@printf "$(OK_COLOR)Copying Artifact...$(NO_COLOR)\n"
@mkdir -p ./out
docker cp $$(docker create ${DOCKER_IMAGE}:${RELEASE_VERSION}):/usr/src/enchantmentsenhance/modules/EnchantmentsEnhance-Plugin/target/EnchantmentsEnhance-Plugin-${RELEASE_VERSION}.jar ./out/
@printf "$(OK_COLOR)Done! Find the jar in the /out Directory$(NO_COLOR)\n"
set:
mvn versions:set -DnewVersion=$(v)
bump:
make set v=${NEXT_VERSION}
bump-push:
@make bump
@git add .
@git commit -m "Bump a version"
@git push
ci:
@mvn clean package
@rm -rf build
@mkdir -p build
@cp modules/*/target/*.jar ./build
@rm ./build/original*