@@ -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,9 @@ 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+ ),
97111 x_suppress_version_warnings = True ,
98112 ),
99113 # * extractor.name is different for each version, so we need to put it in different output dirs
@@ -103,6 +117,8 @@ kt_javac_options(
103117 name = "resources-%s" % v ,
104118 srcs = [src for src , _ in _resources ] + (
105119 [_compiler_plugin_registrar_service [0 ]] if not version_less (v , "2.4.0" ) else []
120+ ) + (
121+ [_component_registrar_service [0 ]] if version_less (v , "2.4.20" ) else []
106122 ),
107123 outs = [
108124 "%s/com/github/codeql/extractor.name" % v ,
@@ -114,6 +130,11 @@ kt_javac_options(
114130 v ,
115131 _compiler_plugin_registrar_service [1 ],
116132 )] if not version_less (v , "2.4.0" ) else []
133+ ) + (
134+ ["%s/%s" % (
135+ v ,
136+ _component_registrar_service [1 ],
137+ )] if version_less (v , "2.4.20" ) else []
117138 ),
118139 cmd = "\n " .join ([
119140 "echo %s-%s > $(RULEDIR)/%s/com/github/codeql/extractor.name" % (_extractor_name_prefix , v , v ),
@@ -126,6 +147,12 @@ kt_javac_options(
126147 v ,
127148 _compiler_plugin_registrar_service [1 ],
128149 )] if not version_less (v , "2.4.0" ) else []
150+ ) + (
151+ ["cp $(execpath %s) $(RULEDIR)/%s/%s" % (
152+ _component_registrar_service [0 ],
153+ v ,
154+ _component_registrar_service [1 ],
155+ )] if version_less (v , "2.4.20" ) else []
129156 )),
130157 ),
131158 kt_jvm_library (
0 commit comments