Browse Source

Installer can now add plugins into the jar file (can be set to include different plugins per release as needed).

Plugins get added to plugins/ in the jar file. Currently set to add no additional plugins to the jar file.


git-svn-id: http://svn.dmdirc.com/trunk@2773 00569f92-eb28-0410-84fd-f71c24880f
tags/0.5.5
Shane Mc Cormack 16 years ago
parent
commit
8b91cde84c

+ 24
- 4
installer/linux/makeInstallerLinux.sh View File

51
 	echo "The following command line arguments are known:"
51
 	echo "The following command line arguments are known:"
52
 	echo "---------------------"
52
 	echo "---------------------"
53
 	echo "-h, --help                Help information"
53
 	echo "-h, --help                Help information"
54
-	echo "-r, --release [version]   Generate a file based on an svn tag (or branch with -b aswell)"
54
+	echo "-r, --release <version>   Generate a file based on an svn tag (or branch with -b aswell)"
55
 	echo "-b, --branch              Release in -r is a branch "
55
 	echo "-b, --branch              Release in -r is a branch "
56
+	echo "-p, --plugins <plugins>   What plugins to add to the jar file"
56
 	echo "-c, --compile             Recompile the .jar file"
57
 	echo "-c, --compile             Recompile the .jar file"
57
-	echo "-t, --tag [tag]           Tag to add to final exe name to distinguish this build from a standard build"
58
+	echo "-t, --tag <tag>           Tag to add to final exe name to distinguish this build from a standard build"
58
 	echo "-k, --keep                Keep the existing source tree when compiling"
59
 	echo "-k, --keep                Keep the existing source tree when compiling"
59
 	echo "                          (don't svn update beforehand)"
60
 	echo "                          (don't svn update beforehand)"
60
 	echo "---------------------"
61
 	echo "---------------------"
67
 isRelease=""
68
 isRelease=""
68
 finalTag=""
69
 finalTag=""
69
 BRANCH="0"
70
 BRANCH="0"
71
+plugins=""
70
 location="../../../"
72
 location="../../../"
71
 while test -n "$1"; do
73
 while test -n "$1"; do
72
 	case "$1" in
74
 	case "$1" in
75
+		--plugins|-p)
76
+			shift
77
+			plugins=${1}
78
+			;;
73
 		--compile|-c)
79
 		--compile|-c)
74
 			compileJar="true"
80
 			compileJar="true"
75
 			;;
81
 			;;
129
 	cd ${OLDPWD}
135
 	cd ${OLDPWD}
130
 fi;
136
 fi;
131
 
137
 
132
-echo "Linking jar.."
133
-ln -s ${jarPath}"/dist/DMDirc.jar" "./DMDirc.jar"
138
+if [ "" = "${plugins}" ]; then
139
+	echo "Linking jar.."
140
+	ln -s ${jarPath}"/dist/DMDirc.jar" "./DMDirc.jar"
141
+else
142
+	echo "Copying jar.."
143
+	cp ${jarPath}"/dist/DMDirc.jar" "./DMDirc.jar"
144
+	
145
+	echo "Adding plugins to jar"
146
+	ln -s ${jarPath}"/plugins"
147
+	pluginList=""
148
+	for plugin in ${plugins}; do
149
+		pluginList=${pluginList}" plugins/${plugin}"
150
+	done
151
+	jar -uvf "DMDirc.jar" ${pluginList}
152
+	rm -Rf plugins;
153
+fi
134
 
154
 
135
 echo "Creating .run file"
155
 echo "Creating .run file"
136
 echo "Adding stub.."
156
 echo "Adding stub.."

+ 41
- 5
installer/release.sh View File

1
 #!/bin/sh
1
 #!/bin/sh
2
 
2
 
