This repository has been archived by the owner on Oct 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
201 lines (156 loc) · 6.91 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
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# Makefile for Jake
#
# provides a dependency system to avoid duplicate builds, tests
# and packaging.
VERSION="1.0-SNAPSHOT"
SHELL="bash"
MVN=mvn ${MVNEXTRAARGS}
GUITYPE="swing"
DEBUGGUITYPE="console"
LAUNCH4J=/Applications/launch4j/launch4j
all: install
help:
@cat Makefile|grep '^# ' |sed 's/^# \([^: \t]* *\): \(.*\)/\t\1\t\2/g'|sed 's/#\(.*\)#/\n[1;34m\1[0m/g'|sed 's/#//g'|sed 's/\t@\([^: \t]*\)/ \*\t[1;32m\1[0m/g'
# starting #
# @start : start gui with simple install (no dependency system)
start: install
cd gui; ${MVN} -o exec:java
# multistart: allow jake to run multiple instances (no dependency
# system)
multistart: install
cd gui; ${MVN} -o exec:java -Dcom.jakeapp.gui.ignoresingleinstance
# @depstart: start gui with dependency system
depstart: gui
cd gui; ${MVN} exec:java
# instantquit: start gui and quit it immediatly (for debugging spring)
instantquit: gui
cd gui; ${MVN} exec:java -Dcom.jakeapp.gui.test.instantquit
# quickstart: start gui with the projectfolder $PROJECTFOLDER
quickstart: gui
cd gui; ${MVN} exec:java -Dexec.args=${PROJECTFOLDER}
# console : start console-gui (commander)
console: commander
cd commander; ${MVN} exec:java -Dexec.mainClass=com.jakeapp.gui.console.JakeCommander
xmpp-console: commander
cd commander; ${MVN} exec:java -Dexec.mainClass=com.jakeapp.gui.console.XmppCommander
# building & installing #
# @install : simply install everything (no dependency system)
install:
mvn -Dmaven.test.skip=true install
# @jar : deploy to a single jar file
jar:
#${MVN} clean
${MVN} install -Dmaven.test.skip=true
mkdir -p releases
cd releases && rm -rf temp && mkdir -p temp
cd releases/temp && unzip ../../gui/target/gui-swing-${VERSION}.one-jar.jar && cp -v ../../{core,ics,ics-xmpp}/target/*.jar main/ && rm -f ../jake-current.jar && jar cvfm ../jake-current.jar meta-inf/manifest.mf .
cd releases; rm -rf temp
@echo release ready under releases/jake-current.jar
@echo run with java -jar releases/jake-current.jar
# @packages : create the packages for linux, mac and windows
packages: jar package-win package-mac package-linux
package-mac: jar
@echo Creating Mac Package...
# cleaning up
rm -rf releases/Jake.app releases/Jake.dmg releases/tmp.dmg releases/dmgtmp
# generate the mac app
cp -r launcher/Jake.app releases/
cp releases/jake-current.jar releases/Jake.app/Contents/Resources/Java
# generate the mac disk image
rm -rf releases/dmgtmp
mkdir releases/dmgtmp
cp -r releases/Jake.app releases/dmgtmp
cp launcher/resources/dot_background.png releases/dmgtmp/.background.png
cp launcher/resources/dot_VolumeIcon.icns releases/dmgtmp/.VolumeIcon.icns
cp launcher/resources/dot_DS_Store releases/dmgtmp/.DS_Store
ln -s /Applications releases/dmgtmp/Applications
which hdiutil 2>&1 && hdiutil create -volname "Jake" -srcfolder releases/dmgtmp "releases/tmp.dmg" -noscrub
which hdiutil 2>&1 && hdiutil convert -format UDBZ "releases/tmp.dmg" -o "releases/Jake.dmg"
which hdiutil 2>&1 && hdiutil internet-enable -no "releases/Jake.dmg"
cd releases; rm -rf dmgtmp tmp.dmg Jake.app
@echo Mac Package: Jake.dmg
package-win: jar
@echo Creating Windows Package with Launch4j: ${LAUNCH4J}...
rm -rf releases/Jake.exe releases/jakeapp.ico releases/jake.xml
cp launcher/resources/jake.xml releases/
cp launcher/resources/jakeapp.ico releases/
${LAUNCH4J} $(CURDIR)/releases/jake.xml
rm -f releases/jake.xml releases/jakeapp.ico
@echo Winows Package: releases/Jake.exe
@echo TODO create installer with NULLSOFT or use other db path
package-linux: jar
@echo Creating Linux Package...
rm -f releases/Jake.bin
cat launcher/jake.sh releases/jake-current.jar > releases/jake.bin
chmod +x releases/jake.bin
#tar cjvf releases/jake.tar.bz2 releases/jake.bin
@echo Linux Package: releases/Jake.bin
# gui : build gui component
gui: core availablelater
@bash .build.sh ${VERSION} $@ "$^"
rm -f .rebuild* */.rebuild
# commander : build commander component
commander: core
@bash .build.sh ${VERSION} $@ "$^"
rm -f .rebuild* */.rebuild
# core : build core component
core: availablelater fss ics ics-xmpp core-dao-hibernate-threading
@bash .build.sh ${VERSION} $@ "$^"
rm -f .rebuild_ics_dependent .rebuild_ics-xmpp_dependent
core-domain:
@bash .build.sh ${VERSION} $@ "$^"
core-dao-interfaces: core-domain
@bash .build.sh ${VERSION} $@ "$^"
core-dao-tests-base: core-dao-interfaces core-domain
@bash .build.sh ${VERSION} $@ "$^"
core-dao-hibernate-impl: core-dao-interfaces core-domain
@bash .build.sh ${VERSION} $@ "$^"
core-dao-hibernate-threading: core-dao-hibernate-impl
@bash .build.sh ${VERSION} $@ "$^"
availablelater:
@bash .build.sh ${VERSION} $@ "$^"
# fss : build fss component
fss: fss-tests-base
@bash .build.sh ${VERSION} $@ "$^"
fss-tests-base:
bash .build.sh ${VERSION} $@ "$^"
# ics : build ics component
ics:
@bash .build.sh ${VERSION} $@ "$^"
# ics-xmpp : build ics-xmpp component
ics-xmpp: ics
bash .build.sh ${VERSION} $@ "$^"
# cleaning #
# clean : clean build environment
clean:
${MVN} clean
# mrproper : clean build environment and uninstall from local
# repository
mrproper: clean
rm -rf ~/.m2/repository/com/{jakeapp,doublesignal}/
rm -f target/*-${VERSION}.jar
rm -f .rebuild* */.rebuild
# lazyclean : clean build environment, but keep fss
lazyclean:
cp fss/target/fss-${VERSION}.jar .backup.fss-${VERSION}.jar
${MVN} clean
mkdir fss/target/
mv .backup.fss-${VERSION}.jar fss/target/fss-${VERSION}.jar
# others #
generateDaos:
# use SpringThreadBroker.getInstance() for global dao's
bash generateDao.sh core/src/main/java/com/jakeapp/core/dao/HibernateConfigurationDao.java "SpringThreadBroker.getInstance()"
bash generateDao.sh core/src/main/java/com/jakeapp/core/dao/HibernateProjectDao.java "SpringThreadBroker.getInstance()"
bash generateDao.sh core/src/main/java/com/jakeapp/core/dao/HibernateAccountDao.java "SpringThreadBroker.getInstance()"
bash generateDao.sh core/src/main/java/com/jakeapp/core/dao/HibernateInvitationDao.java "SpringThreadBroker.getInstance()"
# use SpringThreadBroker.getThreadForObject(this) for local (per project) daos
bash generateDao.sh core/src/main/java/com/jakeapp/core/dao/HibernateFileObjectDao.java "SpringThreadBroker.getThreadForObject(this)"
bash generateDao.sh core/src/main/java/com/jakeapp/core/dao/HibernateLogEntryDao.java "SpringThreadBroker.getThreadForObject(this)"
bash generateDao.sh core/src/main/java/com/jakeapp/core/dao/HibernateNoteObjectDao.java "SpringThreadBroker.getThreadForObject(this)"
#
# You can add arguments to the maven call by setting the MVNEXTRAARGS
# environment variable.
# The dependency system does only work with the coreutils package, i.e., only on
# Linux.
#
.PHONY: install jar packages package-win package-mac package-linux availablelater gui core fss fss-tests-base ics ics-xmpp commander start depstart instantquit quickstart console clean mrproper lazyclean