@@ -57,6 +57,10 @@ _compiler_plugin_registrar_service_source = "src/main/resources/META-INF/service
5757
5858_compiler_plugin_registrar_service_target = "META-INF/services/org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar"
5959
60+ _component_registrar_service_source = "src/main/resources/META-INF/services/org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar"
61+
62+ _component_registrar_service_target = "META-INF/services/org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar"
63+
6064py_binary (
6165 name = "generate_dbscheme" ,
6266 srcs = ["generate_dbscheme.py" ],
@@ -68,14 +72,22 @@ _resources = [
6872 r [len ("src/main/resources/" ):],
6973 )
7074 for r in glob (["src/main/resources/**" ])
71- if r != _compiler_plugin_registrar_service_source
75+ if r not in (
76+ _compiler_plugin_registrar_service_source ,
77+ _component_registrar_service_source ,
78+ )
7279]
7380
7481_compiler_plugin_registrar_service = (
7582 _compiler_plugin_registrar_service_source ,
7683 _compiler_plugin_registrar_service_target ,
7784)
7885
86+ _component_registrar_service = (
87+ _component_registrar_service_source ,
88+ _component_registrar_service_target ,
89+ )
90+
7991kt_javac_options (
8092 name = "javac-options" ,
8193 release = "8" ,
@@ -93,7 +105,11 @@ kt_javac_options(
93105 "kotlin.RequiresOptIn" ,
94106 "org.jetbrains.kotlin.ir.symbols.%s" %
95107 ("IrSymbolInternals" if version_less (v , "2.0.0" ) else "UnsafeDuringIrConstructionAPI" ),
96- ] + ([] if version_less (v , "2.2.20" ) else ["org.jetbrains.kotlin.DeprecatedForRemovalCompilerApi" ]),
108+ ] + (
109+ [] if version_less (v , "2.2.20" ) else ["org.jetbrains.kotlin.DeprecatedForRemovalCompilerApi" ]
110+ ) + (
111+ [] if version_less (v , "2.4.20" ) else ["org.jetbrains.kotlin.K1Deprecation" ]
112+ ),
97113 x_suppress_version_warnings = True ,
98114 ),
99115 # * extractor.name is different for each version, so we need to put it in different output dirs
@@ -103,6 +119,8 @@ kt_javac_options(
103119 name = "resources-%s" % v ,
104120 srcs = [src for src , _ in _resources ] + (
105121 [_compiler_plugin_registrar_service [0 ]] if not version_less (v , "2.4.0" ) else []
122+ ) + (
123+ [_component_registrar_service [0 ]] if version_less (v , "2.4.20" ) else []
106124 ),
107125 outs = [
108126 "%s/com/github/codeql/extractor.name" % v ,
@@ -114,6 +132,11 @@ kt_javac_options(
114132 v ,
115133 _compiler_plugin_registrar_service [1 ],
116134 )] if not version_less (v , "2.4.0" ) else []
135+ ) + (
136+ ["%s/%s" % (
137+ v ,
138+ _component_registrar_service [1 ],
139+ )] if version_less (v , "2.4.20" ) else []
117140 ),
118141 cmd = "\n " .join ([
119142 "echo %s-%s > $(RULEDIR)/%s/com/github/codeql/extractor.name" % (_extractor_name_prefix , v , v ),
@@ -126,6 +149,12 @@ kt_javac_options(
126149 v ,
127150 _compiler_plugin_registrar_service [1 ],
128151 )] if not version_less (v , "2.4.0" ) else []
152+ ) + (
153+ ["cp $(execpath %s) $(RULEDIR)/%s/%s" % (
154+ _component_registrar_service [0 ],
155+ v ,
156+ _component_registrar_service [1 ],
157+ )] if version_less (v , "2.4.20" ) else []
129158 )),
130159 ),
131160 kt_jvm_library (
0 commit comments