Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
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
22 changes: 22 additions & 0 deletions .bash_bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
#
# Install me in your ${HOME} folder, and add me to your ~/.bashrc:
#
# cp .bash_bazel ~/ && echo 'source ~/.bash_bazel' >> ~/.bashrc
#

[[ -n $(command -V brew) ]] && {
completion="$(brew --prefix)/etc/bash_completion"
[[ -f "${completion}" ]] && {
source "${completion}"
}
}

alias bb='bazel build'
alias bba='bazel build //...:all'
alias bbr='bazel run'
alias bbx='bazel clean --expunge'
alias bbq='bazel query'
alias bbt='bazel test'
alias bbqa='bazel query //...:all'

29 changes: 29 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Bazel RC file for Local
#
# Flare Folks: please feel free to update this as you see fit. I put
# initial values here that make the output pretty and github caching
# possible. I am not as certain about the JVM args.

# Startup Options
startup --host_jvm_args=-Xmx500m

# Build Options
build --verbose_failures
build --jobs 30
build --progress_report_interval=2
build --color yes
build --incompatible_strict_action_env
build --show_timestamps

# These inherit from Build
test --verbose_failures
test --test_verbose_timeout_warnings
test --verbose_explanations

# These also inherit from build
query --keep_going

# Custom user overrides
# https://docs.bazel.build/versions/master/best-practices.html#bazelrc
try-import %workspace%/.bazelrc.user
try-import %workspace%/user.bazelrc
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.1
3.4.1
17 changes: 0 additions & 17 deletions .circleci/.bazelrc

This file was deleted.

2 changes: 1 addition & 1 deletion .circleci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# rules_ruby circleci Docker file.
#
FROM ruby:2.7.0
FROM ruby:2.7.1

# make Apt non-interactive
RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci \
Expand Down
7 changes: 1 addition & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
working_directory: /home/circleci/repo
resource_class: medium
docker:
- image: bazelruby/ruby-2.7.0
- image: bazelruby/ruby-2.7.1
environment:
PATH: "/usr/local/bin:/usr/bin:/sbin:/opt/bin:/home/circleci/repo/bin:/bin:/sbin:/usr/sbin"
BUNDLE_PATH: /home/circleci/.bundle_cache
Expand All @@ -19,7 +19,6 @@ jobs:
- run:
name: "Install ~/.bazelrc and run setup"
command: |
cp .circleci/.bazelrc ${HOME}
/usr/bin/env bash bin/setup

- run:
Expand All @@ -40,7 +39,6 @@ jobs:
- run:
name: "Install ~/.bazelrc and run setup"
command: |
cp .circleci/.bazelrc ${HOME}
/usr/bin/env bash bin/setup

- run:
Expand All @@ -57,7 +55,6 @@ jobs:
- run:
name: "Install ~/.bazelrc and run setup"
command: |
cp .circleci/.bazelrc ${HOME}
/usr/bin/env bash bin/setup

- run:
Expand All @@ -74,7 +71,6 @@ jobs:
- run:
name: "Install ~/.bazelrc and run setup"
command: |
cp .circleci/.bazelrc ${HOME}
/usr/bin/env bash bin/setup

- run:
Expand All @@ -91,7 +87,6 @@ jobs:
- run:
name: "Install ~/.bazelrc and run setup"
command: |
cp .circleci/.bazelrc ${HOME}
/usr/bin/env bash bin/setup

- run:
Expand Down
8 changes: 8 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,11 @@

PATH_add bin

[[ -n $(command -V brew) ]] && {
completion="$(brew --prefix)/etc/bash_completion"
[[ -f "${completion}" ]] && {
echo "Loading bash completion"
source "${completion}"
}
}

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
**/vendor/bundle/**
**/.DS_Store
**/.vscode

.bazelrc.user
user.bazelrc
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.7.1
2 changes: 1 addition & 1 deletion .rules_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.2
0.4.0
1 change: 1 addition & 0 deletions .shellcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
disable=SC1090,SC1091,SC2155,SC2154,SC2059,SC2046
26 changes: 25 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ jdk: openjdk11
cache:
directories:
- ${HOME}/.rbenv
- ${HOME}/.bazel
- ${HOME}/.bundle/gems

