Created
June 14, 2020 00:42
-
-
Save afifalfiano/b9f0884fab580ad2627dc12371ceb0dd to your computer and use it in GitHub Desktop.
Tutorial Bazel + Angular + Github Action + Azure Static Web Apps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# WARNING: This file is generated and it's not meant to be edited. | |
# Before making any changes, please read Bazel documentation. | |
# https://docs.bazel.build/versions/master/be/workspace.html | |
# The WORKSPACE file tells Bazel that this directory is a "workspace", which is like a project root. | |
# The content of this file specifies all the external dependencies Bazel needs to perform a build. | |
#################################### | |
# ESModule imports (and TypeScript imports) can be absolute starting with the workspace name. | |
# The name of the workspace should match the npm package where we publish, so that these | |
# imports also make sense when referencing the published package. | |
workspace( | |
name = "project", | |
managed_directories = {"@npm": ["node_modules"]}, | |
) | |
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | |
RULES_NODEJS_VERSION = "1.6.0" | |
RULES_NODEJS_SHA256 = "f9e7b9f42ae202cc2d2ce6d698ccb49a9f7f7ea572a78fd451696d03ef2ee116" | |
http_archive( | |
name = "build_bazel_rules_nodejs", | |
sha256 = RULES_NODEJS_SHA256, | |
url = "https://github.com/bazelbuild/rules_nodejs/releases/download/%s/rules_nodejs-%s.tar.gz" % (RULES_NODEJS_VERSION, RULES_NODEJS_VERSION), | |
) | |
# Rules for compiling sass | |
RULES_SASS_VERSION = "1.24.0" | |
RULES_SASS_SHA256 = "77e241148f26d5dbb98f96fe0029d8f221c6cb75edbb83e781e08ac7f5322c5f" | |
http_archive( | |
name = "io_bazel_rules_sass", | |
sha256 = RULES_SASS_SHA256, | |
strip_prefix = "rules_sass-%s" % RULES_SASS_VERSION, | |
urls = [ | |
"https://github.com/bazelbuild/rules_sass/archive/%s.zip" % RULES_SASS_VERSION, | |
"https://mirror.bazel.build/github.com/bazelbuild/rules_sass/archive/%s.zip" % RULES_SASS_VERSION, | |
], | |
) | |
#################################### | |
# Load and install our dependencies downloaded above. | |
load("@build_bazel_rules_nodejs//:index.bzl", "check_bazel_version", "node_repositories", | |
"npm_install") | |
check_bazel_version( | |
message = """ | |
You no longer need to install Bazel on your machine. | |
Your project should have a dependency on the @bazel/bazel package which supplies it. | |
Try running `yarn bazel` instead. | |
(If you did run that, check that you've got a fresh `yarn install`) | |
""", | |
minimum_bazel_version = "0.27.0", | |
) | |
# Setup the Node repositories. We need a NodeJS version that is more recent than v10.15.0 | |
# because "selenium-webdriver" which is required for "ng e2e" cannot be installed. | |
# TODO: remove the custom repositories once "rules_nodejs" supports v12.14.1 by default. | |
node_repositories( | |
node_repositories = { | |
"12.14.1-darwin_amd64": ("node-v12.14.1-darwin-x64.tar.gz", "node-v12.14.1-darwin-x64", "0be10a28737527a1e5e3784d3ad844d742fe8b0718acd701fd48f718fd3af78f"), | |
"12.14.1-linux_amd64": ("node-v12.14.1-linux-x64.tar.xz", "node-v12.14.1-linux-x64", "07cfcaa0aa9d0fcb6e99725408d9e0b07be03b844701588e3ab5dbc395b98e1b"), | |
"12.14.1-windows_amd64": ("node-v12.14.1-win-x64.zip", "node-v12.14.1-win-x64", "1f96ccce3ba045ecea3f458e189500adb90b8bc1a34de5d82fc10a5bf66ce7e3"), | |
}, | |
node_version = "12.14.1", | |
) | |
npm_install( | |
name = "npm", | |
package_json = "//:package.json", | |
package_lock_json = "//:package-lock.json", | |
) | |
load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") | |
install_bazel_dependencies() | |
load("@npm_bazel_protractor//:package.bzl", "npm_bazel_protractor_dependencies") | |
npm_bazel_protractor_dependencies() | |
load("@npm_bazel_karma//:package.bzl", "npm_bazel_karma_dependencies") | |
npm_bazel_karma_dependencies() | |
load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories") | |
web_test_repositories() | |
load("@io_bazel_rules_webtesting//web/versioned:browsers-0.3.2.bzl", "browser_repositories") | |
browser_repositories(chromium = True, firefox = True) | |
load("@npm_bazel_typescript//:index.bzl", "ts_setup_workspace") | |
ts_setup_workspace() | |
load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories") | |
sass_repositories() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment