Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Commit 5d1e922

Browse files
Napas (Tian) Udomsaklaurentlbhmemcpylong-stripejohnynek
authored
Merge bazel build master (#9)
* Fix code for Bazel change --incompatible_no_support_tools_in_action_inputs (bazelbuild#758) * Specs2 filtering runner now filters test cases according to filter. (bazelbuild#759) This allows the bazel test runner correctly generate the test log, based only on tests that actually did run. * Add scala_doc rule (bazelbuild#760) * move collect_plugin_paths to common.bzl * add scala_doc rule + aspect implementations * add basic scala_doc Markdown documentation * add scala_doc example * collect plugins in aspect too * declare_directory for scaldoc output path or else it complains * add a simple test target for scala_doc rule * add doc note about scaladoc being kind of slow * fix scala_doc.md code block * privatize scaladoc aspect * get more src_files/compile_jars * also accept scalacopts in scala_doc * turn off scaladoc warnings for now * use host_path_separator in classpath * Update scala_doc.md fix the string `scala_doc` which was copy-pasted as `scala_binary` * Explicitly convert depset to list (bazelbuild#761) This will be required by Bazel 0.27, where the flag `--incompatible_no_support_tools_in_action_inputs` will be on by default. The function `collect_plugin_paths` iterates over its argument, so we need to flatten the depset. * Make sure that plus-one-deps from exports of direct deps also propagate (bazelbuild#764) * PlusOne propagates PlusOne deps of exports * rename of tests * correct test dependency * use scala toolchain to toggle on +1 collection * fix grpc opencensus stats integration (bazelbuild#762) * fix grpc opencensus stats integration - upgrade opencensus-java packages to the latest (0.22.1) - add opencensus-impl and opencensus-impl-core * add opencensus-impl transitive dependency com.lmax:disruptor * Add Canva to the adopters list (bazelbuild#770) * Depset is not iterable (bazelbuild#773) * Specify which version of bazel is required. (bazelbuild#772) * Specify which version of bazel is required. * Update README.md * Specs2 filtering of JUnit descriptions (bazelbuild#766) * Specs2 now will create its JUnit Description tree with filtered child items * Creating a filtered description tree from Specs2 utilities - keeps ordering and hashCodes intact * Redirecting test error output * Update "Getting started" WORKSPACE block (bazelbuild#778) * Migrate from java_common.create_provider to JavaInfo() (bazelbuild#781) * Migrate from java_common.create_provider to JavaInfo() * Fix scala/private/common.bzl * Fix some build failures. * Fix some more builds. * Remove scala/private/common:create_java_provider * Remove unused _create_provider. * Remove unused load statement * Also propagate deps and runtime_deps in scala_import with no jars. * Address review comments. * Update custom-jvm-rule.bzl * Update BUILD * typo * Removed implicit value for deps_providers. * Add dummy intermediate jar file for scala_import with no jars. * Cleanup code. * Replace + with lists extend. * Revert enabling --all_incompatible_changes test by mistake. * Passing source-jar into JavaInfo (bazelbuild#783) * expose source_jar in JavaInfo * nit: clarify conditional * nit: replace one hack with another * nit: replace concat with append * remove "main" attr usage it's no longer needed * add comment * remove usage of attr scala with JavaInfo outputs (bazelbuild#784) * Port bazelbuild/bazel#8196 : improve java_stub_template MANIFEST.MF construction speed (bazelbuild#736) * Import java_stub_template from bazelbuild@8b8271e * Port changes from bazelbuild/bazel#8196 * Remove java_stub_template from WORKSPACE * Update java_stub_template archive URL * Make java_stub_template a normal file * JavaInfo provider should be given for deps (bazelbuild#774) * a JavaInfo provider should be given for deps * flatten providers lists * Revert "flatten providers lists" This reverts commit a464f61. * remove print warning if dep has no JavaInfo since it's required now (bazelbuild#788) * Handle FileAlreadyExistsException in ScalaPBGenerator (bazelbuild#789) * Exclude jmh from reproducibility test, since the code generator is non-deterministic. (bazelbuild#791) bazelbuild#699 * warn if jvm_flags is used in scala_library (bazelbuild#795) * Allow for code coverage to be run on 0.27.1 (bazelbuild#780) * Allow for code coverage to be run on 0.27.1 * Update expected-coverage.dat * actually remove all merge conflicts remove scala_doc merge conflict spacing newline * Replace jar_sha256 with artifact_sha256. (bazelbuild#792) * Simplify _jacoco_offline_instrument. (bazelbuild#790) resolve_command shouldn't be required here. * silence tut (bazelbuild#799) * Due to limitations in the toolchains implementation this is required … (bazelbuild#801) * Add test for host deps * Add a test hopefully to illustrate host deps * Update test * Change api usage to use binds * Remove errant print * See if behavior is different on 0.28.1 * incompatible_string_join_requires_strings: string.join(list) accepts invalid (non-string) list elements * Add a to_list * Another case of depset iterable * Windows ci can only support 0.28.0 via chocolaty right now * Add scalac_jvm_flags option to toolchain (bazelbuild#803) * Add scalac_jvm_flags to scala_toolchain This allows things like setting the max heap on all Scalac workers. * Add docs * Fix comment * Add enable_code_coverage_aspect to the docs * Flags on target should override flags on toolchain. Also fix comment. * Add `scala_test_jvm_flags` to toolchain (bazelbuild#804) * Add scala_test_jvm_flags to the toolchain * Fix package name * Fix target names * Add trivial test suite and rename some things * Wrap all jvm_flags in _expand_location * Remove the deprecated attribute proto_source_root. (bazelbuild#793) * Remove the deprecated attribute proto_source_root. Replace it with strip_import_prefix, its spiritual successor. * Update Bazel version on Travis * Update rules_scala to work with Bazel >=0.27. The flag --incompatible_string_join_requires_strings was flipped, which this repository was incompatible with. * Update to Bazel 0.26 instead. test_coverage_on fails for some mysterious reason that seems unrelated to the cleanup crusade I'm pursuing at the moment. * add point release number so that downloading Bazel succeeds * change whitespace to re-trigger build * update Bazel version, hopefully properly * update test_expected_failure/ * minimize diff * re-trigger Travis * re-trigger Travis again * update README.md note the last version of 0.23 that we ran CI on. * Fix a regression that breaks scalapb when jvm_flags are set on the toolchain (bazelbuild#806) * Fix a regression that breaks scalapb when jvm_flags are set on the toolchain * Move passing manual tests to new directory * Migrate from old-style .java provider to JavaInfo. (bazelbuild#807) * Migrate from old-style .java provider to JavaInfo. * Remove usage of .scala. * Flip these around to be correct (bazelbuild#810) * Clean up jmh rule a bit (bazelbuild#811) * Move scala_repositories macro out to its own file + move scala_doc.bzl (bazelbuild#808) * move scala_repositories macro out to its own file * move scala_repositories.bzl and scala_doc.bzl to private * Pin Bazel versions (bazelbuild#812) * Pin Bazel versions * ensure one set of jobs is named test * Keep the original build structure * fix version for windows * add ci stopgap to scripts used in ci * fix ci errors * adjust for buildkite * remove unused param * Tweak travis image config * use sh language * libxml2-utils * use apt addon * Add notes about updating bazel versions * Move scala_binary to its own file (bazelbuild#813) * add a note about code organization in CONTRIBUTING.md * wip move scala_binary out * fully split out scala_binary properly * _library_outputs is the same thing as common_outputs * fix a bunch more scalac_provider references * rename scala_provider function to get_scalac_provider per review * back to the old variable names * Delurk Powershell for a more unified test setup (bazelbuild#814) * Attempt to delurk powershell * 💥 * adjust * adjust * Add a basic PR template (bazelbuild#817) * Move scala_test/scala_test_suite to their own file (bazelbuild#815) * move scala_test rule to its own file * move scala_test_suite to scala_test.bzl, move sanitize_string_for_usage function to common.bzl for now * add a docstring about scala_test.bzl * move test_resolve_deps to private variable in scala_test.bzl * remove suites attribute debug print * move scala_repl rule to its own file (bazelbuild#820) * remove long-deprecated 'suites' attr in scala_test (bazelbuild#819) * move scala_junit_test rule to its own file (bazelbuild#822) * rename proto rule while maintaining backwards compat (bazelbuild#821) * Disable windows CI (bazelbuild#823) * Move library rules (bazelbuild#827) * move library_attrs to common_attributes.bzl * move scala_macro_library rule to its own file * move all _library rules to scala_library.bzl, private stuff too * move _lib into scala_library.bzl * alphasort * Buildifier as the only lint (bazelbuild#826) * Load buildifier directly * update lint scripts * let buildifier reformat everything * Test lints in CI * remove accidental file extension * use skylib version compatible with rules_go and buildifier * fix an unformatted file that breaks ci (bazelbuild#830) * use travis job pipelines (bazelbuild#829) * Default to usage of scala_proto_library instead of scalapb_proto_library alias (bazelbuild#831) * Refactor build_deployable (bazelbuild#832) * build_deployable -> merge_jars with a more explicit interface * add docstring doc to merge_jars * buildifier fix * parameterize the entire progress_message * Update README.md to include Grand Rounds (bazelbuild#835) * Minor fix to error message (bazelbuild#841) Was not properly adding space, as such: ``` java.lang.IllegalStateException: Was not able to discover any classes for archives=testsuite/test/example/example.jarprefixes=Set(), suffixes=Set(Test) ``` * Remove jvm_flags debug print for scala_library (bazelbuild#840) * remove jvm_flags debug print for scala_library * hard fail for jvm_flags in scala_library, re-add jvm_flags attr for other rules * remove fail, not needed if attr isn't supported * Improve classpath manifest file construction (bazelbuild#842) * use java_common.merge instead of manual _collect util functions (bazelbuild#838) * Fix paths in --proto_path and avoid copying proto files (bazelbuild#850) * Fix paths in proto_path and avoid copying * Prepare mapping in advance * Condensed all transformations into one method * Added tests * Buildifier corrections * Split sh test (bazelbuild#849) * Split shell ingetration tests * Fix test_repl no target from clean build * Fix scala_library_jar_without_srcs_must_fail_on_mismatching_resource_strip_prefix (bazelbuild#859) * Fix test_scala_import_source_jar_should_not_be_fetched_when_env_bazel_jvm_fetch_sources_is_set_to_non_true (bazelbuild#858) * Add a test build for bazel 1.0 (bazelbuild#861) * Add a test build for bazel 1.0 * cp * cp * I think i messed this up a little and it wasn't running the older ones too, making sure we run everything this time * cp * include Bazel 1.0.0 in compatibility table (bazelbuild#863) * fix typo in codeowners github handle * Mirror all http_archives. (bazelbuild#878) Context: bazelbuild/bazel#10270 * Bump v1.0.0 compatibility test to v1.1.0 (bazelbuild#882) * Bump v1.1.0 compatibility test to v1.2.1 (bazelbuild#883) * Bump v1.1.0 compatibility test to v1.2.0 * Upgrade MacOS from HighSierra to Mojave * Empty commit to trigger a new build * Bump bazel to v1.2.1 * Fix sha for 0.28.0 * Revert "Upgrade MacOS from HighSierra to Mojave" This reverts commit a239d4e. * Update sha for 0.28.0 to HEAD * Explicitly label bazel 0.28.1 (bazelbuild#885) * Bump scala 2.12 to v2.12.10 (bazelbuild#886) * Convert maven_jar to jvm_maven_import_external (bazelbuild#889) * Bump Bazel to v2.0.0 (bazelbuild#902) * authorship attribution for higherkindness/rules_scala design (bazelbuild#903) * Refactor rules into configurable phases (bazelbuild#865) * Add configurable phases * Refactor rules implementation into configurable phases * Customizable phases * Customizable phases tests * Break up init to more reasonable phases * Move final to non-configurable phase * Rename parameter builtin_customizable_phases * Fix ijar * Switch default for buildijar * Add TODOs * Rename provider * Move to advanced_usage * rename custom_phases * Make default phase private * Fix exports_jars * Adjusted_phases * Rename p to be more clear * Add in-line comments * Fix lint * Add doc for phases * Doc for consumers * Doc for contributors * Add more content * Fix md * Test for all rules * Fix junit test * Fix lint * Add more tests * Fix junit test * Fix doc * Change _test_ to _scalatest_ * More doc on provider * expand locations in scalacopts (bazelbuild#890) * expand locations in scalac options * allow plugins in expansion * add a happy path test * make the target names more obvious * comment * Revert "expand locations in scalacopts (bazelbuild#890)" (bazelbuild#904) This reverts commit 5c966ee. * expand locations in scalacptops, take 2 (bazelbuild#907) * expand locations in scalacopts (bazelbuild#890) * expand locations in scalac options * allow plugins in expansion * add a happy path test * make the target names more obvious * comment * access ctx.attr.plugins with fallback * reformat * Plugin expansion- Use input plugins param instead of ctx (bazelbuild#909) * See test failing * Use input plugins param instead of ctx * Remove phase scala provider (bazelbuild#913) * phase_jvm_flags uses JavaInfo provider instead of scala_provider * remove phase scala_provider * readme clarifies minimum version at HEAD is 1.1.0 * travis.yml moved from 0.28.1 to 1.1.0 * Use https to access central.maven.org (bazelbuild#920) See https://support.sonatype.com/hc/en-us/articles/360041287334 And use repo.maven.apache.org instead of central.maven.org * remove me from codeowners I'm not currently a maintainer of this project. * Return providers array instead of legacy struct (bazelbuild#916) * runfiles and files are part of explicit DefaultInfo provider and do not come from attributes * removed transitive_rjars attribute as it was only needed internally and before phases was exposed mistakenly because that's how the infra worked Now internally phases use p.compile.rjars * executable attribute part of DefaultInfo as well * use coverage_common.instrumented_files_info provider instead of attribute * remove redundant attributes * linting * return array of providers instead of struct * scala_import return array of providers instead of struct * Move declare_executable to phase file (bazelbuild#919) * chore(docs): update WORKSPACE setup for skylib (bazelbuild#926) * scalatest final-remove redundant coverage handling (bazelbuild#923) * update bazel-toolchains version (bazelbuild#937) fix bazelbuild#901 * Move code from rule impls/common to phases (bazelbuild#930) * collect_srcjars to phase * move compile_or_empty and needed code to phase_compile (from rule_impls) * phase_compile to take scalac_provider from phases instead of rule_impls * rule_impls loads are loaded as private and unused are removed * get_scalac_provider in phase_scalac_provider and not rule_impls * move write_java_wrapper from rule_impls to phase_java_wrapper * move merge_jars from rule_impls to phase_merge_jars * move get_unused_dependency_checker_mode from rule_impls to get_unused_dependency_checker_mode * move write_manifest from common to get_write_manifest * move collect_jars_from_common_ctx from rule_impls to phase_collect_jars * move write_executable from rule_impls to phase_write_executable * linting * [CR] inline _collect_jars_from_common_ctx * [CR] inline _collect_srcjars * [CR] inline write_java_wrapper * [CR] inline merge_jars * [CR] inline _write_executable * add default for fetch sources Co-authored-by: Laurent Le Brun <[email protected]> Co-authored-by: Igal Tabachnik <[email protected]> Co-authored-by: Long Cao <[email protected]> Co-authored-by: P. Oscar Boykin <[email protected]> Co-authored-by: Ittai Zeidman <[email protected]> Co-authored-by: Mackenzie Starr <[email protected]> Co-authored-by: Jonathon Belotti <[email protected]> Co-authored-by: ianoc-stripe <[email protected]> Co-authored-by: Parth <[email protected]> Co-authored-by: Christopher Johnson <[email protected]> Co-authored-by: Irina Iancu <[email protected]> Co-authored-by: joshrosen-stripe <[email protected]> Co-authored-by: Paul Tarjan <[email protected]> Co-authored-by: Benjamin Peterson <[email protected]> Co-authored-by: David Haxton <[email protected]> Co-authored-by: Alex Beal <[email protected]> Co-authored-by: lberki <[email protected]> Co-authored-by: Andy Scott <[email protected]> Co-authored-by: Mantas Sakalauskas <[email protected]> Co-authored-by: Shachar Anchelovich <[email protected]> Co-authored-by: ignasl <[email protected]> Co-authored-by: Bor Kae Hwang <[email protected]> Co-authored-by: Philipp Wollermann <[email protected]> Co-authored-by: chenrui <[email protected]> Co-authored-by: Jin <[email protected]> Co-authored-by: Andreas Herrmann <[email protected]>
1 parent 1c4fcd0 commit 5d1e922

File tree

173 files changed

+6240
-3843
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+6240
-3843
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Description
2+
<!-- Mandatory: A crisp one or two line description of your proposed change. -->
3+
4+
5+
<!-- Optional:
6+
A longer explanation of your proposed changes..
7+
This includes listing any breaking changes, if there are any.
8+
-->
9+
10+
### Motivation
11+
<!-- Mandatory: A summary of why you are making this change. -->

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ hash1
55
hash2
66
.DS_store
77
.bazel_cache
8+
.ijwb

.travis.yml

+61-44
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,83 @@
1-
# trusty beta image has jdk8, gcc4.8.4
2-
dist: trusty
1+
dist: xenial
32
sudo: required
4-
# xcode8 has jdk8
5-
osx_image: xcode8
6-
# Not technically required but suppresses 'Ruby' in Job status message.
73
language: sh
84

5+
addons:
6+
apt:
7+
packages:
8+
- libxml2-utils
9+
910
cache:
1011
directories:
1112
- .bazel_cache
13+
- ~/.bazel_binaries
1214

13-
os:
14-
- linux
15-
- osx
16-
- windows
15+
_linux: &linux
16+
os: linux
17+
_osx: &osx
18+
os: osx
19+
osx_image: xcode10.1
20+
_windows:
21+
os: windows
1722

18-
env:
19-
# Linting is broken. Disable until fixed.
20-
# See https://github.com/bazelbuild/rules_scala/pull/622
21-
# we want to test the last release
22-
#- V=0.16.1 TEST_SCRIPT=test_lint.sh
23-
- V=0.23.1 TEST_SCRIPT=test_rules_scala
24-
#- V=0.14.1 TEST_SCRIPT=test_intellij_aspect.sh
25-
- V=0.23.1 TEST_SCRIPT=test_reproducibility
23+
###
24+
#
25+
# Want to update/change bazel versions?
26+
#
27+
# 1. Update the bazel_version case statement in
28+
# ./tools/bazel to include hashes for the bazel version
29+
# you're targeting.
30+
#
31+
# 2. either
32+
# - If you're updating the default bazel version, change
33+
# default_bazel_version in ./tools/bazel.
34+
# or
35+
# - If you want to add an additional bazel version to the build
36+
# matrix, set BAZEL_VERSION=<desired-version> along side
37+
# TEST_SCRIPT below.
38+
#
39+
# 3. If you need to update the Windows version, adjust
40+
# the windows specific install code below.
41+
#
42+
###
2643

44+
jobs:
45+
include:
46+
# Lint
47+
- stage: test
48+
<<: *linux
49+
env: TEST_SCRIPT=test_lint
50+
# Test
51+
- <<: *linux
52+
env: TEST_SCRIPT=test_rules_scala BAZEL_VERSION=1.1.0
53+
- <<: *linux
54+
env: TEST_SCRIPT=test_rules_scala BAZEL_VERSION=2.0.0
55+
- <<: *linux
56+
env: TEST_SCRIPT=test_reproducibility BAZEL_VERSION=1.1.0
57+
- <<: *linux
58+
env: TEST_SCRIPT=test_reproducibility BAZEL_VERSION=2.0.0
59+
- <<: *osx
60+
env: TEST_SCRIPT=test_rules_scala BAZEL_VERSION=1.1.0
61+
- <<: *osx
62+
env: TEST_SCRIPT=test_rules_scala BAZEL_VERSION=2.0.0
63+
- <<: *osx
64+
env: TEST_SCRIPT=test_reproducibility BAZEL_VERSION=1.1.0
65+
- <<: *osx
66+
env: TEST_SCRIPT=test_reproducibility BAZEL_VERSION=2.0.0
2767

2868
before_install:
2969
- |
3070
if [[ "${TRAVIS_OS_NAME}" == "windows" ]]; then
3171
choco install jdk8 -params 'installdir=c:\\java8'
32-
choco install bazel --version ${V}
33-
else
34-
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
35-
OS=darwin
36-
else
37-
sudo sysctl kernel.unprivileged_userns_clone=1
38-
sudo add-apt-repository -y ppa:openjdk-r/ppa
39-
sudo apt-get update -q
40-
sudo apt-get install openjdk-8-jdk -y
41-
sudo apt-get install libxml2-utils -y
42-
OS=linux
43-
fi
44-
45-
if [[ $V =~ .*rc[0-9]+.* ]]; then
46-
PRE_RC=$(expr "$V" : '\([0-9.]*\)rc.*')
47-
RC_PRC=$(expr "$V" : '[0-9.]*\(rc.*\)')
48-
URL="https://storage.googleapis.com/bazel/${PRE_RC}/${RC_PRC}/bazel-${V}-installer-${OS}-x86_64.sh"
49-
else
50-
URL="https://github.com/bazelbuild/bazel/releases/download/${V}/bazel-${V}-installer-${OS}-x86_64.sh"
51-
fi
52-
wget -O install.sh "${URL}"
53-
chmod +x install.sh
54-
./install.sh --user
55-
rm -f install.sh
72+
choco install bazel --version 0.28.0
5673
fi
5774
- cat .bazelrc.travis >> .bazelrc
5875

5976
script:
6077
- |
6178
if [[ "${TRAVIS_OS_NAME}" == "windows" ]]; then
6279
powershell -Command 'Set-ExecutionPolicy RemoteSigned -scope CurrentUser'
63-
powershell -File ./${TEST_SCRIPT}.ps1
64-
else
65-
bash ./${TEST_SCRIPT}.sh ci
80+
export JAVA_HOME='c:\\\\java8'
81+
export BAZEL_VERSION=host
6682
fi
83+
bash ./${TEST_SCRIPT}.sh ci

AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ Google Inc.
1010
Dino Wernli <[email protected]>
1111
Oscar Boykin <[email protected]>
1212
John T. Sullivan <[email protected]>
13+
Andy Scott <[email protected]>

CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @iitaiz @johnynek @dinowernil
1+
* @ittaiz @dinowernil

CONTRIBUTING.md

+6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ Before you start working on a larger contribution, you should get in touch
1717
with us first. Use the issue tracker to explain your idea so we can help and
1818
possibly guide you.
1919

20+
### Code organization
21+
22+
Core Scala rules (including their implementations) and macros go in [./scala/private/rules/](./scala/private/rules/)
23+
and [./scala/private/macros/](./scala/private/macros/), respectively, and are re-exported for public use
24+
in [./scala/scala.bzl](./scala/scala.bzl).
25+
2026
### Code reviews and other contributions.
2127
**All submissions, including submissions by project members, require review.**
2228
Please follow the instructions in [the contributors documentation](http://bazel.io/contributing.html).

README.md

+42-13
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,30 @@ This project defines core build rules for [Scala](https://www.scala-lang.org/) t
1818
* [scala_library_suite](docs/scala_library_suite.md)
1919
* [scala_test_suite](docs/scala_test_suite.md)
2020
* [thrift_library](docs/thrift_library.md)
21-
* [scalapb_proto_library](docs/scalapb_proto_library.md)
21+
* [scala_proto_library](docs/scala_proto_library.md)
2222
* [scala_toolchain](docs/scala_toolchain.md)
2323
* [scala_import](docs/scala_import.md)
24+
* [scala_doc](docs/scala_doc.md)
2425

2526
## Getting started
2627

27-
In order to use these rules you must have bazel 0.23 or later and add the
28-
following to your WORKSPACE file:
28+
1. [Install Bazel](https://docs.bazel.build/versions/master/install.html), see the [compatibility table](#bazel-compatible-versions).
29+
2. Add the following to your `WORKSPACE` file and update the `githash` if needed:
2930

3031
```python
31-
rules_scala_version="a89d44f7ef67d93dedfc9888630f48d7723516f7" # update this as needed
32-
3332
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
33+
34+
# bazel-skylib 0.8.0 released 2019.03.20 (https://github.com/bazelbuild/bazel-skylib/releases/tag/0.8.0)
35+
skylib_version = "0.8.0"
36+
http_archive(
37+
name = "bazel_skylib",
38+
type = "tar.gz",
39+
url = "https://github.com/bazelbuild/bazel-skylib/releases/download/{}/bazel-skylib.{}.tar.gz".format (skylib_version, skylib_version),
40+
sha256 = "2ef429f5d7ce7111263289644d233707dba35e39696377ebab8b0bc701f7818e",
41+
)
42+
43+
rules_scala_version="69d3c5b5d9b51537231746e93b4383384c9ebcf4" # update this as needed
44+
3445
http_archive(
3546
name = "io_bazel_rules_scala",
3647
strip_prefix = "rules_scala-%s" % rules_scala_version,
@@ -44,8 +55,8 @@ scala_register_toolchains()
4455
load("@io_bazel_rules_scala//scala:scala.bzl", "scala_repositories")
4556
scala_repositories()
4657

47-
protobuf_version="66dc42d891a4fc8e9190c524fd67961688a37bbe"
48-
protobuf_version_sha256="983975ab66113cbaabea4b8ec9f3a73406d89ed74db9ae75c74888e685f956f8"
58+
protobuf_version="09745575a923640154bcf307fba8aedff47f240a"
59+
protobuf_version_sha256="416212e14481cff8fd4849b1c1c1200a7f34808a54377e22d7447efdf54ad758"
4960

5061
http_archive(
5162
name = "com_google_protobuf",
@@ -54,6 +65,7 @@ http_archive(
5465
sha256 = protobuf_version_sha256,
5566
)
5667
```
68+
5769
This will load the `rules_scala` repository at the commit sha
5870
`rules_scala_version` into your Bazel project and register a [Scala
5971
toolchain](#scala_toolchain) at the default Scala version (2.11.12)
@@ -77,17 +89,19 @@ Rules scala supports all minor versions of Scala 2.11/2.12. By default `Scala 2.
7789
version you need to
7890
specify it when calling `scala_repositories`. `scala_repositories` takes a tuple `(scala_version, scala_version_jar_shas)`
7991
as a parameter where `scala_version` is the scala version and `scala_version_jar_shas` is a `dict` with
80-
`sha256` hashes for the maven artifacts `scala_library`, `scala_reflect` and `scala_compiler`:
92+
`sha256` hashes for the maven artifacts `scala_compiler`, `scala_library`, and `scala_reflect`:
93+
8194
```python
8295
scala_repositories((
83-
"2.12.8",
96+
"2.12.10",
8497
{
85-
"scala_compiler": "f34e9119f45abd41e85b9e121ba19dd9288b3b4af7f7047e86dc70236708d170",
86-
"scala_library": "321fb55685635c931eba4bc0d7668349da3f2c09aee2de93a70566066ff25c28",
87-
"scala_reflect": "4d6405395c4599ce04cea08ba082339e3e42135de9aae2923c9f5367e957315a"
98+
"scala_compiler": "cedc3b9c39d215a9a3ffc0cc75a1d784b51e9edc7f13051a1b4ad5ae22cfbc0c",
99+
"scala_library": "0a57044d10895f8d3dd66ad4286891f607169d948845ac51e17b4c1cf0ab569d",
100+
"scala_reflect": "56b609e1bab9144fb51525bfa01ccd72028154fc40a58685a1e9adcbe7835730"
88101
}
89102
))
90103
```
104+
91105
If you're using any of the rules `twitter_scrooge`, `tut_repositories`, `scala_proto_repositories`
92106
or `specs2_junit_repositories` you also need to specify `scala_version` for them. See `./test_version/WORKSPACE.template`
93107
for an example workspace using another scala version.
@@ -97,7 +111,10 @@ for an example workspace using another scala version.
97111

98112
| bazel | rules_scala gitsha |
99113
|--------|--------------------|
100-
| 0.23.x | HEAD |
114+
| 2.0.0 | HEAD |
115+
| 1.1.0 | HEAD |
116+
| 0.28.1 | bd0c388125e12f4f173648fc4474f73160a5c628 |
117+
| 0.23.x | ca655e5a330cbf1d66ce1d9baa63522752ec6011 |
101118
| 0.22.x | f3113fb6e9e35cb8f441d2305542026d98afc0a2 |
102119
| 0.16.x | f3113fb6e9e35cb8f441d2305542026d98afc0a2 |
103120
| 0.15.x | 3b9ab9be31ac217d3337c709cb6bfeb89c8dcbb1 |
@@ -174,6 +191,16 @@ Unused dependency checking can either be enabled globally for all targets using
174191
in these cases you can enable unused dependency checking globally through a toolchain and override individual misbehaving targets
175192
using the attribute.
176193

194+
## Advanced configurable rules
195+
To make the ruleset more flexible and configurable, we introduce a phase architecture. By using a phase architecture, where rule implementations are defined as a list of phases that are executed sequentially, functionality can easily be added (or modified) by adding (or swapping) phases.
196+
197+
Phases provide 3 major benefits:
198+
- Consumers are able to configure the rules to their specific use cases by defining new phases within their workspace without impacting other consumers.
199+
- Contributors are able to implement new functionalities by creating additional default phases.
200+
- Phases give us more clear idea what steps are shared across rules.
201+
202+
See [Customizable Phase](docs/customizable_phase.md) for more info.
203+
177204
## Building from source
178205
Test & Build:
179206
```
@@ -204,7 +231,9 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for more info.
204231
Here's a (non-exhaustive) list of companies that use `rules_scala` in production. Don't see yours? [You can add it in a PR](https://github.com/bazelbuild/rules_scala/edit/master/README.md)!
205232

206233
* [Ascend](https://ascend.io/)
234+
* [Canva](https://www.canva.com/)
207235
* [Etsy](https://www.etsy.com/)
236+
* [Grand Rounds](http://grandrounds.com/)
208237
* [Kitty Hawk](https://kittyhawk.aero/)
209238
* [Meetup](https://meetup.com/)
210239
* [Spotify](https://www.spotify.com/)

0 commit comments

Comments
 (0)