Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.
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
9 changes: 7 additions & 2 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
version = 2.6.4
version = 3.0.0-RC2
maxColumn = 150
assumeStandardLibraryStripMargin = true
continuationIndent.callSite = 2
includeCurlyBraceInSelectChains = true
# includeNoParensInSelectChains = true
binPack.literalArgumentLists = false
rewrite.rules = [AvoidInfix, SortImports, SortModifiers, RedundantParens, PreferCurlyFors] # RedundantBraces

runner.dialect = scala3
rewrite.scala3 {
convertToNewSyntax = true
removeOptionalBraces = true
}

project.git = true

Expand Down
16 changes: 10 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@ deps-update:
bazel run @annex//:pin
bazel run @annex_scalafmt//:pin
bazel run @annex_proto//:pin

cd tests && bazel run @annex_test//:pin

deps-install:
bazel run @unpinned_annex//:pin
bazel run @unpinned_annex_scalafmt//:pin
bazel run @unpinned_annex_proto//:pin

cd tests && bazel run @unpinned_annex_test//:pin
REPIN=1 bazel run @unpinned_annex//:pin
REPIN=1 bazel run @unpinned_annex_scalafmt//:pin
REPIN=1 bazel run @unpinned_annex_proto//:pin
cd tests && REPIN=1 bazel run @unpinned_annex_test//:pin

deps-outdated:
bazel run @annex//:outdated
bazel run @annex_scalafmt//:outdated
bazel run @annex_proto//:outdated
cd tests && bazel run @annex_test//:outdated

bzl-lint:
fd -E bazel/deps -E 3rdparty -E cargo "^(.*BUILD|WORKSPACE|.*\\.bzl)" . -x buildifier --lint=warn --warnings=all \;
Expand Down
81 changes: 0 additions & 81 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -81,84 +81,3 @@ scala_proto_register_toolchains()
load("@annex_proto//:defs.bzl", annex_proto_pinned_maven_install = "pinned_maven_install")

annex_proto_pinned_maven_install()

bazel_commit = "4.0.0"

http_archive(
name = "bazel",
sha256 = "2b9999d06466815ab1f2eb9c6fc6fceb6061efc715b4086fa99eac041976fb4f",
strip_prefix = "bazel-{}".format(bazel_commit),
url = "https://github.com/bazelbuild/bazel/archive/{}.tar.gz".format(bazel_commit),
)

scala2_version = "2.13.6-bin-107c727"

server_urls = [
"https://repo1.maven.org/maven2",
"https://scala-ci.typesafe.com/artifactory/scala-integration/",
]

jvm_maven_import_external(
name = "scala_compiler_2_13_5",
artifact = "org.scala-lang:scala-compiler:" + scala2_version,
artifact_sha256 = "61a1d7765b716e29bddcc05d5c8bcb8caf68745016b50b4d00f4a895808044f6",
server_urls = server_urls,
)

jvm_maven_import_external(
name = "scala_library_2_13_5",
artifact = "org.scala-lang:scala-library:" + scala2_version,
artifact_sha256 = "7e4ea50c2abdd7e7c9d58df823354b765c5efb797ae9550a959b7f47e6ad18c2",
server_urls = server_urls,
)

jvm_maven_import_external(
name = "scala_reflect_2_13_5",
artifact = "org.scala-lang:scala-reflect:" + scala2_version,
artifact_sha256 = "53f5c2de8beab1093f458866dbbc86a1ce8e570f47768b037d09a054347e0096",
server_urls = server_urls,
)

scala3_version = "3.0.0-RC1"

jvm_maven_import_external(
name = "scala_compiler_3_0_0",
artifact = "org.scala-lang:scala3-compiler_3.0.0-RC1:" + scala3_version,
artifact_sha256 = "d1f6c9d56b31ebd3e643284ef49643a40a563eb24c026c9b3806f208beeded42",
server_urls = server_urls,
)

jvm_maven_import_external(
name = "scala_library_3_0_0",
artifact = "org.scala-lang:scala3-library_3.0.0-RC1:" + scala3_version,
artifact_sha256 = "0fc5fa72f30f6c789cbe000d1fbebbc6ae927c73c1058d0f18871a9b3b79fc66",
server_urls = server_urls,
)

jvm_maven_import_external(
name = "scala_tasty_core_3_0_0",
artifact = "org.scala-lang:tasty-core_3.0.0-RC1:" + scala3_version,
artifact_sha256 = "c485550b896a18a5ddcb9a95846a6d7ea6b9d4ae8e93b8937681eefeb7f20e77",
server_urls = server_urls,
)

jvm_maven_import_external(
name = "scala_interfaces_3_0_0",
artifact = "org.scala-lang:scala3-interfaces:" + scala3_version,
artifact_sha256 = "6960bca56897940acc2183f0316360fca0d49cd3dfcdd660b524766c36e573a0",
server_urls = server_urls,
)

