-
Notifications
You must be signed in to change notification settings - Fork 6
/
buildDev.go
50 lines (40 loc) · 1.62 KB
/
buildDev.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// +build !release
package config
import (
"github.com/goradd/goradd/pkg/sys"
"path/filepath"
)
// The Release constant is used throughout the framework to determine if we are running the development version
// or release version of the product. The development version is designed to make on-going development easier,
// and the release version is designed to run on a deployment server.
// It is off by default, but you can turn it on by building with the -tags "release" flag.
// Combine with the nodebug tag like so: go build -tags "release nodebug"
// You might build a release version that keeps the debug features on if you are building for manual testers
const Release = false
// These directories are available during development, but not for the release build. If you have static files you
// need to locate, you will need to provide a different mechanism to do that. See the main package for how the
// framework does that for assets, by using a pattern in the URL, combined with a flag past in to the application at
// runtime.
var projectDir string
var goraddDir string // filled in by Goradd
// GoraddAssets returns the disk location of the assets directory.
func GoraddAssets() string {
return filepath.Join(goraddDir, "web", "assets")
}
func ProjectAssets() string {
return filepath.Join(projectDir, "web", "assets")
}
func GoraddDir() string {
return goraddDir
}
func ProjectDir() string {
return projectDir
}
func SetProjectDir(path string) {
projectDir = path
}
func init() {
// Initialize the directory path for the goradd source
filename := sys.SourceDirectory()
goraddDir = filepath.Dir(filepath.Dir(filename))
}