forked from goodow/realtime-store
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
79 lines (62 loc) · 3.07 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
.SUFFIXES: .java .m
.PHONY: default clean translate link
include ../resources/make/common.mk
MAIN_SOURCES = $(subst $(MAIN_SRC_DIR)/,,$(shell find $(MAIN_SRC_DIR) -name *.java \
! -name ModelNative.java ! -name JreModelFactory.java ! -name JsModelFactory.java))
MAIN_TEMP_SOURCES = $(subst $(MAIN_SRC_DIR), $(STORE_GEN_DIR), $(MAIN_SOURCES))
MAIN_GEN_SOURCES = $(MAIN_SOURCES:%.java=$(STORE_GEN_DIR)/%.m)
OVERRIDE_GEN_DIR = $(GDREALTIME_DIR)/Classes/override_generated/store
OCNI_SOURCES = $(subst ./,,$(shell cd $(OCNI_SRC_DIR); find . -name *.java))
OCNI_GEN_SOURCES = $(OCNI_SOURCES:%.java=$(BUILD_DIR)/%.placeholder)
TEST_SOURCES = $(subst $(TEST_SRC_DIR)/,,$(shell find $(TEST_SRC_DIR) -name *.java))
TEST_GEN_SOURCES = $(TEST_SOURCES:%.java=$(TEST_GEN_DIR)/%.m)
TEMP_PATH = $(J2OBJC_DIST)/lib/guava-13.0.jar
TEMP_PATH += :$(M2_REPO)/com/goodow/gwt/gwt-elemental/2.5.1-SNAPSHOT/gwt-elemental-2.5.1-SNAPSHOT.jar
TEMP_PATH += :$(M2_REPO)/com/goodow/realtime/realtime-operation/0.3.0-SNAPSHOT/realtime-operation-0.3.0-SNAPSHOT.jar
TEMP_PATH += :$(M2_REPO)/com/goodow/realtime/realtime-channel/0.3.0-SNAPSHOT/realtime-channel-0.3.0-SNAPSHOT.jar
TEMP_PATH += :$(M2_REPO)/org/timepedia/exporter/gwtexporter/2.5.0-SNAPSHOT/gwtexporter-2.5.0-SNAPSHOT.jar
TEMP_PATH += :$(M2_REPO)/com/google/gwt/gwt-user/2.5.1/gwt-user-2.5.1.jar
CLASSPATH = $(shell echo $(TEMP_PATH) | sed 's/ //g')
default: clean translate pod_update test
test: translate
@cd $(GDREALTIME_DIR)/Project;xcodebuild -workspace GDRealtime.xcworkspace/ -scheme test
translate: translate_main translate_test
pod_update:
@cd $(GDREALTIME_DIR)/Project;pod update
pre_translate_main: $(BUILD_DIR) $(STORE_GEN_DIR)
@rm -f $(MAIN_SOURCE_LIST)
@touch $(MAIN_SOURCE_LIST)
$(STORE_GEN_DIR)/%.m $(STORE_GEN_DIR)/%.h: $(MAIN_SRC_DIR)/%.java
@echo $? >> $(MAIN_SOURCE_LIST)
$(BUILD_DIR)/%.placeholder: $(OCNI_SRC_DIR)/%.java
@echo $? >> $(MAIN_SOURCE_LIST)
@mkdir -p `dirname $@`
@touch $@
translate_main: pre_translate_main $(MAIN_GEN_SOURCES) $(OCNI_GEN_SOURCES)
@if [ `cat $(MAIN_SOURCE_LIST) | wc -l` -ge 1 ] ; then \
$(J2OBJC) -sourcepath $(MAIN_SRC_DIR) -d $(STORE_GEN_DIR) \
-classpath $(CLASSPATH) \
`cat $(MAIN_SOURCE_LIST)` ; \
fi
@cp -r $(OVERRIDE_GEN_DIR)/ $(STORE_GEN_DIR)
@cd $(STORE_GEN_DIR);mkdir -p ../include;tar -c . | tar -x -C ../include --include=*.h
pre_translate_test: $(BUILD_DIR) $(TEST_GEN_DIR)
@rm -f $(TEST_SOURCE_LIST)
@touch $(TEST_SOURCE_LIST)
$(TEST_GEN_DIR)/%.m $(TEST_GEN_DIR)/%.h: $(TEST_SRC_DIR)/%.java
@echo $? >> $(TEST_SOURCE_LIST)
translate_test: pre_translate_test $(TEST_GEN_SOURCES)
@if [ `cat $(TEST_SOURCE_LIST) | wc -l` -ge 1 ] ; then \
$(J2OBJC) -sourcepath $(MAIN_SRC_DIR):$(TEST_SRC_DIR) -d $(TEST_GEN_DIR) \
-classpath $(CLASSPATH):$(JUNIT_JAR) -Werror \
`cat $(TEST_SOURCE_LIST)` ; \
fi
$(STORE_GEN_DIR):
@mkdir -p $(STORE_GEN_DIR)
$(TEST_GEN_DIR):
@mkdir -p $(TEST_GEN_DIR)
$(BUILD_DIR):
@mkdir -p $(BUILD_DIR)
clean:
@rm -rf $(STORE_GEN_DIR) $(TEST_GEN_DIR) $(BUILD_DIR)
@cd $(GDREALTIME_DIR)/Project;xcodebuild -workspace GDRealtime.xcworkspace/ -scheme test clean