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,10 +51,11 @@ showHelp() {
51 51
 	echo "The following command line arguments are known:"
52 52
 	echo "---------------------"
53 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 55
 	echo "-b, --branch              Release in -r is a branch "
56
+	echo "-p, --plugins <plugins>   What plugins to add to the jar file"
56 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 59
 	echo "-k, --keep                Keep the existing source tree when compiling"
59 60
 	echo "                          (don't svn update beforehand)"
60 61
 	echo "---------------------"
@@ -67,9 +68,14 @@ updateSVN="true"
67 68
 isRelease=""
68 69
 finalTag=""
69 70
 BRANCH="0"
71
+plugins=""
70 72
 location="../../../"
71 73
 while test -n "$1"; do
72 74
 	case "$1" in
75
+		--plugins|-p)
76
+			shift
77
+			plugins=${1}
78
+			;;
73 79
 		--compile|-c)
74 80
 			compileJar="true"
75 81
 			;;
@@ -129,8 +135,22 @@ if [ ! -e ${jarPath}"/dist/DMDirc.jar" -o "${compileJar}" = "true" ]; then
129 135
 	cd ${OLDPWD}
130 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 155
 echo "Creating .run file"
136 156
 echo "Adding stub.."

+ 41
- 5
installer/release.sh View File

@@ -1,14 +1,26 @@
1 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 12
 showHelp() {
4 13
 	echo "This will generate the different DMDirc installers."
5 14
 	echo "Usage: ${0} [params] <release>"
6 15
 	echo "Release can be either 'trunk', a valid tag, or a branch (if -b is passed)"
7 16
 	echo "The following params are known:"
8 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 24
 	echo "---------------------"
13 25
 	exit 0;
14 26
 }
@@ -20,6 +32,18 @@ BRANCH=""
20 32
 while test -n "$1"; do
21 33
 	LAST=${1}
22 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 47
 		--opt|-o)
24 48
 			shift
25 49
 			OPT="${1} "
@@ -34,6 +58,17 @@ while test -n "$1"; do
34 58
 	shift
35 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 72
 if [ "${LAST}" != "" ]; then
38 73
 	if [ "${LAST}" = "trunk" ]; then
39 74
 		RELEASE=""
@@ -112,18 +147,19 @@ fi
112 147
 
113 148
 cd ${THISDIR}
114 149
 rm -Rf installer_temp
150
+
115 151
 echo "================================================================"
116 152
 echo "Building linux installer"
117 153
 echo "================================================================"
118 154
 cd linux
119
-./makeInstallerLinux.sh ${OPT}-c -k ${BRANCH}${RELEASE}
155
+./makeInstallerLinux.sh ${OPT}-c -k ${BRANCH}${RELEASE} -p "${plugins} ${plugins_linux}"
120 156
 cd ${THISDIR}
121 157
 
122 158
 echo "================================================================"
123 159
 echo "Building Windows installer"
124 160
 echo "================================================================"
125 161
 cd windows
126
-./makeInstallerWindows.sh ${OPT}-k -s ${BRANCH}${RELEASE}
162
+./makeInstallerWindows.sh ${OPT}-k -s ${BRANCH}${RELEASE} -p "${plugins} ${plugins_windows}"
127 163
 cd ${THISDIR}
128 164
 
129 165
 MD5BIN=`which md5sum`

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

@@ -94,6 +94,7 @@ finalTag=""
94 94
 signEXE="true"
95 95
 compilerFlags=""
96 96
 BRANCH="0"
97
+plugins=""
97 98
 location="../../../"
98 99
 
99 100
 showHelp() {
@@ -101,14 +102,15 @@ showHelp() {
101 102
 	echo "The following command line arguments are known:"
102 103
 	echo "---------------------"
103 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 106
 	echo "-b, --branch              Release in -r is a branch "
106 107
 	echo "-s, --setup               Recompile the .exe file"
107 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 110
 	echo "-c, --compile             Recompile the .jar file"
109 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 114
 # This is not in the help cos its crappy really, and makes little/no difference to the
113 115
 # exe size unless debugging information is added using --flags, in which case the person
114 116
 # probably is Dataforce and knows about this flag anyway
@@ -122,6 +124,10 @@ showHelp() {
122 124
 
123 125
 while test -n "$1"; do
124 126
 	case "$1" in
127
+		--plugins|-p)
128
+			shift
129
+			plugins=${1}
130
+			;;
125 131
 		--compile|-c)
126 132
 			compileJar="true"
127 133
 			;;
@@ -197,8 +203,22 @@ if [ ! -e ${jarPath}"/dist/DMDirc.jar" -o "${compileJar}" = "true" ]; then
197 203
 	cd ${OLDPWD}
198 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 223
 FILES="DMDirc.jar Setup.exe";
204 224
 if [ ! -e "Setup.exe"  -o "${compileSetup}" = "true" ]; then

Loading…
Cancel
Save