Skip to content

Commit 6e1ecc3

Browse files
committed
Add deprecation warnings for direct access to the jetbrain repository.
1 parent aa68e4a commit 6e1ecc3

File tree

13 files changed

+137
-17
lines changed

13 files changed

+137
-17
lines changed

examples/android/libKtAndroid/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ kt_compiler_plugin(
88
id = "org.jetbrains.kotlin.serialization",
99
stubs_phase = True,
1010
deps = [
11-
"@io_bazel_rules_kotlin//kotlin/compiler:kotlinx-serialization-compiler-plugin",
11+
"@com_github_jetbrains_kotlin//:kotlinx-serialization-compiler-plugin",
1212
],
1313
)
1414

examples/anvil/WORKSPACE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ http_archive(
4242

4343
http_archive(
4444
name = "rules_pkg",
45-
sha256 = "4ba8f4ab0ff85f2484287ab06c0d871dcb31cc54d439457d28fd4ae14b18450a",
46-
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.4/rules_pkg-0.2.4.tar.gz",
45+
sha256 = "8a298e832762eda1830597d64fe7db58178aa84cd5926d76d5b744d6558941c2",
46+
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz",
4747
)
4848

4949
http_archive(

examples/associates/WORKSPACE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ maven_install(
5555

5656
http_archive(
5757
name = "rules_pkg",
58-
sha256 = "4ba8f4ab0ff85f2484287ab06c0d871dcb31cc54d439457d28fd4ae14b18450a",
59-
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.4/rules_pkg-0.2.4.tar.gz",
58+
sha256 = "8a298e832762eda1830597d64fe7db58178aa84cd5926d76d5b744d6558941c2",
59+
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz",
6060
)

examples/plugin/src/allopen/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ kt_compiler_plugin(
1010
},
1111
stubs_phase = True,
1212
deps = [
13-
"@io_bazel_rules_kotlin//kotlin/compiler:allopen-compiler-plugin",
13+
"@com_github_jetbrains_kotlin//:allopen-compiler-plugin",
1414
],
1515
)
1616

examples/plugin/src/allopennoarg/BUILD

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ kt_compiler_plugin(
1010
},
1111
stubs_phase = True,
1212
deps = [
13-
"@io_bazel_rules_kotlin//kotlin/compiler:allopen-compiler-plugin",
13+
"@com_github_jetbrains_kotlin//:allopen-compiler-plugin",
1414
],
1515
)
1616

@@ -23,7 +23,7 @@ kt_compiler_plugin(
2323
},
2424
stubs_phase = True,
2525
deps = [
26-
"@io_bazel_rules_kotlin//kotlin/compiler:noarg-compiler-plugin",
26+
"@com_github_jetbrains_kotlin//:noarg-compiler-plugin",
2727
],
2828
)
2929

@@ -64,7 +64,7 @@ kt_jvm_test(
6464
test_class = "plugin.allopennoarg.UserHasNoargConstructorTest",
6565
deps = [
6666
":user",
67-
"@io_bazel_rules_kotlin//kotlin/compiler:kotlin-reflect",
67+
"@com_github_jetbrains_kotlin//:kotlin-reflect",
6868
"@maven//:junit_junit",
6969
],
7070
)

examples/plugin/src/noarg/BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ kt_compiler_plugin(
1010
},
1111
stubs_phase = True,
1212
deps = [
13-
"@io_bazel_rules_kotlin//kotlin/compiler:noarg-compiler-plugin",
13+
"@com_github_jetbrains_kotlin//:noarg-compiler-plugin",
1414
],
1515
)
1616

@@ -35,7 +35,7 @@ kt_jvm_test(
3535
test_class = "plugin.noarg.UserHasNoargConstructorTest",
3636
deps = [
3737
":user",
38-
"@io_bazel_rules_kotlin//kotlin/compiler:kotlin-reflect",
38+
"@com_github_jetbrains_kotlin//:kotlin-reflect",
3939
"@maven//:junit_junit",
4040
],
4141
)

examples/plugin/src/parcelize/BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ kt_compiler_plugin(
88
id = "org.jetbrains.kotlin.parcelize",
99
stubs_phase = True,
1010
deps = [
11-
"@io_bazel_rules_kotlin//kotlin/compiler:parcelize-compiler-plugin",
11+
"@com_github_jetbrains_kotlin//:parcelize-compiler-plugin",
1212
],
1313
)
1414

@@ -21,7 +21,7 @@ kt_jvm_library(
2121
],
2222
visibility = ["//visibility:public"],
2323
exports = [
24-
"@io_bazel_rules_kotlin//kotlin/compiler:parcelize-runtime",
24+
"@com_github_jetbrains_kotlin//:parcelize-runtime",
2525
],
2626
)
2727

examples/plugin/src/sam_with_receiver/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ kt_compiler_plugin(
1111
},
1212
stubs_phase = True,
1313
deps = [
14-
"@io_bazel_rules_kotlin//kotlin/compiler:sam-with-receiver-compiler-plugin",
14+
"@com_github_jetbrains_kotlin//:sam-with-receiver-compiler-plugin",
1515
],
1616
)
1717

examples/plugin/src/serialization/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ kt_compiler_plugin(
77
id = "org.jetbrains.kotlin.serialization",
88
stubs_phase = True,
99
deps = [
10-
"@io_bazel_rules_kotlin//kotlin/compiler:kotlinx-serialization-compiler-plugin",
10+
"@com_github_jetbrains_kotlin//:kotlinx-serialization-compiler-plugin",
1111
],
1212
)
1313

