Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelvigee committed Apr 23, 2024
1 parent 601a8ab commit d0a37e6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
8 changes: 2 additions & 6 deletions backend/go/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,8 @@ def go_mod(
name = "_go_mod_gen",
run = "godeps mod $SRC_CFG",
out = "/**/BUILD",
deps = {
"cfg": godeps_cfg,
},
runtime_deps = {
"deps": godeps_deps,
},
deps = {"cfg": godeps_cfg},
runtime_deps = {"deps": godeps_deps},
hash_deps = [imports, gomodsum],
tools = godeps,
env = {
Expand Down
2 changes: 1 addition & 1 deletion backend/go/go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
export GOPATH=${GOPATH:-$GO_OUTDIR/gopath}
export GOCACHE=${GOCACHE:-$GO_OUTDIR/gocache}
export GOROOT=$GO_OUTDIR/go
export GOFLAGS=-modcacherw
export GOFLAGS="-modcacherw -buildvcs=false"
export CGO_ENABLED=${CGO_ENABLED:-0}

set -u
Expand Down
16 changes: 16 additions & 0 deletions backend/go/godeps/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ func generate() []RenderUnit {
libPkg := libTarget(pkgs, pkg).Package
pkgCfg := Config.GetPkgCfg(pkg.ImportPath)

if strings.Contains(pkg.ImportPath, "notifications-delivery/cmd") {
fmt.Println("#############", pkg.ImportPath, pkg.Name, pkg.IsPartOfTree)
}

var lib *Lib
if pkg.IsPartOfTree {
if len(pkg.GoFiles) > 0 || len(pkg.SFiles) > 0 {
Expand All @@ -231,6 +235,10 @@ func generate() []RenderUnit {
lib.Libs = append(lib.Libs, t.Full())
}

if strings.Contains(pkg.ImportPath, "notifications-delivery/cmd") {
fmt.Println("#############", "HAS LIB", lib)
}

units = append(units, RenderUnit{
Render: func(w io.Writer) {
RenderLib(w, lib)
Expand Down Expand Up @@ -295,7 +303,15 @@ func generate() []RenderUnit {
}

if lib != nil && pkg.Name == "main" {
if strings.Contains(pkg.ImportPath, "notifications-delivery/cmd") {
fmt.Println("#############", "ITS A MAIN")
}

for _, variant := range pkgCfg.UniqueLinkVariants(pkg.Variant) {
if strings.Contains(pkg.ImportPath, "notifications-delivery/cmd") {
fmt.Println("#############", variant.Name, variant.OS, variant.ARCH)
}

bin := &Bin{
TargetName: targetName("go_bin#build", variant),
TargetPackage: lib.Target.Package,
Expand Down

0 comments on commit d0a37e6

Please sign in to comment.