-
-
Notifications
You must be signed in to change notification settings - Fork 438
/
Makefile
44 lines (34 loc) · 1.48 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
#
# Copyright (C) 2020 Signal Messenger, LLC.
# SPDX-License-Identifier: AGPL-3.0-only
#
DOCKER ?= docker
.PHONY: docker java_build publish_java
default: java_build
DOCKER_IMAGE := libsignal-builder
DOCKER_TTY_FLAG := $$(test -t 0 && echo -it)
CROSS_COMPILE_SERVER ?= -PcrossCompileServer
docker_image:
cd .. && $(DOCKER) build --build-arg UID=$$(id -u) --build-arg GID=$$(id -g) -t $(DOCKER_IMAGE) -f java/Dockerfile .
java_build: DOCKER_EXTRA=$(shell [ -L build ] && P=$$(readlink build) && echo -v $$P/:$$P )
java_build: docker_image
$(DOCKER) run $(DOCKER_TTY_FLAG) --init --rm --user $$(id -u):$$(id -g) \
--env LIBSIGNAL_TESTING_ENCLAVE_SECRET \
-v `cd .. && pwd`/:/home/libsignal/src $(DOCKER_EXTRA) $(DOCKER_IMAGE) \
sh -c "cd src/java; ./gradlew build $(CROSS_COMPILE_SERVER)"
publish_java: DOCKER_EXTRA = $(shell [ -L build ] && P=$$(readlink build) && echo -v $$P/:$$P )
publish_java: docker_image
$(DOCKER) run --rm --user $$(id -u):$$(id -g) \
-v `cd .. && pwd`/:/home/libsignal/src $(DOCKER_EXTRA) \
-e ORG_GRADLE_PROJECT_sonatypeUsername \
-e ORG_GRADLE_PROJECT_sonatypePassword \
-e ORG_GRADLE_PROJECT_signingKeyId \
-e ORG_GRADLE_PROJECT_signingPassword \
-e ORG_GRADLE_PROJECT_signingKey \
$(DOCKER_IMAGE) \
sh -c "cd src/java; ./gradlew publish closeAndReleaseStagingRepositories $(CROSS_COMPILE_SERVER)"
# We could run these through Docker, but they would have the same result anyway.
clean:
./gradlew clean
format_java:
./gradlew spotlessApply