jvm_maven_import_external(
name = "scala_sbt_bridge_3_0_0",
artifact = "org.scala-lang:scala3-sbt-bridge:" + scala3_version,
artifact_sha256 = "361f373f3967c6816a220498e0f0ca4c54d9c65a32b4a4c1877a7060d4ba8282",
server_urls = server_urls,
)

jvm_maven_import_external(
name = "scala_asm_9_1_0",
artifact = "org.scala-lang.modules:scala-asm:9.1.0-scala-1",
artifact_sha256 = "b85af6cbbd6075c4960177c2c3aa03d53b5221fa58b0bc74a31b72f25595e39f",
server_urls = server_urls,
)
1,702 changes: 858 additions & 844 deletions annex_install.json

Large diffs are not rendered by default.

172 changes: 89 additions & 83 deletions annex_proto_install.json

Large diffs are not rendered by default.

1,286 changes: 626 additions & 660 deletions annex_scalafmt_install.json

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions docs/newdocs/scala_versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This attribute defaults to using the `default_scala` specified via `bind` in the
```python
bind(
name = "default_scala",
actual = "//scala:2_13",
actual = "//scala:zinc_3_0_0",
)
```

Expand All @@ -16,34 +16,34 @@ We provide two means of creating the `ScalaConfiguration`: `configure_bootstrap_
Example:

```python
compiler_classpath_2_13_5 = [
"@scala_compiler_2_13_5//jar",
"@scala_library_2_13_5//jar",
"@scala_reflect_2_13_5//jar",
compiler_classpath_2_13_6 = [
"@scala_compiler_2_13_6//jar",
"@scala_library_2_13_6//jar",
"@scala_reflect_2_13_6//jar",
]

runtime_classpath_2_13_5 = [
"@scala_library_2_13_5//jar",
runtime_classpath_2_13_6 = [
"@scala_library_2_13_6//jar",
]

# This creates a basic ScalaConfiguration that relies on the scalac compiler
configure_bootstrap_scala(
name = "bootstrap_2_13_5",
compiler_classpath = compiler_classpath_2_13_5,
runtime_classpath = runtime_classpath_2_13_5,
name = "bootstrap_2_13_6",
compiler_classpath = compiler_classpath_2_13_6,
runtime_classpath = runtime_classpath_2_13_6,
version = "2.13.3",
visibility = ["//visibility:public"],
)

# compiler bridge needed to configure zinc compiler
scala_library(
name = "compiler_bridge_2_13_5",
name = "compiler_bridge_2_13_6",
srcs = [
"@compiler_bridge_2_13//:src",
],
scala = ":bootstrap_2_13_5",
scala = ":bootstrap_2_13_6",
visibility = ["//visibility:public"],
deps = compiler_classpath_2_13_5 + [
deps = compiler_classpath_2_13_6 + [
"@scala_annex_org_scala_sbt_compiler_interface//jar",
"@scala_annex_org_scala_sbt_util_interface//jar",
],
Expand All @@ -52,9 +52,9 @@ scala_library(
# This augments the configuration to configure the zinc compiler
configure_zinc_scala(
name = "zinc_2_13",
compiler_bridge = ":compiler_bridge_2_13_5",
compiler_classpath = compiler_classpath_2_13_5,
runtime_classpath = runtime_classpath_2_13_5,
compiler_bridge = ":compiler_bridge_2_13_6",
compiler_classpath = compiler_classpath_2_13_6,
runtime_classpath = runtime_classpath_2_13_6,
version = "2.13.3",
visibility = ["//visibility:public"],
)
Expand All @@ -68,7 +68,7 @@ For example:
scala_library(
name = "example_compiled_with_scalac",
srcs = glob(["**/*.scala"])
scala = "<package>:bootstrap_2_13_5
scala = "<package>:bootstrap_2_13_6
)

scala_library(
Expand Down
70 changes: 52 additions & 18 deletions flake.lock

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

29 changes: 10 additions & 19 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,20 @@
url = "github:edolstra/flake-compat";
flake = false;
};
flake-utils.url = "github:numtide/flake-utils";
java.url = "github:TawasalMessenger/jdk-flake";
};

outputs = { self, nixpkgs, flake-compat, java }:
outputs = { self, nixpkgs, flake-compat, flake-utils, java }:
let
sources = with builtins; (fromJSON (readFile ./flake.lock)).nodes;
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
jdk = java.defaultPackage.${system};
bazel_4 = with pkgs; callPackage "${nixpkgs}/pkgs/development/tools/build-managers/bazel/bazel_4/default.nix" rec {
inherit (darwin) cctools;
inherit (darwin.apple_sdk.frameworks) CoreFoundation CoreServices Foundation;
stdenv = pkgs.stdenv;
bazel_self = bazel_4;

buildJdk = jdk11;
buildJdkName = "java11";
runJdk = jdk;
};
in
rec {
devShell.${system} = pkgs.callPackage ./shell.nix {
inherit jdk bazel_4;
};
};
flake-utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" ] (system:
let
pkgs = import nixpkgs { inherit system; };
jdk = java.defaultPackage.${system};
in
rec {
devShell = pkgs.callPackage ./shell.nix { inherit jdk; };
});
}
Loading