Skip to content

Commit

Permalink
Init Bazel project
Browse files Browse the repository at this point in the history
  • Loading branch information
MewX committed Aug 28, 2020
1 parent d72331a commit 7f2147f
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
temp/
*.out

# bazel outputs
/bazel-*
.ijwb/

# Dependency directories (remove the comment below to include it)
# vendor/
18 changes: 18 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("@bazel_gazelle//:def.bzl", "gazelle")

# gazelle:prefix github.com/its-my-data/doubak
gazelle(name = "gazelle")

go_library(
name = "doubak_lib",
srcs = ["doubak.go"],
importpath = "github.com/its-my-data/doubak",
visibility = ["//visibility:private"],
)

go_binary(
name = "doubak",
embed = [":doubak_lib"],
visibility = ["//visibility:public"],
)
28 changes: 28 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "io_bazel_rules_go",
sha256 = "08369b54a7cbe9348eea474e36c9bbb19d47101e8860cec75cbf1ccd4f749281",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.0/rules_go-v0.24.0.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.24.0/rules_go-v0.24.0.tar.gz",
],
)

http_archive(
name = "bazel_gazelle",
sha256 = "d4113967ab451dd4d2d767c3ca5f927fec4b30f3b2c6f8135a2033b9c05a5687",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.0/bazel-gazelle-v0.22.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.0/bazel-gazelle-v0.22.0.tar.gz",
],
)

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")

go_rules_dependencies()

go_register_toolchains()

gazelle_dependencies()
7 changes: 7 additions & 0 deletions doubak.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "fmt"

func main() {
fmt.Println("Hello Doubak!")
}

0 comments on commit 7f2147f

Please sign in to comment.