-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathBUILD
149 lines (136 loc) · 4.4 KB
/
BUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
load(
"@rules_intellij//build_defs:build_defs.bzl",
"intellij_plugin",
"intellij_plugin_library",
"plugin_deploy_zip",
"repackaged_files",
"stamped_plugin_xml",
)
load(
"@rules_intellij//build_defs:intellij_plugin_debug_target.bzl",
"intellij_plugin_debug_target",
)
load("@rules_kotlin//kotlin:core.bzl", "define_kt_toolchain")
load("//:versions.bzl", "INTELLIJ_BAZEL_VERSION", "PLATFORM_VERSION", "SINCE_VERSION")
define_kt_toolchain(
name = "kotlin_toolchain",
api_version = "1.9", # "1.1", "1.2", "1.3", "1.4", "1.5" "1.6", "1.7", "1.8", or "1.9"
jvm_target = "17", # "1.6", "1.8", "9", "10", "11", "12", "13", "15", "16", "17", "18", "19", "20" or "21"
language_version = "1.9", # "1.1", "1.2", "1.3", "1.4", "1.5" "1.6", "1.7", "1.8", or "1.9"
)
intellij_plugin_library(
name = "plugin_library",
optional_plugin_deps = [],
plugin_deps = ["com.intellij.modules.platform"],
plugin_xmls = [
"//plugin-bazel/src:main/resources/META-INF/base.xml",
# bazel plugin depends on bsp plugin, which already adds performance plugin as optional plugin dep
"//plugin-bazel/src:test/resources/META-INF/bazel-ide-starter-test.xml",
],
visibility = ["//visibility:public"],
deps = [
"//plugin-bazel/src:intellij-bazel",
],
)
stamped_plugin_xml(
name = "stamped_plugin_xml",
changelog_file = "CHANGELOG.md",
description_file = "description.html",
plugin_id = "org.jetbrains.bazel",
plugin_name = "Bazel (EAP)",
since_build_numbers = {PLATFORM_VERSION: SINCE_VERSION},
stamp_since_build = True,
version = INTELLIJ_BAZEL_VERSION,
)
java_binary(
name = "intellij-bazel_exclude",
main_class = "DummySourceForExclude",
runtime_deps = [
"//protocol",
"@maven//:ch_epfl_scala_bsp4j",
"@maven//:org_jetbrains_kotlinx_kotlinx_coroutines_core",
"@maven//:org_jetbrains_kotlinx_kotlinx_coroutines_core_jvm",
],
)
intellij_plugin(
name = "intellij-bazel",
deploy_env = [
"intellij-bazel_exclude",
],
plugin_deps = ["org.jetbrains.bsp"],
plugin_xml = ":stamped_plugin_xml",
visibility = ["//visibility:public"],
deps = [
":plugin_library",
],
)
java_binary(
name = "intellij-bazel_exclude_debug",
main_class = "DummySourceForExclude",
runtime_deps = [
"@maven//:io_opentelemetry_opentelemetry_api",
"@maven//:io_opentelemetry_opentelemetry_exporter_otlp",
"@maven//:io_opentelemetry_opentelemetry_extension_kotlin",
"@maven//:io_opentelemetry_opentelemetry_sdk",
"@maven//:io_opentelemetry_opentelemetry_sdk_trace",
"@maven//:io_opentelemetry_semconv_opentelemetry_semconv",
"@maven//:org_jetbrains_kotlinx_kotlinx_coroutines_core",
"@maven//:org_jetbrains_kotlinx_kotlinx_coroutines_core_jvm",
],
)
repackaged_files(
name = "intellij-bazel_jar",
srcs = [":intellij-bazel"],
prefix = "intellij-bazel/lib",
)
plugin_deploy_zip(
name = "intellij-bazel_zip",
srcs = [
":intellij-bazel_jar",
],
visibility = ["//visibility:public"],
zip_filename = "intellij-bazel.zip",
)
intellij_plugin_debug_target(
name = "plugin-bazel-debug",
deps = [
":intellij-bazel_jar",
"//plugin-bsp:intellij-bsp_jar",
],
)
intellij_plugin_debug_target(
name = "plugin-bazel-with-server-debug",
deps = [
":intellij-bazel-with-inmemory-server_jar",
"//plugin-bsp:intellij-bsp_jar",
],
)
java_binary(
name = "intellij-bazel-debug_exclude",
main_class = "DummySourceForExclude",
runtime_deps = [
"//protocol",
"@maven//:ch_epfl_scala_bsp4j",
"@maven//:org_apache_velocity_velocity_engine_core",
"@maven//:org_jetbrains_kotlinx_kotlinx_coroutines_core",
"@maven//:org_jetbrains_kotlinx_kotlinx_coroutines_core_jvm",
],
)
intellij_plugin(
name = "intellij-bazel-with-inmemory-server",
deploy_env = [
"intellij-bazel-debug_exclude",
],
plugin_deps = ["org.jetbrains.bsp"],
plugin_xml = ":stamped_plugin_xml",
visibility = ["//visibility:public"],
deps = [
":plugin_library",
"//plugin-bazel/plugin-inmem-server:plugin_library",
],
)
repackaged_files(
name = "intellij-bazel-with-inmemory-server_jar",
srcs = [":intellij-bazel-with-inmemory-server"],
prefix = "intellij-bazel-with-inmemory-server/lib",
)