generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 7
/
devel.go
33 lines (28 loc) · 848 Bytes
/
devel.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//go:build !release
package localscaling
import (
"context"
"path/filepath"
"sync"
"github.com/TBD54566975/ftl/internal"
"github.com/TBD54566975/ftl/internal/exec"
"github.com/TBD54566975/ftl/internal/log"
)
var templateDirOnce sync.Once
func templateDir(ctx context.Context) string {
gitRoot, ok := internal.GitRoot("").Get()
if !ok {
// If GitRoot encounters an error, it will fail to find the correct dir.
// This line preserves the original behavior to prevent a regression, but
// it is still not the desired outcome. More thinking needed.
gitRoot = ""
}
templateDirOnce.Do(func() {
// TODO: Figure out how to make maven build offline
err := exec.Command(ctx, log.Debug, gitRoot, "just", "build-kt-runtime").RunBuffered(ctx)
if err != nil {
panic(err)
}
})
return filepath.Join(gitRoot, "build/template")
}