Skip to content

Commit 22b80d6

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

File tree

13 files changed

+138
-18
lines changed

13 files changed

+138
-18
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: 114 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,124 @@
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-
14+
load("@rules_java//java:defs.bzl", "java_import")
1515
package(default_visibility = ["//visibility:public"])
1616

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