-
Notifications
You must be signed in to change notification settings - Fork 28
/
Makefile
63 lines (55 loc) · 2.59 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
53
54
55
56
57
58
59
60
61
62
63
SHELL:=/usr/bin/env bash -euo pipefail -c
.DEFAULT_GOAL := help
CURRENT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
PROJECT_VERSION=$(shell grep "^ThisBuild / version[ ]*:=[ ]*" version.sbt | sed -e 's/ThisBuild \/ version[ ]*:\=[ ]*\"\(.*\)\"/\1/g')
### help : Prints usage information
.PHONY: help
help:
@echo "Makefile usage:"
@echo ""
@sed -n 's/^###//p' < $(CURRENT_DIR)/Makefile | sort
### format : Format code
.PHONY: format
format:
@sbt scalafmt
### compile : Compile project
.PHONY: compile
compile:
@sbt clean +compile
### test : Test project
.PHONY: test
test:
@sbt +core/test +solver-oj/test +solver-lp/test
### build : Clean, build and test project
.PHONY: build
build: compile test
### changelog : Create changelogs
.PHONY: changelog
changelog:
@git tag -a v"${PROJECT_VERSION}" -m "version ${PROJECT_VERSION}"
@cz changelog --file-name "docs/release_notes/${PROJECT_VERSION}.md" v"${PROJECT_VERSION}"
@cat "docs/release_notes/${PROJECT_VERSION}.md" | tail -n +3 > "docs/release_notes/${PROJECT_VERSION}.md"
### release : Creates a release
.PHONY: release
release: build
@echo "Releasing version '${PROJECT_VERSION}'"
@sbt +package
@sbt +publishSigned
@sbt sonatypeReleaseAll
@git push origin v"${PROJECT_VERSION}"
@gh release create v"${PROJECT_VERSION}" -F "docs/release_notes/${PROJECT_VERSION}.md" \
./core/target/scala-2.12/optimus_2.12-${PROJECT_VERSION}.jar \
./core/target/scala-2.13/optimus_2.13-${PROJECT_VERSION}.jar \
./core/target/scala-3.3.4/optimus_3-${PROJECT_VERSION}.jar \
./solver-oj/target/scala-2.12/optimus-solver-oj_2.12-${PROJECT_VERSION}.jar \
./solver-oj/target/scala-2.13/optimus-solver-oj_2.13-${PROJECT_VERSION}.jar \
./solver-oj/target/scala-3.3.4/optimus-solver-oj_3-${PROJECT_VERSION}.jar \
./solver-lp/target/scala-2.12/optimus-solver-lp_2.12-${PROJECT_VERSION}.jar \
./solver-lp/target/scala-2.13/optimus-solver-lp_2.13-${PROJECT_VERSION}.jar \
./solver-lp/target/scala-3.3.4/optimus-solver-lp_3-${PROJECT_VERSION}.jar \
./solver-gurobi/target/scala-2.12/optimus-solver-gurobi_2.12-${PROJECT_VERSION}.jar \
./solver-gurobi/target/scala-2.13/optimus-solver-gurobi_2.13-${PROJECT_VERSION}.jar \
./solver-gurobi/target/scala-3.3.4/optimus-solver-gurobi_3-${PROJECT_VERSION}.jar \
./solver-mosek/target/scala-2.12/optimus-solver-mosek_2.12-${PROJECT_VERSION}.jar \
./solver-mosek/target/scala-2.13/optimus-solver-mosek_2.13-${PROJECT_VERSION}.jar \
./solver-mosek/target/scala-3.3.4/optimus-solver-mosek_3-${PROJECT_VERSION}.jar