addons:
Expand All @@ -15,9 +16,30 @@ addons:
- libstdc++6
- build-essential
- g++
- autoconf
- bison
- libssl-dev
- libyaml-dev
- libreadline6-dev
- zlib1g-dev
- libncurses5-dev
- libffi-dev
- libgdbm-dev

script:
before_script:
- rm -f /home/travis/.phpenv/bin/rbenv
- hash -r
- mkdir -p /home/travis/.cache/bazel-out
- mkdir -p /home/travis/.cache/bazel-cache
- rm -f .bazelrc.user
- echo 'build --disk_cache=/home/travis/.cache/bazel-cache' >> .bazelrc.user
- echo 'startup --output_base=/home/travis/.cache/bazel-out' >> .bazelrc.user
- cat .bazelrc
- cat .bazelrc.user
- /usr/bin/env bash bin/setup
- /usr/bin/env bash bin/show-env

script:
- /usr/bin/env bash bin/test-suite

after_script:
Expand All @@ -26,6 +48,8 @@ after_script:
env:
global:
- CI=true
- SCREEN_WIDTH=70
- RBENV_ROOT="${HOME}/.rbenv"
- BUNDLE_PATH="${HOME}/.bundle/gems"
- PATH="${HOME}/.rbenv/bin:${HOME}/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin:/opt/local/bin:${PATH}"
- BAZEL_OPTS="--host_jvm_args=-Xmx1200m --host_jvm_args=-Xms1200m"
Expand Down
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.4.0 / 2020-07-29