3
+# Jar names of plugins to add to ALL installers. (* means all)
4
+plugins=""
5
+
6
+# Additional Jar names of plugins to add to only Windows installers. (* means all)
7
+plugins_windows=""
8
+
9
+# Additional Jar names of plugins to add to only linux installers. (* means all)
10
+plugins_linux=""
11
+
3
 showHelp() {
12
 showHelp() {
4
 	echo "This will generate the different DMDirc installers."
13
 	echo "This will generate the different DMDirc installers."
5
 	echo "Usage: ${0} [params] <release>"
14
 	echo "Usage: ${0} [params] <release>"
6
 	echo "Release can be either 'trunk', a valid tag, or a branch (if -b is passed)"
15
 	echo "Release can be either 'trunk', a valid tag, or a branch (if -b is passed)"
7
 	echo "The following params are known:"
16
 	echo "The following params are known:"
8
 	echo "---------------------"
17
 	echo "---------------------"
9
-	echo "-b, --branch              <release> is a branch"
10
-	echo "-h, --help                Help information"
11
-	echo "-o, --opt [options]       Additional options to pass to the make*Installer.sh files"
18
+	echo "-b, --branch                       <release> is a branch"
19
+	echo "-p, --plugins <plugins>            Plugins to add to all the jars."
20
+	echo "-pl, --plugins-linux <plugins>     Plugins to linux installer."
21
+	echo "-pw, --plugins-windows <plugins>   Plugins to linux installer."
22
+	echo "-h, --help                         Help information"
23
+	echo "-o, --opt <options>                Additional options to pass to the make*Installer.sh files"
12
 	echo "---------------------"
24
 	echo "---------------------"
13
 	exit 0;
25
 	exit 0;
14
 }
26
 }
20
 while test -n "$1"; do
32
 while test -n "$1"; do
21
 	LAST=${1}
33
 	LAST=${1}
22
 	case "$1" in
34
 	case "$1" in
35
+		--plugins|-p)
36
+			shift
37
+			plugins="${1}"
38
+			;;
39
+		--plugins-linux|-pl)
40
+			shift
41
+			plugins_linux="${1}"
42
+			;;
43
+		--plugins-windows|-pw)
44
+			shift
45
+			plugins_windows="${1}"
46
+			;;
23
 		--opt|-o)
47
 		--opt|-o)
24
 			shift
48
 			shift
25
 			OPT="${1} "
49
 			OPT="${1} "
34
 	shift
58
 	shift
35
 done
59
 done
36
 
60
 
61
+if [ "${plugins}" = "*" -o "${plugins_linux}" = "*" -o "${plugins_windows}" = "*" ]; then
62
+	echo "Something is all.";
63
+	allPlugins=""
64
+	for thisfile in `ls -1 ../plugins/*.jar`; do
65
+		allPlugins=${allPlugins}" ${thisfile##*/}"
66
+	done
67
+	if [ "${plugins}" = "*" ]; then plugins=${allPlugins}; fi
68
+	if [ "${plugins_linux}" = "*" ]; then plugins_linux=${allPlugins}; fi
69
+	if [ "${plugins_windows}" = "*" ]; then plugins_windows=${allPlugins}; fi
70
+fi;
71
+
37
 if [ "${LAST}" != "" ]; then
72
 if [ "${LAST}" != "" ]; then
38
 	if [ "${LAST}" = "trunk" ]; then
73
 	if [ "${LAST}" = "trunk" ]; then
39
 		RELEASE=""
74
 		RELEASE=""
112
 
147
 
113
 cd ${THISDIR}
148
 cd ${THISDIR}
114
 rm -Rf installer_temp
149
 rm -Rf installer_temp
150
+
115
 echo "================================================================"
151
 echo "================================================================"
116
 echo "Building linux installer"
152
 echo "Building linux installer"
117
 echo "================================================================"
153
 echo "================================================================"
118
 cd linux
154
 cd linux
119
-./makeInstallerLinux.sh ${OPT}-c -k ${BRANCH}${RELEASE}
155
+./makeInstallerLinux.sh ${OPT}-c -k ${BRANCH}${RELEASE} -p "${plugins} ${plugins_linux}"
120
 cd ${THISDIR}
156
 cd ${THISDIR}
121
 
157
 
122
 echo "================================================================"
158
 echo "================================================================"
123
 echo "Building Windows installer"
159
 echo "Building Windows installer"
124
 echo "================================================================"
160
 echo "================================================================"
125
 cd windows
161
 cd windows
126
-./makeInstallerWindows.sh ${OPT}-k -s ${BRANCH}${RELEASE}
162
+./makeInstallerWindows.sh ${OPT}-k -s ${BRANCH}${RELEASE} -p "${plugins} ${plugins_windows}"
127
 cd ${THISDIR}
