738
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
MCMczWriter subclass:#MCStxMczWriter
|
|
4 |
instanceVariableNames:''
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'SCM-Monticello-Storing-St/X'
|
|
8 |
!
|
|
9 |
|
|
10 |
!MCStxMczWriter class methodsFor:'documentation'!
|
|
11 |
|
|
12 |
documentation
|
|
13 |
"
|
|
14 |
redefined to add some more stuff to the mcz archive:
|
|
15 |
|
|
16 |
- package pragma to the source code.
|
|
17 |
- stx subdirectory (optional), containing required support files for building
|
|
18 |
plus resource files.
|
|
19 |
- stx.bin subdirectory (optional), containing a precompiled binary dll as per architecture.
|
|
20 |
"
|
|
21 |
! !
|
|
22 |
|
|
23 |
!MCStxMczWriter methodsFor:'accessing'!
|
|
24 |
|
|
25 |
snapshotWriterClass
|
|
26 |
^ MCStxStWriter
|
|
27 |
! !
|
|
28 |
|
|
29 |
!MCStxMczWriter methodsFor:'visiting'!
|
|
30 |
|
|
31 |
writeBuildSupportFiles:aVersion for:aProjectDefinition
|
|
32 |
aProjectDefinition forEachFileNameAndGeneratedContentsDo:[:file :contents |
|
|
33 |
self addString: contents at: 'snapshot/stx/', file.
|
|
34 |
].
|
|
35 |
!
|
|
36 |
|
|
37 |
writeIndividualSourceFiles:aVersion for:aProjectDefinition
|
|
38 |
"individual source files for dll compilation"
|
|
39 |
|
|
40 |
aProjectDefinition classNames do:[:eachClassName |
|
|
41 |
|cls fileName source|
|
|
42 |
|
|
43 |
cls := Smalltalk classNamed:eachClassName.
|
|
44 |
cls isNil ifTrue:[
|
|
45 |
Transcript showCR:'class missing: ',eachClassName
|
|
46 |
] ifFalse:[
|
|
47 |
cls autoload.
|
|
48 |
|
|
49 |
fileName := (Smalltalk fileNameForClass:cls),'.st'.
|
|
50 |
source := String streamContents:[:s | cls fileOutOn:s withTimeStamp:false].
|
|
51 |
self addString: source at: 'snapshot/stx/', fileName.
|
|
52 |
]
|
|
53 |
].
|
|
54 |
!
|
|
55 |
|
|
56 |
writeResourceFiles:aVersion for:aProjectDefinition
|
|
57 |
"language translations kept in externalfiles"
|
|
58 |
|
|
59 |
|dir rsrcDir|
|
|
60 |
|
|
61 |
dir := aProjectDefinition projectDirectory asFilename.
|
|
62 |
(rsrcDir := dir / 'resources') exists ifTrue:[
|
|
63 |
rsrcDir recursiveDirectoryContentsDo:[:relFn |
|
|
64 |
(rsrcDir construct:relFn) isDirectory ifFalse:[
|
|
65 |
self addString: ((rsrcDir construct:relFn) contentsOfEntireFile) at: 'snapshot/stx/resources/', relFn.
|
|
66 |
]
|
|
67 |
].
|
|
68 |
].
|
|
69 |
!
|
|
70 |
|
|
71 |
writeSnapshot: aSnapshot
|
|
72 |
self addString: (self serializeDefinitions: aSnapshot definitions) at: 'snapshot/source.', self snapshotWriterClass extension.
|
|
73 |
"/ I whink, we can comment the following (or is it compatible?)
|
|
74 |
self addString: (self serializeInBinary: aSnapshot) at: 'snapshot.bin'
|
|
75 |
!
|
|
76 |
|
|
77 |
writeVersion: aVersion
|
|
78 |
|packageID prjDef|
|
|
79 |
|
|
80 |
self writeVersion: aVersion.
|
|
81 |
|
|
82 |
"/ ST/X specific stuff here.
|
|
83 |
|
|
84 |
packageID := aVersion package name.
|
|
85 |
prjDef := ProjectDefinition definitionClassForPackage:packageID.
|
|
86 |
prjDef isNil ifTrue:[
|
|
87 |
"/ not a project definition mcz - simply skip
|
|
88 |
Transcript show:'No projectDefinition for ',packageID, ' generated simple source only'.
|
|
89 |
] ifFalse:[
|
|
90 |
"/ additional support files for recompilation...
|
|
91 |
self writeIndividualSourceFiles: aVersion for: prjDef.
|
|
92 |
self writeBuildSupportFiles: aVersion for: prjDef.
|
|
93 |
self writeResourceFiles: aVersion for: prjDef.
|
|
94 |
]
|
|
95 |
! !
|
|
96 |
|
|
97 |
!MCStxMczWriter class methodsFor:'documentation'!
|
|
98 |
|
|
99 |
version
|
|
100 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCStxMczWriter.st,v 1.1 2013-03-21 16:40:03 cg Exp $'
|
|
101 |
!
|
|
102 |
|
|
103 |
version_CVS
|
|
104 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCStxMczWriter.st,v 1.1 2013-03-21 16:40:03 cg Exp $'
|
|
105 |
! !
|
|
106 |
|