|
@@ -59,6 +59,7 @@ import (
|
|
|
"path"
|
|
|
"path/filepath"
|
|
|
"regexp"
|
|
|
+ "sort"
|
|
|
"strings"
|
|
|
)
|
|
|
|
|
@@ -125,6 +126,8 @@ func globby(s []string) []string {
|
|
|
for n := range f {
|
|
|
all = append(all, n)
|
|
|
}
|
|
|
+ sort.Strings(all)
|
|
|
+
|
|
|
debug("Glob of '%v' is '%v'", s, all)
|
|
|
return all
|
|
|
}
|
|
@@ -223,7 +226,15 @@ func include(f string, targ string, b *build) {
|
|
|
var builds buildfile
|
|
|
fail(json.Unmarshal(d, &builds))
|
|
|
|
|
|
- for _, build := range builds {
|
|
|
+ // Sort keys so we can guaranteed order of iteration over builds
|
|
|
+ var buildkeys []string
|
|
|
+ for n := range builds {
|
|
|
+ buildkeys = append(buildkeys, n)
|
|
|
+ }
|
|
|
+ sort.Strings(buildkeys)
|
|
|
+
|
|
|
+ for _, n := range buildkeys {
|
|
|
+ build := builds[n]
|
|
|
t := target(&build)
|
|
|
if t != "" {
|
|
|
targ = t
|
|
@@ -231,7 +242,9 @@ func include(f string, targ string, b *build) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- for n, build := range builds {
|
|
|
+ for _, n := range buildkeys {
|
|
|
+ build := builds[n]
|
|
|
+
|
|
|
log.Printf("Merging %s", n)
|
|
|
b.Cflags = append(b.Cflags, build.Cflags...)
|
|
|
b.Oflags = append(b.Oflags, build.Oflags...)
|
|
@@ -311,7 +324,17 @@ func process(f string, r []*regexp.Regexp) []build {
|
|
|
d, err := ioutil.ReadFile(f)
|
|
|
fail(err)
|
|
|
fail(json.Unmarshal(d, &builds))
|
|
|
- for n, build := range builds {
|
|
|
+
|
|
|
+ // Sort keys so we can guaranteed order of iteration over builds
|
|
|
+ var buildkeys []string
|
|
|
+ for n := range builds {
|
|
|
+ buildkeys = append(buildkeys, n)
|
|
|
+ }
|
|
|
+ sort.Strings(buildkeys)
|
|
|
+
|
|
|
+ for _, n := range buildkeys {
|
|
|
+ build := builds[n]
|
|
|
+
|
|
|
build.name = n
|
|
|
build.jsons = make(map[string]bool)
|
|
|
skip := true
|
|
@@ -637,6 +660,9 @@ func project(bf string, which []*regexp.Regexp) {
|
|
|
}
|
|
|
|
|
|
func main() {
|
|
|
+ // Disable logging timestamps - easier to compare build output
|
|
|
+ log.SetFlags(0)
|
|
|
+
|
|
|
// A small amount of setup is done in the paths*.go files. They are
|
|
|
// OS-specific path setup/manipulation. "harvey" is set there and $PATH is
|
|
|
// adjusted.
|