@@ -45,6 +45,7 @@ import (
45
45
46
46
"github.com/edwingeng/deque"
47
47
"github.com/kingsgroupos/archivist/cli/archivist/guesser"
48
+ "github.com/kingsgroupos/archivist/cli/archivist/meta"
48
49
"github.com/kingsgroupos/misc"
49
50
"github.com/kingsgroupos/misc/chksum"
50
51
"github.com/kingsgroupos/misc/variable"
@@ -398,6 +399,17 @@ func (this *generateCmdT) genStructRelatedCode(allFiles []string, sha1Map map[st
398
399
panic ("impossible" )
399
400
}
400
401
402
+ appendMetaFiles := func (jsonFile string , data []byte ) []byte {
403
+ d1 , d2 := meta .ReadMetaFiles (jsonFile )
404
+ var buf bytes.Buffer
405
+ buf .Write (data )
406
+ buf .WriteByte ('\n' )
407
+ buf .Write (d1 )
408
+ buf .WriteByte ('\n' )
409
+ buf .Write (d2 )
410
+ return buf .Bytes ()
411
+ }
412
+
401
413
revRefGraph := make (map [string ][]string )
402
414
var guessers []* guesser.Guesser
403
415
for i , file := range allFiles {
@@ -410,7 +422,7 @@ func (this *generateCmdT) genStructRelatedCode(allFiles []string, sha1Map map[st
410
422
panic (err )
411
423
} else {
412
424
if this .boost {
413
- fileSha1 = sha1 .Sum (data )
425
+ fileSha1 = sha1 .Sum (appendMetaFiles ( file , data ) )
414
426
}
415
427
g = this .buildGuesserWithBytes (
416
428
data , file , primaryStructNameMap , this .structNameSuffix )
@@ -419,11 +431,11 @@ func (this *generateCmdT) genStructRelatedCode(allFiles []string, sha1Map map[st
419
431
if data , err := guesser .ReadDataFile (file ); err != nil {
420
432
panic (err )
421
433
} else {
434
+ jsonFile := strings .TrimSuffix (file , ".js" ) + ".json"
422
435
if this .boost {
423
- fileSha1 = sha1 .Sum (data )
436
+ fileSha1 = sha1 .Sum (appendMetaFiles ( jsonFile , data ) )
424
437
}
425
438
data = evalJavascript (data , file )
426
- jsonFile := strings .TrimSuffix (file , ".js" ) + ".json"
427
439
g = this .buildGuesserWithBytes (
428
440
data , jsonFile , primaryStructNameMap , this .structNameSuffix )
429
441
}
0 commit comments