examples/trivial/WORKSPACE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ maven_install(
4949

5050
http_archive(
5151
name = "rules_pkg",
52-
sha256 = "4ba8f4ab0ff85f2484287ab06c0d871dcb31cc54d439457d28fd4ae14b18450a",
53-
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.4/rules_pkg-0.2.4.tar.gz",
52+
sha256 = "8a298e832762eda1830597d64fe7db58178aa84cd5926d76d5b744d6558941c2",
53+
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz",
5454
)

src/main/starlark/core/repositories/BUILD.com_github_jetbrains_kotlin.bazel

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
load("@rules_java//java:defs.bzl", "java_import")
1415

1516
package(default_visibility = ["//visibility:public"])
1617

@@ -19,3 +20,115 @@ filegroup(
1920
name = "home",
2021
srcs = glob(["**"]),
2122
)
23+
24+
_DEPRECATION_MESSAGE = "This target has been moved to @{{.KotlinRulesRepository}}//kotlin/compiler"
25+
26+
java_import(
27+
name = "annotations",
28+
deprecation = _DEPRECATION_MESSAGE,
29+
jars = ["lib/annotations-13.0.jar"],
30+
neverlink = 1,
31+
)
32+
33+
java_import(
34+
name = "jvm-abi-gen",
35+
deprecation = _DEPRECATION_MESSAGE,
36+
jars = ["lib/jvm-abi-gen.jar"],
37+
)
38+
39+
# Kotlin dependencies that are internal to this repo and are meant to be loaded manually into a classloader.
40+
[
41+
java_import(
42+
name = "kotlin-%s" % art,
43+
deprecation = _DEPRECATION_MESSAGE,
44+
jars = ["lib/kotlin-%s.jar" % art],
45+
neverlink = 1,
46+
)
47+
for art in [
48+
"annotation-processing",
49+
"annotation-processing-runtime",
50+
"compiler",
51+
]
52+
]
53+
54+
java_import(
55+
name = "kotlinx-serialization-compiler-plugin",
56+
deprecation = _DEPRECATION_MESSAGE,
57+
jars = ["lib/kotlinx-serialization-compiler-plugin.jar"],
58+
)
59+
60+
java_import(
61+
name = "allopen-compiler-plugin",
62+
deprecation = _DEPRECATION_MESSAGE,
63+
jars = ["lib/allopen-compiler-plugin.jar"],
64+
)
65+
66+
java_import(
67+
name = "noarg-compiler-plugin",
68+
deprecation = _DEPRECATION_MESSAGE,
69+
jars = ["lib/noarg-compiler-plugin.jar"],
70+
)
71+
72+
java_import(
73+
name = "sam-with-receiver-compiler-plugin",
74+
deprecation = _DEPRECATION_MESSAGE,
75+
jars = ["lib/sam-with-receiver-compiler-plugin.jar"],
76+
)
77+
78+
java_import(
79+
name = "parcelize-compiler-plugin",
80+
deprecation = _DEPRECATION_MESSAGE,
81+
jars = ["lib/parcelize-compiler.jar"],
82+
)
83+
84+
java_import(
85+
name = "parcelize-runtime",
86+
deprecation = _DEPRECATION_MESSAGE,
87+
jars = ["lib/parcelize-runtime.jar"],
88+
)
89+
90+
# Kotlin dependencies that are internal to this repo and may be linked.
91+
[
92+
java_import(
93+
name = "kotlin-%s" % art,
94+
deprecation = _DEPRECATION_MESSAGE,
95+
jars = ["lib/kotlin-%s.jar" % art],
96+
)
97+
for art in [
98+
"preloader",
99+
]
100+
]
101+
102+
# The Kotlin standard libraries. These should be setup in a Toolchain.
103+
[
104+
java_import(
105+
name = "kotlin-%s" % art,
106+
deprecation = _DEPRECATION_MESSAGE,
107+
jars = ["lib/kotlin-%s.jar" % art],
108+
srcjar = "lib/kotlin-%s-sources.jar" % art,
109+
visibility = ["//visibility:public"],
110+
)
111+
for art in [
112+
"stdlib",
113+
"stdlib-jdk7",
114+
"stdlib-jdk8",
115+
"reflect",
116+
"test",
117+
"script-runtime",
118+
]
119+
]
120+
121+
# The Kotlin JS standard libraries. These should be setup in a Toolchain.
122+
[
123+
java_import(
124+
name = "kotlin-%s" % art,
125+
deprecation = _DEPRECATION_MESSAGE,
126+
jars = ["lib/kotlin-%s.jar" % art],
127+
srcjar = "lib/kotlin-%s-sources.jar" % art,
128+
visibility = ["//visibility:public"],
129+
)
130+
for art in [
131+
"test-js",
132+
"stdlib-js",
133+
]
134+
]

src/main/starlark/core/repositories/compiler.bzl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,17 @@ def _kotlin_compiler_impl(repository_ctx):
1414
"BUILD.bazel",
1515
attr._template,
1616
executable = False,
17+
substitutions = {
18+
"{{.KotlinRulesRepository}}": attr.kotlin_rules_repository,
19+
},
1720
)
1821

1922
kotlin_compiler_repository = repository_rule(
2023
implementation = _kotlin_compiler_impl,
2124
attrs = {
25+
"kotlin_rules_repository": attr.string(
26+
doc = "The rules_kotlin repository name for deprecation warnings.",
27+
),
2228
"urls": attr.string_list(
2329
doc = "A list of urls for the kotlin compiler",
2430
mandatory = True,

src/main/starlark/core/repositories/initialize.release.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def kotlin_repositories(
4747

4848
kotlin_compiler_repository(
4949
name = compiler_repository_name,
50+
kotlin_rules_repository = RULES_KOTLIN.workspace_name,
5051
urls = [url.format(version = compiler_release.version) for url in compiler_release.url_templates],
5152
sha256 = compiler_release.sha256,
5253
)

0 commit comments

Comments
 (0)