MCStXPackageInfo.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 29 May 2013 13:47:24 +0200
changeset 846 e6a552e98448
parent 735 b7d63bf3b328
child 931 7378792d173b
permissions -rw-r--r--
More support Squeak/Pharo interoperability - part 1: - added ProjectDefinition>>monticelloName - added MCStXSnapshotTransformation to allow for transforming snapshot before/after snapshot is written/read. This is required to transparently hide nasty differences between Smalltalk/X and Squeak/Pharo package models. The support is not yet finished, more to come

"{ Package: 'stx:goodies/monticello' }"

PackageInfo subclass:#MCStXPackageInfo
	instanceVariableNames:'projectDefinition classes'
	classVariableNames:''
	poolDictionaries:''
	category:'SCM-Monticello-St/X support'
!


!MCStXPackageInfo methodsFor:'accessing'!

classes
    classes isNil ifTrue:[
        classes := self projectDefinition classes.
        "/ cg: not true; the projectDefinition is part of the package; at least for st/x packages.
        "/ classes remove: self projectDefinition ifAbsent:[].

        (classes includes:nil) ifTrue:[
            "/ some classes are not present - usually, these are architecture spcific classes
            "/ which are not present in this image (such as XWorkstation vs. WinWorkstation).
            "/ should do a query signal here, to get this info, instead of doing UI here..
            (Dialog confirm:'Not all classes as defined in the package are present in your image.\Typically, these are architecture or OS specific classes.\If you proceed, those classes will be missing in the enerated package file.\\Proceed?' withCRs)
            ifFalse:[
                AbortSignal raise
            ].
            classes := classes select:[:cls | cls notNil].
        ].
    ].
    ^classes

    "Created: / 23-08-2011 / 11:55:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 02-12-2011 / 15:56:35 / cg"
!

extensionMethods
    self assert:(self projectDefinition hasAllExtensionsLoaded).

    ^self projectDefinition extensionMethods
        collect:[:mthd|
            self assert:mthd notNil.
            self
                referenceForMethod: mthd selector
                ofClass:mthd mclass
        ]

    "Created: / 23-08-2011 / 11:58:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 27-08-2012 / 12:12:55 / cg"
!

projectDefinition

    projectDefinition isNil ifTrue:[
        projectDefinition := 
            (LibraryDefinition
                definitionClassForPackage: name
                createIfAbsent: true 
                projectType: nil)
    ].
    ^projectDefinition

    "Created: / 23-08-2011 / 13:37:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

systemCategories

    | cats |
    cats := Set new.
    self classes do:[:cls|cats add: cls category].
    cats remove: #'* Projects & Packages *'.
    ^cats

    "Created: / 23-08-2011 / 13:45:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 29-05-2013 / 12:32:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!MCStXPackageInfo methodsFor:'testing'!

isMCStXPackageInfo
    ^ true

    "Created: / 29-05-2013 / 01:08:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!MCStXPackageInfo class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCStXPackageInfo.st,v 1.7 2013-05-29 11:47:24 vrany Exp $'
!

version_CVS
    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCStXPackageInfo.st,v 1.7 2013-05-29 11:47:24 vrany Exp $'
!

version_MC
    ^ '$stx:goodies/monticello-cg.3 4e70fe70-f030-11e1-ac62-001f3bda2d09 2012-08-27T12:16:46 cg$'
! !