|
1 | 1 | workspace(name = "test_dt_patches")
|
2 | 2 |
|
3 |
| -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_jar") |
| 3 | +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
4 | 4 |
|
5 | 5 | http_archive(
|
6 | 6 | name = "bazel_skylib",
|
@@ -31,86 +31,18 @@ load("@io_bazel_rules_scala//:scala_config.bzl", "scala_config")
|
31 | 31 |
|
32 | 32 | scala_config(enable_compiler_dependency_tracking = True)
|
33 | 33 |
|
34 |
| -load("@io_bazel_rules_scala//scala:scala.bzl", "scala_toolchains") |
35 |
| -load( |
36 |
| - "@io_bazel_rules_scala//scala:scala_cross_version.bzl", |
37 |
| - "default_maven_server_urls", |
38 |
| -) |
39 |
| -load( |
40 |
| - "@io_bazel_rules_scala//scala:scala_maven_import_external.bzl", |
41 |
| - "scala_maven_import_external", |
42 |
| -) |
43 |
| -load("@io_bazel_rules_scala_config//:config.bzl", "SCALA_VERSION") |
44 |
| - |
45 |
| -http_jar( |
46 |
| - name = "scala_compiler_srcjar", |
47 |
| - sha256 = "95c217cc87ee846b39990e0a9c273824a384dffbac57df84d466f866df4a91ea", |
48 |
| - url = "https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.12.16/scala-compiler-2.12.16-sources.jar", |
49 |
| -) |
50 |
| - |
51 |
| -http_jar( |
52 |
| - name = "scala3_compiler_srcjar", |
53 |
| - sha256 = "3c413efa9a2921ef59da7f065c445ae1b6b97057cbbc6b16957ad052a575a3ce", |
54 |
| - url = "https://repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3/3.4.3/scala3-compiler_3-3.4.3-sources.jar", |
55 |
| -) |
56 |
| - |
57 |
| -scala_maven_import_external( |
58 |
| - name = "scala_library", |
59 |
| - artifact = "org.scala-lang:scala-library:%s" % SCALA_VERSION if SCALA_VERSION.startswith("2.") else "org.scala-lang:scala3-library_3:%s" % SCALA_VERSION, |
60 |
| - licenses = ["notice"], |
61 |
| - server_urls = default_maven_server_urls(), |
62 |
| -) |
63 |
| - |
64 |
| -scala_maven_import_external( |
65 |
| - name = "scala_compiler", |
66 |
| - artifact = "org.scala-lang:scala-compiler:%s" % SCALA_VERSION if SCALA_VERSION.startswith("2.") else "org.scala-lang:scala3-compiler_3:%s" % SCALA_VERSION, |
67 |
| - licenses = ["notice"], |
68 |
| - server_urls = default_maven_server_urls(), |
69 |
| -) |
70 |
| - |
71 |
| -# Scala 2 only |
72 |
| -scala_maven_import_external( |
73 |
| - name = "scala_reflect", |
74 |
| - artifact = "org.scala-lang:scala-reflect:%s" % SCALA_VERSION, |
75 |
| - licenses = ["notice"], |
76 |
| - server_urls = default_maven_server_urls(), |
77 |
| -) |
78 |
| - |
79 |
| -# Scala 3 only |
80 |
| -scala_maven_import_external( |
81 |
| - name = "scala3_interfaces", |
82 |
| - artifact = "org.scala-lang:scala3-interfaces:%s" % SCALA_VERSION, |
83 |
| - licenses = ["notice"], |
84 |
| - server_urls = default_maven_server_urls(), |
| 34 | +local_repository( |
| 35 | + name = "compiler_sources", |
| 36 | + path = "../compiler_sources", |
85 | 37 | )
|
86 | 38 |
|
87 |
| -scala_maven_import_external( |
88 |
| - name = "scala2_library", |
89 |
| - artifact = "org.scala-lang:scala-library:2.13.15", |
90 |
| - licenses = ["notice"], |
91 |
| - server_urls = default_maven_server_urls(), |
92 |
| -) |
| 39 | +load("@compiler_sources//:extensions.bzl", "import_compiler_source_repos") |
93 | 40 |
|
94 |
| -scala_maven_import_external( |
95 |
| - name = "tasty_core", |
96 |
| - artifact = "org.scala-lang:tasty-core_3:%s" % SCALA_VERSION, |
97 |
| - licenses = ["notice"], |
98 |
| - server_urls = default_maven_server_urls(), |
99 |
| -) |
| 41 | +import_compiler_source_repos() |
100 | 42 |
|
101 |
| -scala_maven_import_external( |
102 |
| - name = "scala_asm", |
103 |
| - artifact = "org.scala-lang.modules:scala-asm:9.7.0-scala-2", |
104 |
| - licenses = ["notice"], |
105 |
| - server_urls = default_maven_server_urls(), |
106 |
| -) |
| 43 | +load("//:extensions.bzl", "import_compiler_user_srcjar_repos") |
107 | 44 |
|
108 |
| -scala_maven_import_external( |
109 |
| - name = "sbt_compiler_interface", |
110 |
| - artifact = "org.scala-sbt:compiler-interface:1.9.6", |
111 |
| - licenses = ["notice"], |
112 |
| - server_urls = default_maven_server_urls(), |
113 |
| -) |
| 45 | +import_compiler_user_srcjar_repos() |
114 | 46 |
|
115 | 47 | srcjars_by_version = {
|
116 | 48 | # Invalid
|
@@ -178,6 +110,8 @@ srcjars_by_version = {
|
178 | 110 | },
|
179 | 111 | }
|
180 | 112 |
|
| 113 | +load("@io_bazel_rules_scala//scala:scala.bzl", "scala_toolchains") |
| 114 | + |
181 | 115 | scala_toolchains(
|
182 | 116 | fetch_sources = True,
|
183 | 117 | scala_compiler_srcjars = srcjars_by_version,
|
|
0 commit comments