-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (41 loc) · 1.28 KB
/
Makefile
File metadata and controls
47 lines (41 loc) · 1.28 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
# Copyright (c) 2025 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
SHELL := /bin/bash
PROJECT_NAME := $(shell basename "$$(pwd)")
GRADLE_IMAGE := gradle:7.6.4-jdk17
BUILD_CACHE_VOLUME := $(shell echo '$(PROJECT_NAME)' | sed 's/[^a-zA-Z0-9_-]//g')-build-cache
.PHONY: build
build: prepare_build_cache
docker run -t --rm \
-u $$(id -u):$$(id -g) \
-v $(BUILD_CACHE_VOLUME):/tmp/build-cache \
-v $$(pwd):/data \
-w /data \
$(GRADLE_IMAGE) \
gradle \
--gradle-user-home /tmp/build-cache/gradle \
--project-cache-dir /tmp/build-cache/gradle \
--console=plain \
--info \
--no-daemon \
build
clean: prepare_build_cache
docker run -t --rm \
-u $$(id -u):$$(id -g) \
-v $(BUILD_CACHE_VOLUME):/tmp/build-cache \
-v $$(pwd):/data \
-w /data \
$(GRADLE_IMAGE) \
gradle \
--gradle-user-home /tmp/build-cache/gradle \
--project-cache-dir /tmp/build-cache/gradle \
--console=plain \
--info \
--no-daemon \
clean
prepare_build_cache:
docker run -t --rm \
-v $(BUILD_CACHE_VOLUME):/tmp/build-cache \
busybox:1.37.0 \
chown $$(id -u):$$(id -g) /tmp/build-cache # Fix /tmp/build-cache folder owned by root