author | Claus Gittinger <cg@exept.de> |
Thu, 21 Mar 2013 18:25:28 +0100 | |
changeset 743 | a43cc4d9b6dc |
parent 738 | 85d0afcc16e3 |
child 759 | fc131485692e |
permissions | -rw-r--r-- |
738 | 1 |
"{ Package: 'stx:goodies/monticello' }" |
2 |
||
3 |
MCMczWriter subclass:#MCStxMczWriter |
|
4 |
instanceVariableNames:'' |
|
5 |
classVariableNames:'' |
|
6 |
poolDictionaries:'' |
|
743
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
7 |
category:'SCM-Monticello-St/X Storing' |
738 | 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 | |
|
743
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
33 |
self addString: contents at: 'snapshot.stx/', file. |
738 | 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]. |
|
743
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
51 |
self addString: source at: 'snapshot.stx/', fileName. |
738 | 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:[ |
|
743
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
65 |
self addString: ((rsrcDir construct:relFn) contentsOfEntireFile) at: 'snapshot.stx/resources/', relFn. |
738 | 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 |
||
743
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
80 |
super writeVersion: aVersion. |
738 | 81 |
|
743
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
82 |
aVersion snapshot includeExtrasForSTX ifTrue:[ |
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
83 |
"/ ST/X specific stuff here. |
738 | 84 |
|
743
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
85 |
packageID := aVersion package name. |
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
86 |
prjDef := ProjectDefinition definitionClassForPackage:packageID. |
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
87 |
prjDef isNil ifTrue:[ |
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
88 |
"/ not a project definition mcz - simply skip |
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
89 |
Transcript show:'No projectDefinition for ',packageID, ' generated simple source only'. |
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
90 |
] ifFalse:[ |
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
91 |
"/ additional support files for recompilation... |
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
92 |
self writeIndividualSourceFiles: aVersion for: prjDef. |
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
93 |
self writeBuildSupportFiles: aVersion for: prjDef. |
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
94 |
self writeResourceFiles: aVersion for: prjDef. |
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
95 |
] |
738 | 96 |
] |
97 |
! ! |
|
98 |
||
99 |
!MCStxMczWriter class methodsFor:'documentation'! |
|
100 |
||
101 |
version |
|
743
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
102 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCStxMczWriter.st,v 1.2 2013-03-21 17:25:28 cg Exp $' |
738 | 103 |
! |
104 |
||
105 |
version_CVS |
|
743
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
106 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCStxMczWriter.st,v 1.2 2013-03-21 17:25:28 cg Exp $' |
738 | 107 |
! ! |
108 |