SmalltalkCodeGeneratorTool.st
changeset 14426 98245d2f01a2
parent 14118 e05c6b42870d
child 14572 3ea2ce89adf0
equal deleted inserted replaced
14425:47fb1e0c33a9 14426:98245d2f01a2
  1706 
  1706 
  1707 createCopyrightMethodFor:copyRightText for:aClass
  1707 createCopyrightMethodFor:copyRightText for:aClass
  1708     "add copyright method containing text,
  1708     "add copyright method containing text,
  1709      but only if not already present."
  1709      but only if not already present."
  1710 
  1710 
  1711     |txt log initialYear scm firstRev firstRevDate|
  1711     |txt log thisYear initialYear scm firstRev firstRevDate|
  1712 
  1712 
  1713     (aClass includesSelector:#copyright) ifFalse:[
  1713     (aClass includesSelector:#copyright) ifFalse:[
  1714         copyRightText notNil ifTrue:[
  1714         copyRightText notNil ifTrue:[
  1715             initialYear := Date today year.
  1715             initialYear := thisYear := Date today year.
  1716             (copyRightText includes:$%) ifTrue:[
  1716             (copyRightText includes:$%) ifTrue:[
  1717                 scm := aClass theNonMetaclass sourceCodeManager.
  1717                 scm := aClass theNonMetaclass sourceCodeManager.
  1718                 scm == CVSSourceCodeManager ifTrue:[
  1718                 scm == CVSSourceCodeManager ifTrue:[
  1719                     log := CVSSourceCodeManager revisionLogOf:aClass fromRevision:'1.1' toRevision:'1.1'.
  1719                     log := CVSSourceCodeManager revisionLogOf:aClass fromRevision:'1.1' toRevision:'1.1'.
  1720                     (firstRev := (log at:#revisions) firstIfEmpty:nil) notNil ifTrue:[     
  1720                     (firstRev := (log at:#revisions) firstIfEmpty:nil) notNil ifTrue:[     
  1726                             ]
  1726                             ]
  1727                         ]
  1727                         ]
  1728                     ]
  1728                     ]
  1729                 ].
  1729                 ].
  1730             ].
  1730             ].
  1731             txt := copyRightText bindWith:initialYear.
  1731             thisYear ~= initialYear ifTrue:[
       
  1732                 txt := copyRightText bindWith:(initialYear printString, '-', thisYear printString).
       
  1733             ] ifFalse:[
       
  1734                 txt := copyRightText bindWith:initialYear.
       
  1735             ].
       
  1736 
  1732             self compile:
  1737             self compile:
  1733 'copyright
  1738 'copyright
  1734 "
  1739 "
  1735 ' , txt , '
  1740 ' , txt , '
  1736 "
  1741 "
  2658 ! !
  2663 ! !
  2659 
  2664 
  2660 !SmalltalkCodeGeneratorTool class methodsFor:'documentation'!
  2665 !SmalltalkCodeGeneratorTool class methodsFor:'documentation'!
  2661 
  2666 
  2662 version
  2667 version
  2663     ^ '$Header: /cvs/stx/stx/libtool/SmalltalkCodeGeneratorTool.st,v 1.25 2014-03-05 22:11:40 cg Exp $'
  2668     ^ '$Header: /cvs/stx/stx/libtool/SmalltalkCodeGeneratorTool.st,v 1.26 2014-05-27 08:23:17 stefan Exp $'
  2664 !
  2669 !
  2665 
  2670 
  2666 version_CVS
  2671 version_CVS
  2667     ^ '$Header: /cvs/stx/stx/libtool/SmalltalkCodeGeneratorTool.st,v 1.25 2014-03-05 22:11:40 cg Exp $'
  2672     ^ '$Header: /cvs/stx/stx/libtool/SmalltalkCodeGeneratorTool.st,v 1.26 2014-05-27 08:23:17 stefan Exp $'
  2668 !
  2673 !
  2669 
  2674 
  2670 version_SVN
  2675 version_SVN
  2671     ^ '$Id: SmalltalkCodeGeneratorTool.st,v 1.25 2014-03-05 22:11:40 cg Exp $'
  2676     ^ '$Id: SmalltalkCodeGeneratorTool.st,v 1.26 2014-05-27 08:23:17 stefan Exp $'
  2672 ! !
  2677 ! !
  2673 
  2678