forked from adobe/unity-aepassurance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (38 loc) · 1.73 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
VERSION=$(shell grep 'Plug-in v:' ACP-Griffon/Assets/Plugins/ACPGriffon.cs | sed 's/.*Plug-in v.*:[[:space:]]*\(.*\)[[:space:]]*/\1/')
RELEASE_DIR=ACPGriffon-$(VERSION)-Unity
MOBILE_DIR=$(RELEASE_DIR)/ACPGriffon
UNITY_BIN=/Applications/Unity/Hub/Editor/2019.3.10f1/Unity.app/Contents/MacOS/Unity
ROOT_DIR=.
CURRENT_PATH=$(shell pwd)
PROJECT_DIR=$(CURRENT_PATH)/ACP-Griffon
BIN_DIR=$(ROOT_DIR)/bin
BUILD_DIR=$(BIN_DIR)/build_temp
BUILD_PKG=ACPGriffon.unitypackage
ASSETS=Assets/Plugins/android/AndroidManifest.xml Assets/Plugins/android/mainTemplate.gradle $(shell find ACP-Griffon/Assets/Plugins -type f -iname "*griffon*" -not -name "*.meta" | sed 's/.*ACP-Griffon*\///')
# targets
release: clean setup unity_build
unity_build:
@echo ""
@echo "######################################################################"
@echo "### Make all - "$@
@echo "######################################################################"
mkdir -p $(BUILD_DIR)/$(RELEASE_DIR)
mkdir -p $(BUILD_DIR)/$(MOBILE_DIR)
@echo ""
@echo "######################################################################"
@echo "### Build Unity Plugin - "$@
@echo "######################################################################"
$(UNITY_BIN) -batchmode -quit \
-logFile $(BUILD_DIR)/buildLog.log \
-projectPath $(PROJECT_DIR) \
-exportPackage $(ASSETS) ../$(BUILD_DIR)/$(MOBILE_DIR)/$(BUILD_PKG)
@echo ""
@echo "######################################################################"
@echo "### Zip Unity Plugin for Distribution - "$@
@echo "######################################################################"
cd $(BUILD_DIR) && zip -r -X $(RELEASE_DIR).zip ./$(RELEASE_DIR)
mv $(BUILD_DIR)/$(RELEASE_DIR).zip $(BIN_DIR)
clean:
rm -rf $(BUILD_DIR)
setup:
mkdir $(BUILD_DIR)