コード例 #1
0
ファイル: genrule.go プロジェクト: ftrvxmtrx/build
func (g *GenRule) Hash() []byte {
	h := sha1.New()

	io.WriteString(h, g.Name)
	util.HashStrings(h, g.Commands)
	util.HashStrings(h, os.Environ())
	return []byte{}
}
コード例 #2
0
ファイル: cbin.go プロジェクト: ftrvxmtrx/build
func (cb *CBin) Hash() []byte {

	h := sha1.New()
	io.WriteString(h, CCVersion)
	io.WriteString(h, cb.Name)
	util.HashFilesWithExt(h, cb.Includes, ".h")
	util.HashFiles(h, []string(cb.Sources))
	util.HashStrings(h, cb.CompilerOptions)
	util.HashStrings(h, cb.LinkerOptions)
	return h.Sum(nil)
}
コード例 #3
0
ファイル: yacc.go プロジェクト: ftrvxmtrx/build
func (y *Yacc) Hash() []byte {
	h := sha1.New()
	io.WriteString(h, YaccVersion)
	io.WriteString(h, y.Name)
	util.HashFiles(h, y.Sources)
	util.HashStrings(h, y.YaccOptions)
	return h.Sum(nil)
}
コード例 #4
0
ファイル: man.go プロジェクト: ftrvxmtrx/build
func (mp *ManPage) Hash() []byte {
	h := sha1.New()

	io.WriteString(h, mp.Name)

	util.HashFiles(h, mp.Sources)
	util.HashStrings(h, os.Environ())
	return []byte{}
}
コード例 #5
0
ファイル: clib.go プロジェクト: ftrvxmtrx/build
func (cl *CLib) Hash() []byte {
	h := sha1.New()

	io.WriteString(h, CCVersion)
	io.WriteString(h, cl.Name)
	util.HashFiles(h, cl.Includes)
	io.WriteString(h, "clib")
	util.HashFiles(h, []string(cl.Sources))
	util.HashStrings(h, cl.CompilerOptions)
	util.HashStrings(h, cl.LinkerOptions)
	if cl.LinkShared {
		io.WriteString(h, "shared")
	}
	if cl.LinkStatic {
		io.WriteString(h, "static")
	}
	return h.Sum(nil)
}
コード例 #6
0
ファイル: config.go プロジェクト: ftrvxmtrx/build
func (k *Config) Hash() []byte {

	h := sha1.New()
	util.HashFiles(h, k.RamFiles)
	util.HashStrings(h, k.Code)
	util.HashStrings(h, k.Dev)
	util.HashStrings(h, k.Ip)
	util.HashStrings(h, k.Link)
	util.HashStrings(h, k.Sd)
	util.HashStrings(h, k.Uart)
	util.HashStrings(h, k.VGA)
	io.WriteString(h, k.Name)
	return h.Sum(nil)
}
コード例 #7
0
ファイル: builder.go プロジェクト: ftrvxmtrx/build
func (n *Node) HashNode() []byte {
	// node hashes should not change after a build,
	// they should be deterministic, therefore they should and can be cached.
	if len(n.hash) > 0 {
		return n.hash
	}
	h := sha1.New()
	h.Write(n.Target.Hash())
	util.HashStrings(h, n.Target.GetDependencies())
	var bn ByName
	for _, e := range n.Children {
		bn = append(bn, e)

	}
	sort.Sort(bn)
	for _, e := range bn {
		h.Write(e.HashNode())
	}
	n.hash = h.Sum(nil)
	return n.hash
}