SmalltalkCodeGeneratorTool.st
branchjv
changeset 12459 7899fe07efd7
parent 12431 9f0c59c742d5
parent 12458 ea3f2adb406f
child 12807 ba8c5416aa28
--- a/SmalltalkCodeGeneratorTool.st	Thu Mar 07 11:10:05 2013 +0000
+++ b/SmalltalkCodeGeneratorTool.st	Wed Mar 13 01:04:29 2013 +0000
@@ -852,6 +852,11 @@
     ].
     %1 open.
 '.
+            ] ifFalse:[
+                stream nextPutAll: 
+'     "/ replace by real code
+     Stdout nextPutLine:''Hello World''.
+'.
             ].
         ].
 
@@ -1590,11 +1595,27 @@
     "add copyright method containing text,
      but only if not already present."
 
-    |txt|
+    |txt log initialYear scm firstRev firstRevDate|
 
     (aClass includesSelector:#copyright) ifFalse:[
         copyRightText notNil ifTrue:[
-            txt := copyRightText bindWith:(Date today year).
+            initialYear := Date today year.
+            (copyRightText includes:$%) ifTrue:[
+                scm := aClass theNonMetaclass sourceCodeManager.
+                scm == CVSSourceCodeManager ifTrue:[
+                    log := CVSSourceCodeManager revisionLogOf:aClass fromRevision:'1.1' toRevision:'1.1'.
+                    (firstRev := (log at:#revisions) firstIfEmpty:nil) notNil ifTrue:[     
+                        firstRevDate := firstRev at:#date ifAbsent:nil.
+                        firstRevDate notNil ifTrue:[
+                            firstRevDate := Date readFrom:firstRevDate onError:nil. 
+                            firstRevDate notNil ifTrue:[    
+                                initialYear := firstRevDate year.
+                            ]
+                        ]
+                    ]
+                ].
+            ].
+            txt := copyRightText bindWith:initialYear.
             self compile:
 'copyright
 "
@@ -2508,11 +2529,11 @@
 !SmalltalkCodeGeneratorTool class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/SmalltalkCodeGeneratorTool.st,v 1.17 2012-10-15 20:17:01 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/SmalltalkCodeGeneratorTool.st,v 1.19 2013-03-11 20:34:41 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/SmalltalkCodeGeneratorTool.st,v 1.17 2012-10-15 20:17:01 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/SmalltalkCodeGeneratorTool.st,v 1.19 2013-03-11 20:34:41 cg Exp $'
 !
 
 version_HG