-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
148 lines (123 loc) · 3.09 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# vim:ts=4:sts=4:sw=4:noet
#
# Author: Hari Sekhon
# Date: 2015-10-06 14:02:35 +0100 (Tue, 06 Oct 2015)
#
# https://github.com/HariSekhon/lib-java
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help improve or steer this or other code I publish
#
# https://www.linkedin.com/in/HariSekhon
#
ifneq ("$(wildcard bash-tools/Makefile.in)", "")
include bash-tools/Makefile.in
endif
# breaks bootstrapping on Alpine
#SHELL := /usr/bin/env bash
REPO := HariSekhon/lib-java
CODE_FILES := $(shell find . -name '*.java')
.PHONY: build
build: init
$(MAKE) gradle
.PHONY: init
init:
git submodule update --init --recursive
# used by CI
.PHONY: random-build
random-build:
# Travis does't have SBT in java builds
@x=$$(bash-tools/bin/random_select.sh build mvn gradle); echo $(MAKE) $$x; $(MAKE) $$x
.PHONY: maven
maven: mvn
@:
.PHONY: mvn
mvn: init
@echo ==========================
@echo Java Library - Maven Build
@echo ==========================
@$(MAKE) printenv
$(MAKE) system-packages
./mvnw clean install
@#ln -sfv target/harisekhon-utils-*.jar harisekhon-utils.jar
# don't use SBT - it will bundle Scala ballooning the jar size
.PHONY: sbt
sbt: init
@echo ========================
@echo Java Library - SBT Build
@echo ========================
@$(MAKE) printenv
$(MAKE) system-packages
@# .m2 .ivy
sbt clean assembly publish publishLocal
@#ln -sfv target/scala-*/harisekhon-utils-assembly-*.jar harisekhon-utils.jar
.PHONY: gradle
gradle: init
@echo ===========================
@echo Java Library - Gradle Build
@echo ===========================
@$(MAKE) printenv
$(MAKE) system-packages
@# .m2 .ivy
./gradlew clean install uploadArchives
@#ln -sfv build/libs/harisekhon-utils-*.jar harisekhon-utils.jar
# for testing
.PHONY: all
all:
$(MAKE) mvn
$(MAKE) gradle
$(MAKE) sbt
.PHONY: clean
clean:
./mvnw clean || :
sbt clean || :
./gradlew clean || :
@#rm -vf harisekhon-utils.jar
.PHONY: deep-clean
deep-clean:
$(MAKE) clean
rm -rf .gradle ~/.gradle/{caches,native,wrapper} ~/.m2/{repository,wrapper} ~/.ivy2 ~/.sbt/boot
.PHONY: p
p:
$(MAKE) package
.PHONY: package
package:
./mvnw package
.PHONY: test
test: unittest
bash-tools/checks/check_all.sh
.PHONY: unittest
unittest:
./mvnw test
.PHONY: tld
tld:
wget -O src/main/resources/tlds-alpha-by-domain.txt http://data.iana.org/TLD/tlds-alpha-by-domain.txt
.PHONY: gradle-sonar
gradle-sonar:
@# calls compileJava
./gradlew sonarqube
.PHONY: mvn-sonar
mvn-sonar:
./mvnw sonar:sonar
.PHONY: findbugs
findbugs:
./mvnw compile
./mvnw findbugs:findbugs
./mvnw findbugs:gui
.PHONY: gradle-versioneye
gradle-versioneye:
@# in gradle.properties now
@#./gradlew -P versioneye.projectid=57616cdb0a82b20053182c74 versionEyeUpdate
./gradlew versionEyeUpdate
.PHONY: mvn-versioneye
mvn-versioneye:
./mvnw versioneye:update
.PHONY: sbt-versioneye
sbt-versioneye:
sbt versioneye:updateProject
.PHONY: versioneye
versioneye:
$(MAKE) mvn-versioneye
$(MAKE) gradle-versioneye
$(MAKE) sbt-versioneye