Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ workspace(name = "angular_material")
# Add nodejs rules
http_archive(
name = "build_bazel_rules_nodejs",
url = "https://github.com/bazelbuild/rules_nodejs/archive/0.5.3.zip",
strip_prefix = "rules_nodejs-0.5.3",
sha256 = "17a5515f59777b00cb25dbc710017a14273f825029b2ec60e0969d28914870be",
url = "https://github.com/bazelbuild/rules_nodejs/archive/0.6.0.zip",
strip_prefix = "rules_nodejs-0.6.0",
sha256 = "e8a2bb5ca51fbafb244bc507bcebcae33a63d969f47413b319a8dcce032845bf",
)

# NOTE: this rule installs nodejs, npm, and yarn, but does NOT install
Expand Down
8 changes: 2 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"devDependencies": {
"@angular-devkit/core": "^0.4.5",
"@angular-devkit/schematics": "^0.4.5",
"@angular/bazel": "6.0.0-rc.0",
"@angular/compiler-cli": "6.0.0-rc.0",
"@angular/bazel": "github:angular/bazel-builds#2cc851b01b889a304b05ef46569f896b20f10705",
"@angular/compiler-cli": "github:angular/compiler-cli-builds#024717fcdfebc2dc2854ab59da956d167fa3caeb",
"@angular/http": "6.0.0-rc.0",
"@angular/platform-browser-dynamic": "6.0.0-rc.0",
"@angular/platform-server": "6.0.0-rc.0",
Expand Down
6 changes: 6 additions & 0 deletions tools/bazel.rc
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,9 @@ build --symlink_prefix=dist/bazel/
# Make TypeScript and Angular compilation fast, by keeping a few copies of the compiler
# running as daemons, and cache SourceFile AST's to reduce parse time.
build --strategy=TypeScriptCompile=worker --strategy=AngularTemplateCompile=worker

########################
# Building Releases #
# use --config=release #
########################
build:release --workspace_status_command=./tools/bazel_stamp_vars.sh
40 changes: 40 additions & 0 deletions tools/bazel_stamp_vars.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env bash
# Generates the data used by the stamping feature in bazel.
# See https://github.com/angular/angular/blob/master/docs/BAZEL.md for more explanation
set -u -e -E -o pipefail

echo "Running: $0" >&2

function onError {
echo "Failed to execute: $0"
echo ""
}

# Setup crash trap
trap 'onError' ERR


echo BUILD_SCM_HASH $(git rev-parse HEAD)

if [[ "$(git tag)" == "" ]]; then
echo "No git tags found, can't stamp the build."
echo "Either fetch the tags:"
echo " git fetch [email protected]:angular/material2.git --tags"
echo "or build without stamping by giving an empty workspace_status_command:"
echo " bazel build --workspace_status_command= ..."
echo ""
fi

BUILD_SCM_VERSION_RAW=$(git describe --abbrev=7 --tags HEAD)

# Find out if there are any uncommitted local changes
# TODO(igorminar): is it ok to use "--untracked-files=no" to ignore untracked files since they should not affect anything?
if [[ $(git status --untracked-files=no --porcelain) ]]; then LOCAL_CHANGES="true"; else LOCAL_CHANGES="false"; fi
echo BUILD_SCM_LOCAL_CHANGES ${LOCAL_CHANGES}

# Reformat `git describe` version string into a more semver-ish string
# From: 5.2.0-rc.0-57-g757f886
# To: 5.2.0-rc.0+57.sha-757f886
# Or: 5.2.0-rc.0+57.sha-757f886.with-local-changes
BUILD_SCM_VERSION="$(echo ${BUILD_SCM_VERSION_RAW} | sed -E 's/-([0-9]+)-g/+\1.sha-/g')""$( if [[ $LOCAL_CHANGES == "true" ]]; then echo ".with-local-changes"; fi)"
echo BUILD_SCM_VERSION ${BUILD_SCM_VERSION}