3 | | = Squeak FAQ = |
4 | | |
| 3 | = Squeak FAQ (Stand WiSe 21/22) = |
| 4 | |
| 5 | == Wie erstellt man ein .sar für die Abgabe? == |
| 6 | |
| 7 | {{{ |
| 8 | "Insert your info here" |
| 9 | sarname := 'MyProject'. |
| 10 | packages := {'BaselineOfMyProject'. 'MyProject-UI'. 'MyProject-Core'}. |
| 11 | folders := {'MyData'. 'MyData2'}. |
| 12 | |
| 13 | "init" |
| 14 | preambleContent := ''. zip := ZipArchive new. |
| 15 | |
| 16 | "add packages" |
| 17 | packages do: [:package | mczStream := RWBinaryOrTextStream on: (String new: 10000). |
| 18 | workingCopy := MCWorkingCopy forPackage: (MCPackage new name: package). |
| 19 | version := workingCopy newVersion fileOutOn: mczStream. |
| 20 | (zip addString: mczStream contents as: package, '.mcz') desiredCompressionLevel: 0. |
| 21 | preambleContent := preambleContent, 'self fileInMonticelloZipVersionNamed: ''' , package, '.mcz''.', String cr]. |
| 22 | |
| 23 | "add folders" |
| 24 | folders do: [:folder | |
| 25 | zip addTree: Smalltalk imagePath match: [:e | e fullName beginsWith: Smalltalk imagePath , FileDirectory slash , folder]. |
| 26 | preambleContent := preambleContent, '(self membersMatching: ''' , folder, ''', FileDirectory slash, ''*.*'') do: [ :f | self extractMember: f].', String cr.]. |
| 27 | |
| 28 | "only add one preamble!" |
| 29 | zip addString: preambleContent as: 'install/preamble'. |
| 30 | |
| 31 | "write sar" |
| 32 | zip writeToFileNamed: sarname , '.sar'. |
| 33 | }}} |
| 34 | |
| 35 | == GameMecha == |
| 36 | |
| 37 | WIP |
| 38 | |
| 39 | == Wie füge ich einer Systemklasse eine Methode hinzu (z.B. isMario zu Morph)? == |
| 40 | |
| 41 | WIP |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | = Squeak FAQ Archiv = |