about summary refs log tree commit diff
path: root/third_party/bazel/rules_haskell/start
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/bazel/rules_haskell/start')
-rwxr-xr-xthird_party/bazel/rules_haskell/start124
1 files changed, 0 insertions, 124 deletions
diff --git a/third_party/bazel/rules_haskell/start b/third_party/bazel/rules_haskell/start
deleted file mode 100755
index 24f300cb6e..0000000000
--- a/third_party/bazel/rules_haskell/start
+++ /dev/null
@@ -1,124 +0,0 @@
-#!/bin/sh
-
-MIN_BAZEL_MAJOR=0
-MIN_BAZEL_MINOR=24
-
-set -e
-
-check_files_dont_exist () {
-    if [ -e WORKSPACE ] || [ -e BUILD ] || [ -e BazelExample.hs ]
-    then
-        echo "Current directory already has WORKSPACE and/or BUILD and/or BazelExample.hs files." >/dev/stderr
-        exit 1
-    fi
-}
-
-check_bazel_version () {
-    local actual_raw=$(bazel version | egrep '^Build label:' | egrep -o '[0-9.]+')
-
-    IFS=. read actual_major actual_minor actual_patch <<EOF
-$actual_raw
-EOF
-
-    local expected=$MIN_BAZEL_MAJOR.$MIN_BAZEL_MINOR.0
-    local cmp=$expected'\n'$actual
-
-    if ! ( [ "$actual_major" -gt "$MIN_BAZEL_MAJOR" ] || (
-            [ "$actual_major" -eq "$MIN_BAZEL_MAJOR" ] &&
-                [ "$actual_minor" -ge "$MIN_BAZEL_MINOR" ] ) )
-    then
-        echo "Need at least Bazel v${expected}. v${actual_raw} detected." >/dev/stderr
-        exit 1
-    fi
-}
-
-check_files_dont_exist
-check_bazel_version
-
-cat > WORKSPACE <<"EOF"
-# Give your project a name. :)
-workspace(name = "YOUR_PROJECT_NAME_HERE")
-
-# Load the repository rule to download an http archive.
-load(
-    "@bazel_tools//tools/build_defs/repo:http.bzl",
-    "http_archive"
-)
-
-# Download `rules_haskell`.
-# and make it accessible `@io_tweag_rules_haskell`.
-http_archive(
-    name = "io_tweag_rules_haskell",
-    strip_prefix = "rules_haskell-0.8",
-    urls = ["https://github.com/tweag/rules_haskell/archive/v0.8.tar.gz"],
-    sha256 = "431d492a8ee6a110cdf42496181c9d27225dfb997379e64a148eb8e69f272ab7",
-)
-
-load(
-    "@io_tweag_rules_haskell//haskell:repositories.bzl",
-    "haskell_repositories"
-)
-
-# `haskell_repositories()` sets up all bazel dependencies
-# required by `rules_haskell`.
-haskell_repositories()
-
-load(
-    "@io_tweag_rules_haskell//haskell:haskell.bzl",
-    "haskell_register_ghc_bindists",
-)
-
-# Registers a haskell toolchain with a GHC binary
-# downloaded from haskell.org.
-haskell_register_ghc_bindists(version = "8.6.4")
-EOF
-
-cat > BUILD.bazel <<"EOF"
-# Set all target’s visibility in this package to "public".
-package(default_visibility = ["//visibility:public"])
-
-# Load `rules_haskell` rules.
-load(
-    "@io_tweag_rules_haskell//haskell:haskell.bzl",
-    "haskell_toolchain_library",
-    "haskell_library",
-    "haskell_binary",
-)
-
-# `haskell_toolchain_library` can access builtin GHC packages
-# and assign them a bazel target name, so that they
-# can be referenced as dependencies.
-haskell_toolchain_library(name = "base")
-
-# You can add your own libraries with `haskell_library`.
-# haskell_library(
-#     name = "MY_LIBRARY_NAME",
-#     src_strip_prefix = "src",
-#     srcs = glob(['src/**/*.hs']),
-#     deps = [
-#         "base_pkg"
-#     ],
-# )
-
-# An example binary using the Prelude module from the
-# GHC base package, to print the hello world.
-haskell_binary(
-    name = "example",
-    srcs = [":Example.hs"],
-    deps = [":base"],
-)
-EOF
-
-cat > Example.hs <<"EOF"
-module Main where
-
-import Prelude (putStrLn)
-
-main = putStrLn "Hello from rules_haskell!"
-EOF
-
-cat <<"EOF"
-WORKSPACE and initial BUILD files created. To run Bazel and build the example:
-
-    $ bazel run //:example
-EOF