[Total Changes since v0.3.0](https://github.com/bazelruby/rules_ruby/compare/v0.3.0...v0.4.0)

# 0.3.0 / 2020-03-02

[Total Changes since v0.2.0](https://github.com/bazelruby/rules_ruby/compare/v0.2.0...v0.3.0)
Expand All @@ -13,10 +17,10 @@

## Other Changes

* Introduced `ruby_gem` rule for packaging Ruby sources into a RubyGem-compatible zip file. Note, the resulting file has `.zip` extension.
* Introduced `ruby_gem` rule for packaging Ruby sources into a RubyGemInfo-compatible zip file. Note, the resulting file has `.zip` extension.
* Introduced `ruby_rubocop` rule for running rubocop in analysis mode or auto-correcting mode.
* Added an example gem workspace under `examples/example-gem`
* Default ruby used is now 2.7.0. We also now allow 2.7.0 to be built by Bazel.
* Default ruby used is now 2.7.1. We also now allow 2.7.1 to be built by Bazel.
* Bazelisk has been updated to 1.3.0
* Updated Bazel version from 2.0.0 to 2.1.0
* Updated gem versions in the Gemfile
Expand All @@ -29,4 +33,4 @@

# 0.1.0 / 2019-11-20

* Initial migration from [Yugui](https://github.com/yugui) rules ruby.
* Initial migration from [Yugui](https://github.com/yugui) rules ruby.
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

source 'https://rubygems.org'

gem 'rubocop', '~> 0.78'
gem 'bundler'
gem 'rubocop', '~> 0.88'
7 changes: 4 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ GEM
rubocop-ast (>= 0.1.0, < 1.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-ast (0.1.0)
rubocop-ast (0.2.0)
parser (>= 2.7.0.1)
ruby-progressbar (1.10.1)
unicode-display_width (1.7.0)
Expand All @@ -26,7 +26,8 @@ PLATFORMS
ruby

DEPENDENCIES
rubocop (~> 0.78)
bundler
rubocop (~> 0.88)

BUNDLED WITH
2.1.2
2.1.4
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ rules_ruby_dependencies()
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()

rules_ruby_select_sdk(version = "2.7.0")
rules_ruby_select_sdk(version = "2.7.1")

#———————————————————————————————————————————————————————————————————————
# Now, load the ruby_bundle rule & install gems specified in the Gemfile
Expand Down
21 changes: 10 additions & 11 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ bazel_skylib_workspace()

load("@bazel_skylib//lib:versions.bzl", "versions")

versions.check("2.1.1")
versions.check("3.4.1")

rules_ruby_select_sdk("2.7.0")
rules_ruby_select_sdk("2.7.1")

local_repository(
name = "bazelruby_rules_ruby_ruby_tests_testdata_another_workspace",
Expand All @@ -25,22 +25,21 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
# installing go for buildifier
http_archive(
name = "io_bazel_rules_go",
sha256 = "842ec0e6b4fbfdd3de6150b61af92901eeb73681fd4d185746644c338f51d4c0",
sha256 = "8663604808d2738dc615a2c3eb70eba54a9a982089dd09f6ffe5d0e75771bc4f",
urls = [
"https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/rules_go/releases/download/v0.20.1/rules_go-v0.20.1.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.20.1/rules_go-v0.20.1.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.23.6/rules_go-v0.23.6.tar.gz",
],
)

git_repository(
name = "bazel_gazelle",
commit = "11a9ed24876401ee8b570c04de3a132e62415304",
commit = "c00612418c4dbc9f3cd35fe71fe1147748048b69",
remote = "https://github.com/bazelbuild/bazel-gazelle",
)

git_repository(
name = "com_google_protobuf",
commit = "09745575a923640154bcf307fba8aedff47f240a",
commit = "6c61c1e63b9be3c36db6bed19032dfc0d63aadda",
remote = "https://github.com/protocolbuffers/protobuf",
shallow_since = "1558721209 -0700",
)
Expand All @@ -49,7 +48,7 @@ load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_depe

go_rules_dependencies()

go_register_toolchains(go_version = "1.12.9")
go_register_toolchains(go_version = "1.14.6")

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")

Expand All @@ -63,9 +62,9 @@ protobuf_deps()

http_archive(
name = "io_bazel_rules_docker",
sha256 = "14ac30773fdb393ddec90e158c9ec7ebb3f8a4fd533ec2abbfd8789ad81a284b",
strip_prefix = "rules_docker-0.12.1",
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.12.1/rules_docker-v0.12.1.tar.gz"],
sha256 = "4521794f0fba2e20f3bf15846ab5e01d5332e587e9ce81629c7f96c793bb7036",
strip_prefix = "rules_docker-0.14.4",
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.14.4/rules_docker-v0.14.4.tar.gz"],
)

load(
Expand Down
38 changes: 38 additions & 0 deletions bin/clean
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash
# vim: ft=sh
# —————————————————————————————————————————————————————————————————————————————————————
# NOTE: These setup scripts rely on an open source BASH framework BashMatic.
# https://github.com/kigster/bashmatic
#
# The framework is pretty light-weight, and is installed in your $HOME/.bashmatic folder.
# You can safely remove that folder after the setup if you wish, although re-running the
# setup will re-install it.
# —————————————————————————————————————————————————————————————————————————————————————

export BashMatic="${HOME}/.bashmatic"

if [[ ! -f "${BashMatic}/init.sh" ]]; then
rm -rf "${BashMatic}" 2>/dev/null
git clone https://github.com/kigster/bashmatic "${BashMatic}" 1>/dev/null 2>&1
fi

# shellcheck disable=SC1090
source "${BashMatic}/init.sh" 1>/dev/null 2>&1

main() {
export BAZEL_OPTS="--max_idle_secs=10800 --noshutdown_on_low_sys_mem --connect_timeout_secs=30"
h1 "Cleaning Bazel directories... Please wait."
local -a du_before=($(du -hs .))
run "bazel clean --expunge"
for dir in $(ls -1 examples); do
run "cd examples/${dir}"
run "bazel clean --expunge"
run "cd -"
done
local -a du_after=($(du -hs .))
h2 "Space before cleaning: ${bldylw}${du_before[0]}" \
"Space after cleaning: ${bldgrn}${du_after[0]}"
}

main "$@"

Loading