-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCuis-University-InstallerBuilder.pck.st
351 lines (260 loc) · 10.8 KB
/
Cuis-University-InstallerBuilder.pck.st
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
'From Cuis 6.0 [latest update: #5688] on 30 March 2024 at 5:56:48 pm'!
'Description Update with version 6291'!
!provides: 'Cuis-University-InstallerBuilder' 1 19!
SystemOrganization addCategory: 'Cuis-University-InstallerBuilder'!
!classDefinition: #CuisInstallerBuilder category: 'Cuis-University-InstallerBuilder'!
Object subclass: #CuisInstallerBuilder
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Cuis-University-InstallerBuilder'!
!classDefinition: 'CuisInstallerBuilder class' category: 'Cuis-University-InstallerBuilder'!
CuisInstallerBuilder class
instanceVariableNames: 'nameWithMajorVersionNumber'!
!CuisInstallerBuilder class methodsFor: 'version number' stamp: 'HAW 1/17/2024 11:26:03'!
cuisVersionNumberIn: aDirName
| cuisSmalltalkDevDir fileNames imageName versionNumber imageNameSplited |
cuisSmalltalkDevDir := aDirName asDirectoryEntry.
fileNames := (cuisSmalltalkDevDir fileNamesMatching: 'Cuis*.image') asSortedCollection: [:fileNameLeft :fileNameRight | fileNameLeft size < fileNameRight size ].
fileNames isEmpty ifTrue: [ self error: 'Image file not found' ].
imageName := fileNames first.
imageNameSplited := imageName findTokens: '-'.
nameWithMajorVersionNumber := imageNameSplited first.
versionNumber := (imageNameSplited second findTokens: '.') first.
^versionNumber ! !
!CuisInstallerBuilder class methodsFor: 'version number' stamp: 'HAW 3/30/2024 17:13:49'!
cuisVersionNumberInCuisDev
^self cuisVersionNumberIn: (self cuisSmalltalkDevDirName, self cuisImageDirName)
! !
!CuisInstallerBuilder class methodsFor: 'version number' stamp: 'HAW 10/29/2019 19:40:04'!
cuisVersionNumberInLocalDir
^self cuisVersionNumberIn: '.'
! !
!CuisInstallerBuilder class methodsFor: 'script generation' stamp: 'HAW 3/30/2024 17:55:53'!
add64BitUpdateLineTo: fileStream with: versionNumber
self assertNameWithMajorVersionNumberIsDefined.
self
addExecutionOf: '../../Installer/updateImage.st'
to: fileStream
vmPath: '../CuisVM.app/Contents/MacOS/Squeak'
imageNameHead: nameWithMajorVersionNumber, '-'
imageNameTail: ''
with: versionNumber.! !
!CuisInstallerBuilder class methodsFor: 'script generation' stamp: 'HAW 1/17/2024 11:27:55'!
assertNameWithMajorVersionNumberIsDefined
nameWithMajorVersionNumber ifNil: [ self error: 'nameWithMajorVersionNumber no está definido' ]! !
!CuisInstallerBuilder class methodsFor: 'script generation' stamp: 'HAW 3/30/2024 17:39:39'!
generate64BitImageBuilderScriptWith: versionNumber
"self generate64BitImageBuilderScriptWith: '3283'"
self
generate: '2-build64Image.sh'
vmPath: '../Cuis-Smalltalk-Dev/CuisVM.app/Contents/MacOS/Squeak'
liveTypingVMPath: '../SqueakLiveTyping.app/Contents/MacOS/Squeak'
imageNameTail: ''
platforms: #('macos64' 'linux64' 'windows64')
pathSeparator: '/'
with: versionNumber
! !
!CuisInstallerBuilder class methodsFor: 'script generation' stamp: 'HAW 3/30/2024 17:43:21'!
generateRunScriptsWith: versionNumber
self generateWindow64RunScriptWith: versionNumber.
self generateLinux64RunScriptWith: versionNumber.
self generateMacOs64RunScriptWith: versionNumber.
! !
!CuisInstallerBuilder class methodsFor: 'script generation' stamp: 'HAW 3/30/2024 17:38:47'!
generateScripts
"self generateScripts"
| versionNumber |
versionNumber := self cuisVersionNumberInLocalDir.
self
generate64BitImageBuilderScriptWith: versionNumber;
generateRunScriptsWith: versionNumber;
generateZipScript
! !
!CuisInstallerBuilder class methodsFor: 'script generation' stamp: 'HAW 3/14/2023 14:21:13'!
generateScriptsAndExit
self generateScripts.
Smalltalk saveAndQuit ! !
!CuisInstallerBuilder class methodsFor: 'script generation' stamp: 'HAW 3/14/2023 14:23:51'!
generateUpdateImagesScriptAndExit
self generateUpdateImagesScriptWith: self cuisVersionNumberInCuisDev.
Smalltalk saveAndQuit ! !
!CuisInstallerBuilder class methodsFor: 'script generation' stamp: 'HAW 3/30/2024 17:25:37'!
generateUpdateImagesScriptWith: versionNumber
"self generateUpdateImagesScriptWith: '3283'"
| fileStream |
fileStream := UniFileStream new
open: 'updateImages.sh'
forWrite: true.
fileStream ifNil: [ self error: 'Could not create updateImages.sh' ].
[ fileStream truncate.
fileStream nextPutAll: 'cd '; nextPutAll: self cuisSmalltalkDevDirName; nextPutAll: self cuisImageDirName; newLine.
self add64BitUpdateLineTo: fileStream with: versionNumber.
fileStream newLine ]
ensure: [ fileStream close ].
! !
!CuisInstallerBuilder class methodsFor: 'script generation' stamp: 'HAW 3/30/2024 17:46:57'!
generateZipScript
| fileStream |
fileStream := UniFileStream new
open: '4-zip.sh'
forWrite: true.
fileStream ifNil: [ self error: 'Could not create zip script file' ].
[ fileStream
truncate;
nextPutAll: 'zip -r macos64 macos64';
newLine;
nextPutAll: 'zip -r windows64 windows64';
newLine;
nextPutAll: 'tar czf linux64.tar.gz linux64';
newLine] ensure: [ fileStream close ].
! !
!CuisInstallerBuilder class methodsFor: 'script generation - private' stamp: 'HAW 4/15/2018 20:25:09'!
addCopyImageTo: fileStream on: osDir imageNameTail: tail pathSeparator: pathSeparator with: versionNumber
fileStream
newLine;
nextPutAll: (pathSeparator = '/' ifTrue: [ 'rm '] ifFalse: [ 'del ' ]);
nextPutAll: osDir;
nextPutAll: pathSeparator;
nextPutAll: '*.image';
newLine;
nextPutAll: (pathSeparator = '/' ifTrue: [ 'rm '] ifFalse: [ 'del ' ]);
nextPutAll: osDir;
nextPutAll: pathSeparator;
nextPutAll: '*.changes';
newLine;
nextPutAll: (pathSeparator = '/' ifTrue: [ 'cp'] ifFalse: [ 'copy' ]);
nextPutAll: ' CuisUniversity-';
nextPutAll: versionNumber;
nextPutAll: tail;
nextPutAll: '.* ';
nextPutAll: osDir ! !
!CuisInstallerBuilder class methodsFor: 'script generation - private' stamp: 'HAW 2/28/2019 23:14:25'!
addExecutionOf: aScriptFileName to: fileStream vmPath: vmPath imageNameHead: header imageNameTail: tail with: versionNumber
fileStream
nextPutAll: vmPath;
nextPut: Character space;
nextPutAll: header;
nextPutAll: versionNumber;
nextPutAll: tail;
nextPutAll: '.image -s ';
nextPutAll: aScriptFileName .! !
!CuisInstallerBuilder class methodsFor: 'script generation - private' stamp: 'HAW 1/17/2024 11:28:55'!
generate: scriptName vmPath: vmPath liveTypingVMPath: liveTypingVMPath imageNameTail: tail platforms: platforms pathSeparator: pathSeparator with: versionNumber
"self generate: '4-build32LinuxImage.sh' vmPath: 'linux32/vm/squeak' imageNameTail: '-V3' platforms: #('linux32') pathSeparator: '/' with: '3283'"
| fileStream |
self assertNameWithMajorVersionNumberIsDefined.
fileStream := UniFileStream new
open: '/Users/hernan/Documents/Cuis/5.0-64Bits/Cuis-University-Installer/', scriptName
forWrite: true.
fileStream ifNil: [ self error: 'Could not create ', scriptName ].
[ fileStream truncate.
self addExecutionOf: 'CuisUniversityInstallation.st' to: fileStream vmPath: vmPath imageNameHead: nameWithMajorVersionNumber, '-' imageNameTail: tail with: versionNumber.
fileStream newLine.
liveTypingVMPath ifNotNil: [
self addExecutionOf: 'CuisUniversityInitializationWithLiveTypingVM.st' to: fileStream vmPath: liveTypingVMPath imageNameHead: 'CuisUniversity-' imageNameTail: tail with: versionNumber ].
platforms do: [ :osDir | self addCopyImageTo: fileStream on: osDir imageNameTail: tail pathSeparator: pathSeparator with: versionNumber]
] ensure: [ fileStream close ].
! !
!CuisInstallerBuilder class methodsFor: 'script generation - private' stamp: 'HAW 3/14/2023 14:19:26'!
generateRunScript: scriptFileName vmPath: vmPath imageNameTail: tail with: versionNumber
"self generateRunScript: macos64/run.sh' vmPath: 'CocoaFast64.app/Contents/MacOS/Squeak' imageNameTail: '' with: '32'"
| fileStream |
fileStream := UniFileStream new
open: '/Users/hernan/Documents/Cuis/5.0-64Bits/Cuis-University-Installer/', scriptFileName
forWrite: true.
fileStream ifNil: [ self error: 'Could not create ', scriptFileName ].
[ fileStream truncate.
(scriptFileName endsWith: '.sh') ifTrue: [
fileStream
nextPutAll: '#!!/bin/bash';
newLine ].
fileStream
nextPutAll: vmPath;
nextPutAll: ' CuisUniversity-';
nextPutAll: versionNumber;
nextPutAll: tail;
nextPutAll: '.image' ] ensure: [ fileStream close ].
! !
!CuisInstallerBuilder class methodsFor: 'directories' stamp: 'HAW 3/30/2024 17:14:08'!
cuisImageDirName
^'/CuisImage'! !
!CuisInstallerBuilder class methodsFor: 'directories' stamp: 'HAW 3/31/2018 15:42:24'!
cuisSmalltalkDevDirName
^'../Cuis-Smalltalk-Dev'! !
!CuisInstallerBuilder class methodsFor: 'run script generation' stamp: 'HAW 3/30/2024 17:43:48'!
generateLinux64RunScriptWith: versionNumber
self
generateRunScript: 'linux64/run.sh'
vmPath: 'vmLiveTyping/squeak'
imageNameTail: ''
with: versionNumber.
self
generateRunScript: 'linux64/run-stack.sh'
vmPath: 'vmLiveTyping-Stack/squeak'
imageNameTail: ''
with: versionNumber.
self
generateRunScript: 'linux64/run-arm.sh'
vmPath: 'vmLiveTyping-ARM/squeak'
imageNameTail: ''
with: versionNumber.
self
generateRunScript: 'linux64/run-jit.sh'
vmPath: 'vm-jit/CuisVM.app'
imageNameTail: ''
with: versionNumber
! !
!CuisInstallerBuilder class methodsFor: 'run script generation' stamp: 'HAW 3/30/2024 17:44:51'!
generateMacOs64RunScriptWith: versionNumber
self
generateRunScript: 'macos64/run.sh'
vmPath: 'SqueakLiveTyping.app/Contents/MacOS/Squeak'
imageNameTail: ''
with: versionNumber.
self
generateRunScript: 'macos64/run-stack.sh'
vmPath: 'SqueakLiveTyping-Stack.app/Contents/MacOS/Squeak'
imageNameTail: ''
with: versionNumber.
self
generateRunScript: 'macos64/run-arm.sh'
vmPath: 'SqueakLiveTyping-ARM.app/Contents/MacOS/Squeak'
imageNameTail: ''
with: versionNumber.
self
generateRunScript: 'macos64/run-jit.sh'
vmPath: 'CuisVM.app/Contents/MacOS/Squeak'
imageNameTail: ''
with: versionNumber! !
!CuisInstallerBuilder class methodsFor: 'run script generation' stamp: 'HAW 1/22/2021 10:44:45'!
generateWindow32RunScriptWith: versionNumber
self
generateRunScript: 'windows32/run.bat'
vmPath: 'vm\squeak'
imageNameTail: '-32'
with: versionNumber.
self
generateRunScript: 'windows32/run-jit.bat'
vmPath: 'vm\squeak-jit'
imageNameTail: '-32'
with: versionNumber
! !
!CuisInstallerBuilder class methodsFor: 'run script generation' stamp: 'HAW 3/30/2024 17:42:54'!
generateWindow64RunScriptWith: versionNumber
self
generateRunScript: 'windows64/run.bat'
vmPath: 'vmLiveTyping\squeak'
imageNameTail: ''
with: versionNumber.
self
generateRunScript: 'windows64/run-stack.bat'
vmPath: 'vmLiveTyping-Stack\squeak'
imageNameTail: ''
with: versionNumber.
self
generateRunScript: 'windows64/run-jit.bat'
vmPath: 'vm-jit\CuisVM.app'
imageNameTail: ''
with: versionNumber.
! !