class: Tools::NewSystemBrowser
added: #projectMenuFileOutVSEFormatAs
changed: #projectMenuFileOutAsWithFormat:
--- a/Tools__NewSystemBrowser.st Fri Jan 16 15:42:04 2015 +0100
+++ b/Tools__NewSystemBrowser.st Tue Jan 20 14:18:44 2015 +0100
@@ -39331,7 +39331,6 @@
"Modified: / 28-02-2012 / 16:27:44 / cg"
! !
-
!NewSystemBrowser methodsFor:'menu actions-namespace'!
nameSpaceMenuCheckOut
@@ -41337,43 +41336,43 @@
selectedProjects := self selectedProjectsValue.
currentProject := self theSingleSelectedProject.
currentProject notNil ifTrue:[
- fileName := currentProject asString copy replaceAny:' :/' with:$_.
- ] ifFalse:[
- fileName := 'someProjects'
+ fileName := currentProject asString copy replaceAny:' :/' with:$_.
+ ] ifFalse:[
+ fileName := 'someProjects'
].
aFormatSymbolOrNil == #cypress ifTrue:[
- suffix := ''.
- ] ifFalse:[
- aFormatSymbolOrNil == #sif ifTrue:[
- suffix := '.sif'
- ] ifFalse:[
- aFormatSymbolOrNil == #binary ifTrue:[
- suffix := '.cls'
- ] ifFalse:[
- aFormatSymbolOrNil == #vsePackage ifTrue:[
- suffix := '.pkg'
- ] ifFalse:[
- suffix := '.st'
- ]
- ]
- ]
+ suffix := ''.
+ ] ifFalse:[
+ aFormatSymbolOrNil == #sif ifTrue:[
+ suffix := '.sif'
+ ] ifFalse:[
+ aFormatSymbolOrNil == #binary ifTrue:[
+ suffix := '.cls'
+ ] ifFalse:[
+ aFormatSymbolOrNil == #vsePackage ifTrue:[
+ suffix := '.pkg'
+ ] ifFalse:[
+ suffix := '.st'
+ ]
+ ]
+ ]
].
fileName := fileName , suffix.
aFormatSymbolOrNil == #binary ifTrue:[
- self error:'binary must go into separate files' mayProceed:true.
- ^ self
+ self error:'binary must go into separate files' mayProceed:true.
+ ^ self
].
aFormatSymbolOrNil == #cypress ifTrue:[
- saveName := Dialog
- requestDirectoryName: (resources string:'FileOut %1 in:' with:(currentProject ? 'selected projects'))
- default: LastCypressDirectory.
- ] ifFalse:[
- saveName := Dialog
- requestFileNameForSave:(resources string:'FileOut %1 as:' with:(currentProject ? 'selected projects'))
- default:fileName
- fromDirectory:(FileSelectionBox lastFileSelectionDirectory).
+ saveName := Dialog
+ requestDirectoryName: (resources string:'FileOut %1 in:' with:(currentProject ? 'selected projects'))
+ default: LastCypressDirectory.
+ ] ifFalse:[
+ saveName := Dialog
+ requestFileNameForSave:(resources string:'FileOut %1 as:' with:(currentProject ? 'selected projects'))
+ default:fileName
+ fromDirectory:(FileSelectionBox lastFileSelectionDirectory).
].
"/ fileBox := FileSelectionBox
@@ -41393,76 +41392,88 @@
"/ fileBox := nil.
saveName isEmptyOrNil ifTrue:[
- ^ self
+ ^ self
].
FileSelectionBox lastFileSelectionDirectory:(saveName asFilename directoryName).
fileName := saveName.
aFormatSymbolOrNil == #sif ifTrue:[
- SmalltalkInterchangeSTXFileOutManager initialize.
- mgr := SmalltalkInterchangeFileManager newForFileOut.
- mgr fileName: fileName.
- self selectedProjectClasses do:[:eachClass |
- mgr addClass:eachClass.
- ].
- Smalltalk allClassesDo:[:eachClass |
- eachClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
- |mPckg|
-
- mPckg := mthd package.
- mPckg ~= eachClass package ifTrue:[
- (selectedProjects includes:mPckg) ifTrue:[
- mgr addMethodNamed:mthd selector ofClass:mthd mclass
- ]
- ]
- ]
- ].
- self busyLabel:'writing...'.
- mgr fileOut.
- self normalLabel.
- ^ self
+ SmalltalkInterchangeSTXFileOutManager initialize.
+ mgr := SmalltalkInterchangeFileManager newForFileOut.
+ mgr fileName: fileName.
+ self selectedProjectClasses do:[:eachClass |
+ mgr addClass:eachClass.
+ ].
+ Smalltalk allClassesDo:[:eachClass |
+ eachClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
+ |mPckg|
+
+ mPckg := mthd package.
+ mPckg ~= eachClass package ifTrue:[
+ (selectedProjects includes:mPckg) ifTrue:[
+ mgr addMethodNamed:mthd selector ofClass:mthd mclass
+ ]
+ ]
+ ]
+ ].
+ self busyLabel:'writing...'.
+ mgr fileOut.
+ self normalLabel.
+ ^ self
].
(aFormatSymbolOrNil isNil or:[aFormatSymbolOrNil == #vse]) ifTrue:[
- self busyLabel:'writing...'.
- s := fileName asFilename writeStream.
- aFormatSymbolOrNil == #vse ifTrue:[
- s lineEndCRLF
- ].
- classesToFileout := OrderedCollection withAll:(self selectedProjectClasses).
- classesToFileout topologicalSort:[:a :b | b isSubclassOf:a].
-
- classesToFileout do:[:eachClass |
- eachClass fileOutOn:s.
- ].
-
- "/ fileout extensions
- Smalltalk allClassesDo:[:eachClass |
- eachClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
- |mPckg|
-
- mPckg := mthd package.
- (mPckg = currentProject and:[mPckg ~= eachClass package]) ifTrue:[
- eachClass
- fileOutCategory:mthd category
- methodFilter:[:m | m == mthd]
- on:s.
- s cr.
- ]
- ]
- ].
- s close.
- self normalLabel.
- ^ self.
+ self busyLabel:'writing...'.
+ s := fileName asFilename writeStream.
+ ((aFormatSymbolOrNil == #vse) or:[aFormatSymbolOrNil == #vsePackage]) ifTrue:[
+ s lineEndCRLF
+ ].
+ classesToFileout := OrderedCollection withAll:(self selectedProjectClasses).
+ classesToFileout topologicalSort:[:a :b | b isSubclassOf:a].
+
+ AbstractSourceFileWriter methodSourceRewriteQuery handle:[:rewriteQuery |
+ |method source|
+
+ method := rewriteQuery method.
+ source := rewriteQuery source.
+ ((aFormatSymbolOrNil == #vse) or:[aFormatSymbolOrNil == #vsePackage]) ifTrue:[
+ source := VSESourceRewriter rewriteMethod:method.
+ rewriteQuery proceedWith:source.
+ ].
+ rewriteQuery proceedWith:source
+ ] do:[
+ classesToFileout do:[:eachClass |
+ eachClass fileOutOn:s.
+ ].
+
+ "/ fileout extensions
+ Smalltalk allClassesDo:[:eachClass |
+ eachClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
+ |mPckg|
+
+ mPckg := mthd package.
+ (mPckg = currentProject and:[mPckg ~= eachClass package]) ifTrue:[
+ eachClass
+ fileOutCategory:mthd category
+ methodFilter:[:m | m == mthd]
+ on:s.
+ s cr.
+ ]
+ ]
+ ].
+ ].
+ s close.
+ self normalLabel.
+ ^ self.
].
aFormatSymbolOrNil == #cypress ifTrue:[
- mgr := (Smalltalk at:#CypressRepository) on: saveName.
- self showMessage: (resources string:'Writing Cypress package...')
- while: [ selectedProjects do:[:each | mgr write: each ] ]
- inBackground: true.
- LastCypressDirectory := saveName.
- ^ self
+ mgr := (Smalltalk at:#CypressRepository) on: saveName.
+ self showMessage: (resources string:'Writing Cypress package...')
+ while: [ selectedProjects do:[:each | mgr write: each ] ]
+ inBackground: true.
+ LastCypressDirectory := saveName.
+ ^ self
].
@@ -41636,6 +41647,10 @@
self projectMenuFileOutAsWithFormat:#vse
!
+projectMenuFileOutVSEFormatAs
+ self projectMenuFileOutAsWithFormat:#vse
+!
+
projectMenuFileOutVSEPackageFormatAs
"fileOut selected projects - visual smalltalk enterprise format"
@@ -61931,11 +61946,11 @@
!NewSystemBrowser class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.2154 2015-01-14 15:01:08 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.2155 2015-01-20 13:18:44 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.2154 2015-01-14 15:01:08 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.2155 2015-01-20 13:18:44 cg Exp $'
!
version_HG
@@ -61944,7 +61959,7 @@
!
version_SVN
- ^ '$Id: Tools__NewSystemBrowser.st,v 1.2154 2015-01-14 15:01:08 cg Exp $'
+ ^ '$Id: Tools__NewSystemBrowser.st,v 1.2155 2015-01-20 13:18:44 cg Exp $'
! !