ProjectDefinition.st
changeset 10976 5696faf1af02
parent 10974 9887cad6b7fd
child 10979 8dca736dfb68
equal deleted inserted replaced
10975:7e889c33b0e0 10976:5696faf1af02
   306 !
   306 !
   307 
   307 
   308 msdosPathToPackage:toPackageID from:fromPackageID
   308 msdosPathToPackage:toPackageID from:fromPackageID
   309     "Returns the path to the package defined by aPackageID relative to my path"
   309     "Returns the path to the package defined by aPackageID relative to my path"
   310     
   310     
   311     |parts1 parts2 common up down rel|
   311     |parts1 parts2 common up down|
   312 
   312 
   313     parts1 := fromPackageID asCollectionOfSubstringsSeparatedByAny:':/'.
   313     parts1 := fromPackageID asCollectionOfSubstringsSeparatedByAny:':/'.
   314     parts2 := toPackageID asCollectionOfSubstringsSeparatedByAny:':/'.
   314     parts2 := toPackageID asCollectionOfSubstringsSeparatedByAny:':/'.
   315     common := parts1 commonPrefixWith:parts2.
   315     common := parts1 commonPrefixWith:parts2.
   316     common notEmpty ifTrue:[
   316     up := ((1 to:parts1 size - common size) collect:[:p | '..']) asStringWith:'\'.
   317         up := ((1 to:parts1 size - common size) collect:[:p | '..\']) asStringWith:''.
   317     down := (parts2 copyFrom:common size+1) asStringWith:'\'.
   318         down := (parts2 copyFrom:common size+1) asStringWith:'\'.
   318     up isEmpty ifTrue:[
   319         (up isEmpty and:[down isEmpty]) ifTrue:[^ '.'].
   319        down isEmpty ifTrue:[^ '.'].
   320         ^ up,down   
   320         ^ down.
   321     ].
   321     ].
   322 
   322     down isEmpty ifTrue:[
   323     rel := (self topRelativePathToPackage_win32:toPackageID).
   323         ^ up.
   324     (rel startsWith:'stx\') ifTrue:[
   324     ].
   325         ^ '$(TOP)',(rel copyFrom:'stx\' size)
   325     ^ up, '\', down   
   326     ].
       
   327 
       
   328     ^ '$(TOP)\..\',rel.
       
   329 
       
   330 "/    pTop := self msdosPathToTopFor:fromPackageID.
       
   331 "/    (pTop endsWith:'\stx') ifTrue:[
       
   332 "/        ^ (pTop copyButLast:'stx' size),(self topRelativePathToPackage_win32:toPackageID)
       
   333 "/    ] ifFalse:[
       
   334 "/        ^ pTop,'\..\',(self topRelativePathToPackage_win32:toPackageID)
       
   335 "/    ].
       
   336 
   326 
   337     "
   327     "
   338      self msdosPathToPackage:'bosch:dapasx/kernel' from:'bosch:dapasx/application'
   328      self msdosPathToPackage:'bosch:dapasx/kernel' from:'bosch:dapasx/application'
   339      self msdosPathToPackage:'stx:libbasic' from:'bosch:dapasx/application'   
   329      self msdosPathToPackage:'stx:libbasic' from:'bosch:dapasx/application'   
   340      self msdosPathToPackage:'bosch:dapasx/application' from:'stx:libbasic'   
   330      self msdosPathToPackage:'bosch:dapasx/application' from:'stx:libbasic'   
       
   331      self msdosPathToPackage:'exept:expecco' from:'exept:expecco/application'   
       
   332      self msdosPathToPackage:'exept:expecco/application' from:'exept:expecco'   
   341     "
   333     "
   342 
   334 
   343     "Created: / 17-08-2006 / 14:26:39 / cg"
   335     "Created: / 17-08-2006 / 14:26:39 / cg"
   344     "Modified: / 14-09-2006 / 22:04:56 / cg"
   336     "Modified: / 14-09-2006 / 22:04:56 / cg"
   345 !
   337 !
  3993 ! !
  3985 ! !
  3994 
  3986 
  3995 !ProjectDefinition class methodsFor:'documentation'!
  3987 !ProjectDefinition class methodsFor:'documentation'!
  3996 
  3988 
  3997 version
  3989 version
  3998     ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.181 2008-04-24 18:25:40 stefan Exp $'
  3990     ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.182 2008-04-25 12:04:02 stefan Exp $'
  3999 ! !
  3991 ! !
  4000 
  3992 
  4001 ProjectDefinition initialize!
  3993 ProjectDefinition initialize!