-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.mak
138 lines (110 loc) · 3.61 KB
/
build.mak
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
## This makefile should update the local IB code repo and then compile/deploy to tomcat web app container.
THIS_DIR_PATH = $(shell pwd)
TOMCATPATH = /projects/sysbio/apps/java/tomcat
WEBAPPSPATH = $(TOMCATPATH)/webapps
PRODUCTION_WAR_DIR = ROOT
WAR_DIR = ib_dev
PROPERTIESDIR = $(WAR_DIR)/WEB-INF/classes/edu/ucsc/ib/server/
PROPERTIESFILE = ib.properties
UIBUILDDIR = uibuild
UIBUILDCLASS = edu.ucsc.ib.NetVizTest
UICOMPILECLASS = com.google.gwt.dev.Compiler
UICOMPILEFLAGS = -style OBF -war $(UIBUILDDIR) $(UIBUILDCLASS) -logLevel TRACE
CLIENT_SOURCE_DIR = src/edu/ucsc/ib/client
SERVER_SOURCE_DIR = src/edu/ucsc/ib/server
#SERVERCOMPILETARGETS = src/edu/ucsc/ib/server/*.java
SERVERCOMPILETARGETS = $(shell find src/edu/ucsc/ib/server -name "*.java")
SERVERBUILDDIR = serverbuild
GWT_DIR = /projects/sysbio/apps/java/gwt
GWT_JARS = $(GWT_DIR)/gwt-dev.jar:$(GWT_DIR)/gwt-user.jar:$(GWT_DIR)/validation-api-1.0.0.GA.jar:$(GWT_DIR)/validation-api-1.0.0.GA-sources.jar
WEBINF_LIB_DIR = src/edu/ucsc/ib/public/WEB-INF/lib
JSON_JAR = $(WEBINF_LIB_DIR)/json.jar
Commons_IO_JAR = $(WEBINF_LIB_DIR)/commons-io-1.4.jar
Commons_FileUpload_JAR = $(WEBINF_LIB_DIR)/commons-fileupload-1.2.1.jar
XGMML_JAR = $(WEBINF_LIB_DIR)/xgmml.jar
BATIK_JARS = $(WEBINF_LIB_DIR)/batik-awt-util.jar:$(WEBINF_LIB_DIR)/batik-svggen.jar:$(WEBINF_LIB_DIR)/batik-dom.jar:$(WEBINF_LIB_DIR)/batik-xml.jar:$(WEBINF_LIB_DIR)/batik-util.jar:$(WEBINF_LIB_DIR)/batik-ext.jar)
CLASSPATH = $(GWT_JARS):$(JSON_JAR):$(Commons_IO_JAR):$(Commons_FileUpload_JAR):$(XGMML_JAR):src:$(SERVERBUILDDIR):$(BATIK_JARS)
export CLASSPATH
IB_CGI_WORKING_DIR = $(THIS_DIR_PATH)/ib_cgi
URL = https://github.com/chkw/ib_development.git
BRANCH = master
test:
#: deploy to production
deploy_to_prod: war
stop_tomcat_service.sh ;
\
echo "remove previous webapp" ;
\
rm -rf $(WEBAPPSPATH)/$(PRODUCTION_WAR_DIR) ;
\
echo "copy new webapp" ;
\
cp -r $(WAR_DIR) $(WEBAPPSPATH)/$(PRODUCTION_WAR_DIR) ;
\
cat $(WAR_DIR)/ibWelcome.html \
| sed -e 's,ibTutorial01.html,/nets/ibTutorial01.html,' \
| sed -e 's,NetVizTest.html,/nets/NetVizTest.html,' \
| sed -e 's,ibTutorialCircleMap01.html,/nets/ibTutorialCircleMap01.html,' \
| sed -e 's,ibTutorialLoadData01.html,/nets/ibTutorialLoadData01.html,' \
> 1.tmp ;
\
mv 1.tmp $(WEBAPPSPATH)/$(PRODUCTION_WAR_DIR)/ibWelcome.html ;
\
start_tomcat_service.sh ;
#: java classpath
classpath:
echo $(CLASSPATH)
#: GWT version
gwt_version:
java $(UICOMPILECLASS) -version
#: deploy webapp to tomcat server
deploy: war
stop_tomcat_service.sh ;
\
echo "remove previous webapp" ;
\
rm -rf $(WEBAPPSPATH)/$(WAR_DIR) ;
\
echo "copy new webapp" ;
\
cp -r $(WAR_DIR) $(WEBAPPSPATH)/$(WAR_DIR) ;
\
start_tomcat_service.sh ;
\
#: pack webapp into a war
pack_war:
jar cfv $(WAR_DIR).war $(WAR_DIR)
#: create war directory
war: compile
rm -rf $(WAR_DIR) ;
\
echo "install ib properties"
mkdir -p $(PROPERTIESDIR)
cp $(PROPERTIESFILE) $(PROPERTIESDIR)
echo "copy serverside"
cp -r $(SERVERBUILDDIR)/* $(WAR_DIR)/WEB-INF/classes
echo "copy clientside"
cp -r $(UIBUILDDIR)/$(UIBUILDCLASS)/* $(WAR_DIR)
\
mkdir -p $(WAR_DIR)/circleOutput
#: compile server classes
compile_server:
rm -rf $(SERVERBUILDDIR)
mkdir -p $(SERVERBUILDDIR)
javac -d $(SERVERBUILDDIR) \
$(SERVERCOMPILETARGETS)
#: compile GWT UI
compile_ui:
rm -rf $(UIBUILDDIR)
java $(UICOMPILECLASS) $(UICOMPILEFLAGS)
#: compile server and UI
compile: compile_server compile_ui
#: pull from code repository
update:
git pull $(URL) $(BRANCH)
#: ##################################
clean_war:
rm -rf $(WAR_DIR)
clean_builds:
rm -rf $(SERVERBUILDDIR) $(UIBUILDDIR)
clean_all: clean_war clean_builds