author | Claus Gittinger <cg@exept.de> |
Thu, 28 Mar 2013 00:05:48 +0100 | |
changeset 769 | 6a647dbd3630 |
parent 759 | fc131485692e |
child 771 | cfb9eb763bc2 |
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 |
|
769 | 32 |
Error handle:[:ex | |
33 |
Dialog information:('Cannot write build support files because:\\',ex description,'\\Writing source files only.') withCRs. |
|
34 |
^ self |
|
35 |
] do:[ |
|
36 |
aProjectDefinition forEachFileNameAndGeneratedContentsDo:[:file :contents | |
|
37 |
self addString: contents at: 'snapshot.stx/', file. |
|
38 |
]. |
|
39 |
] |
|
738 | 40 |
! |
41 |
||
42 |
writeIndividualSourceFiles:aVersion for:aProjectDefinition |
|
43 |
"individual source files for dll compilation" |
|
44 |
||
45 |
aProjectDefinition classNames do:[:eachClassName | |
|
46 |
|cls fileName source| |
|
47 |
||
48 |
cls := Smalltalk classNamed:eachClassName. |
|
49 |
cls isNil ifTrue:[ |
|
50 |
Transcript showCR:'class missing: ',eachClassName |
|
51 |
] ifFalse:[ |
|
52 |
cls autoload. |
|
53 |
||
54 |
fileName := (Smalltalk fileNameForClass:cls),'.st'. |
|
55 |
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
|
56 |
self addString: source at: 'snapshot.stx/', fileName. |
738 | 57 |
] |
58 |
]. |
|
59 |
! |
|
60 |
||
61 |
writeResourceFiles:aVersion for:aProjectDefinition |
|
62 |
"language translations kept in externalfiles" |
|
63 |
||
64 |
|dir rsrcDir| |
|
65 |
||
769 | 66 |
dir := aProjectDefinition projectDirectory. |
67 |
dir isNil ifTrue:[ |
|
68 |
"/ no directory - no resource files |
|
69 |
^ self. |
|
70 |
]. |
|
71 |
(rsrcDir := dir asFilename / 'resources') exists ifTrue:[ |
|
738 | 72 |
rsrcDir recursiveDirectoryContentsDo:[:relFn | |
73 |
(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
|
74 |
self addString: ((rsrcDir construct:relFn) contentsOfEntireFile) at: 'snapshot.stx/resources/', relFn. |
738 | 75 |
] |
76 |
]. |
|
77 |
]. |
|
78 |
! |
|
79 |
||
759 | 80 |
writeSnapshot: aSnapshot forVersion: aVersion |
81 |
|source| |
|
82 |
||
83 |
source := |
|
84 |
('"{ Package: ''%1'' }" !!\\' withCRs bindWith:aVersion package name) |
|
85 |
, (self serializeDefinitions: aSnapshot definitions). |
|
86 |
||
87 |
self addString: source at: 'snapshot/source.', self snapshotWriterClass extension. |
|
738 | 88 |
"/ I whink, we can comment the following (or is it compatible?) |
89 |
self addString: (self serializeInBinary: aSnapshot) at: 'snapshot.bin' |
|
90 |
! |
|
91 |
||
92 |
writeVersion: aVersion |
|
93 |
|packageID prjDef| |
|
94 |
||
743
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
95 |
super writeVersion: aVersion. |
738 | 96 |
|
743
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
97 |
aVersion snapshot includeExtrasForSTX ifTrue:[ |
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
98 |
"/ ST/X specific stuff here. |
738 | 99 |
|
743
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
100 |
packageID := aVersion package name. |
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
101 |
prjDef := ProjectDefinition definitionClassForPackage:packageID. |
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
102 |
prjDef isNil ifTrue:[ |
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
103 |
"/ 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
|
104 |
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
|
105 |
] ifFalse:[ |
a43cc4d9b6dc
option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents:
738
diff
changeset
|
106 |
"/ 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
|
107 |
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
|
108 |
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
|
109 |
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
|
110 |
] |
738 | 111 |
] |
112 |
! ! |
|
113 |
||
114 |
!MCStxMczWriter class methodsFor:'documentation'! |
|
115 |
||
116 |
version |
|
769 | 117 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCStxMczWriter.st,v 1.4 2013-03-27 23:05:48 cg Exp $' |
738 | 118 |
! |
119 |
||
120 |
version_CVS |
|
769 | 121 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCStxMczWriter.st,v 1.4 2013-03-27 23:05:48 cg Exp $' |
738 | 122 |
! ! |
123 |