AbstractSourceCodeManager.st
branchjv
changeset 4562 86f84255e303
parent 4330 998eb03f0736
equal deleted inserted replaced
4396:5333bef41730 4562:86f84255e303
     1 "
     1 "
     2  COPYRIGHT (c) 1995 by Claus Gittinger
     2  COPYRIGHT (c) 1995 by Claus Gittinger
     3  COPYRIGHT (c) 2015-2016 Jan Vrany
     3  COPYRIGHT (c) 2015-2016 Jan Vrany
       
     4  COPYRIGHT (c) 2020 LabWare
     4               All Rights Reserved
     5               All Rights Reserved
     5 
     6 
     6  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
     7  only in accordance with the terms of that license and with the
     8  only in accordance with the terms of that license and with the
     8  inclusion of the above copyright notice.   This software may not
     9  inclusion of the above copyright notice.   This software may not
    14 
    15 
    15 "{ NameSpace: Smalltalk }"
    16 "{ NameSpace: Smalltalk }"
    16 
    17 
    17 Object subclass:#AbstractSourceCodeManager
    18 Object subclass:#AbstractSourceCodeManager
    18 	instanceVariableNames:''
    19 	instanceVariableNames:''
    19 	classVariableNames:'CacheDirectoryName CachingSources DefaultManager ManagerPerModule
    20 	classVariableNames:'CacheDirectoryName CachingSources DefaultManager
    20 		UseWorkTree Verbose WorkTreeDirectoryName
    21 		ManagerForPackageCache ManagerPerModule
    21                 PackagesWithoutExtensionMethodConfirmation		
    22 		PackagesWithoutExtensionMethodConfirmation
    22                 SuppressExtensionMethodConfirmation
    23 		SuppressExtensionMethodConfirmation UseWorkTree Verbose
    23                 ManagerForPackageCache'               
    24 		WorkTreeDirectoryName'
    24 	poolDictionaries:''
    25 	poolDictionaries:''
    25 	category:'System-SourceCodeManagement'
    26 	category:'System-SourceCodeManagement'
    26 !
    27 !
    27 
    28 
    28 Object subclass:#PackageAndManager
    29 Object subclass:#PackageAndManager
    36 
    37 
    37 copyright
    38 copyright
    38 "
    39 "
    39  COPYRIGHT (c) 1995 by Claus Gittinger
    40  COPYRIGHT (c) 1995 by Claus Gittinger
    40  COPYRIGHT (c) 2015-2016 Jan Vrany
    41  COPYRIGHT (c) 2015-2016 Jan Vrany
       
    42  COPYRIGHT (c) 2020 LabWare
    41               All Rights Reserved
    43               All Rights Reserved
    42 
    44 
    43  This software is furnished under a license and may be used
    45  This software is furnished under a license and may be used
    44  only in accordance with the terms of that license and with the
    46  only in accordance with the terms of that license and with the
    45  inclusion of the above copyright notice.   This software may not
    47  inclusion of the above copyright notice.   This software may not
   318     ].
   320     ].
   319 
   321 
   320     "Still no luck, try to auto-configure."
   322     "Still no luck, try to auto-configure."
   321     prjdef notNil ifTrue:[
   323     prjdef notNil ifTrue:[
   322         prjdir := prjdef packageDirectory.
   324         prjdir := prjdef packageDirectory.
   323         (prjdir notNil and:[prjdir isDirectory]) ifTrue:[
   325     ] ifFalse:[ 
   324             | managers |
   326         prjdir := aSymbol asPackageId packageDirectory 
   325             managers := self availableManagers select:[:mgr |
   327     ].
   326                 mgr enabled
   328 
   327                     and:[(mgr isResponsibleForPackage: prjsym)
   329     (prjdir notNil and:[prjdir isDirectory]) ifTrue:[
   328                     and:[mgr validateWorkingCopy: prjdir] ] .    
   330         | managers |
   329             ].
   331         managers := self availableManagers select:[:mgr |
   330             managers size == 1 ifTrue:[
   332             mgr enabled
   331                 manager := managers anElement.
   333                 and:[(mgr isResponsibleForPackage: prjsym)
   332                 ManagerForPackageCache at: prjsym put: manager.
   334                 and:[mgr validateWorkingCopy: prjdir] ] .    
   333                 ^manager
   335         ].
   334             ]
   336         managers size == 1 ifTrue:[
   335         ].
   337             manager := managers anElement.
   336     ].
   338             ManagerForPackageCache at: prjsym put: manager.
       
   339             ^manager
       
   340         ]
       
   341     ].
       
   342 
   337     parentPrjId := prjsym asPackageId parentPackage.
   343     parentPrjId := prjsym asPackageId parentPackage.
   338     parentPrjId notNil ifTrue:[ 
   344     parentPrjId notNil ifTrue:[ 
   339         ^ self managerForPackage: parentPrjId asSymbol  
   345         ^ self managerForPackage: parentPrjId asSymbol  
   340     ].
   346     ].
   341     ^ DefaultManager
   347     ^ DefaultManager
   349     "Created: / 18-04-2011 / 19:39:19 / cg"
   355     "Created: / 18-04-2011 / 19:39:19 / cg"
   350     "Created: / 10-10-2011 / 14:50:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   356     "Created: / 10-10-2011 / 14:50:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   351     "Modified: / 19-10-2011 / 16:45:38 / cg"
   357     "Modified: / 19-10-2011 / 16:45:38 / cg"
   352     "Modified: / 02-10-2015 / 10:24:41 / jv"
   358     "Modified: / 02-10-2015 / 10:24:41 / jv"
   353     "Modified: / 04-03-2016 / 15:33:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   359     "Modified: / 04-03-2016 / 15:33:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   360     "Modified: / 02-06-2020 / 12:12:40 / Jan Vrany <jan.vrany@labware.com>"
   354 !
   361 !
   355 
   362 
   356 managerPerMatchingModuleDefinitions
   363 managerPerMatchingModuleDefinitions
   357     "return the sourceCodeManager definitions"
   364     "return the sourceCodeManager definitions"
   358 
   365