163
 cd ${THISDIR}
128
 
164
 
129
 MD5BIN=`which md5sum`
165
 MD5BIN=`which md5sum`

+ 25
- 5
installer/windows/makeInstallerWindows.sh View File

94
 signEXE="true"
94
 signEXE="true"
95
 compilerFlags=""
95
 compilerFlags=""
96
 BRANCH="0"
96
 BRANCH="0"
97
+plugins=""
97
 location="../../../"
98
 location="../../../"
98
 
99
 
99
 showHelp() {
100
 showHelp() {
101
 	echo "The following command line arguments are known:"
102
 	echo "The following command line arguments are known:"
102
 	echo "---------------------"
103
 	echo "---------------------"
103
 	echo "-h, --help                Help information"
104
 	echo "-h, --help                Help information"
104
-	echo "-r, --release [version]   Generate a file based on an svn tag (or branch with -b aswell)"
105
+	echo "-r, --release <version>   Generate a file based on an svn tag (or branch with -b aswell)"
105
 	echo "-b, --branch              Release in -r is a branch "
106
 	echo "-b, --branch              Release in -r is a branch "
106
 	echo "-s, --setup               Recompile the .exe file"
107
 	echo "-s, --setup               Recompile the .exe file"
107
 	echo "-e,                       If setup.exe compile fails, use old version"
108
 	echo "-e,                       If setup.exe compile fails, use old version"
109
+	echo "-p, --plugins <plugins>   What plugins to add to the jar file"
108
 	echo "-c, --compile             Recompile the .jar file"
110
 	echo "-c, --compile             Recompile the .jar file"
109
 	echo "-u, --unsigned            Don't sign the exe"
111
 	echo "-u, --unsigned            Don't sign the exe"
110
-	echo "-t, --tag [tag]           Tag to add to final exe name to distinguish this build from a standard build"
111
-	echo "-f, --flags [flags]       Extra flags to pass to the compiler"	
112
+	echo "-t, --tag <tag>           Tag to add to final exe name to distinguish this build from a standard build"
113
+	echo "-f, --flags <flags>       Extra flags to pass to the compiler"	
112
 # This is not in the help cos its crappy really, and makes little/no difference to the
114
 # This is not in the help cos its crappy really, and makes little/no difference to the
113
 # exe size unless debugging information is added using --flags, in which case the person
115
 # exe size unless debugging information is added using --flags, in which case the person
114
 # probably is Dataforce and knows about this flag anyway
116
 # probably is Dataforce and knows about this flag anyway
122
 
124
 
123
 while test -n "$1"; do
125
 while test -n "$1"; do
124
 	case "$1" in
126
 	case "$1" in
127
+		--plugins|-p)
128
+			shift
129
+			plugins=${1}
130
+			;;
125
 		--compile|-c)
131
 		--compile|-c)
126
 			compileJar="true"
132
 			compileJar="true"
127
 			;;
133
 			;;
197
 	cd ${OLDPWD}
203
 	cd ${OLDPWD}
198
 fi;
204
 fi;
199
 
205
 
200
-echo "Linking jar.."
201
-ln -s ${jarPath}"/dist/DMDirc.jar" "./DMDirc.jar"
206
+if [ "" = "${plugins}" ]; then
207
+	echo "Linking jar.."
208
+	ln -s ${jarPath}"/dist/DMDirc.jar" "./DMDirc.jar"
209
+else
210
+	echo "Copying jar.."
211
+	cp ${jarPath}"/dist/DMDirc.jar" "./DMDirc.jar"
212
+	
213
+	echo "Adding plugins to jar"
214
+	ln -s ${jarPath}"/plugins"
215
+	pluginList=""
216
+	for plugin in ${plugins}; do
217
+		pluginList=${pluginList}" plugins/${plugin}"
218
+	done
219
+	jar -uvf "DMDirc.jar" ${pluginList}
220
+	rm -Rf plugins;
221
+fi
202
 
222
 
203
 FILES="DMDirc.jar Setup.exe";
223
 FILES="DMDirc.jar Setup.exe";
204
 if [ ! -e "Setup.exe"  -o "${compileSetup}" = "true" ]; then
224
 if [ ! -e "Setup.exe"  -o "${compileSetup}" = "true" ]; then

Loading…
Cancel
Save