Suppress Kotlin 1.5.20 deprecation warning
See gh-27086
This commit is contained in:
@@ -35,12 +35,17 @@ class KotlinPluginAction implements PluginApplicationAction {
|
||||
public void execute(Project project) {
|
||||
ExtraPropertiesExtension extraProperties = project.getExtensions().getExtraProperties();
|
||||
if (!extraProperties.has("kotlin.version")) {
|
||||
String kotlinVersion = project.getPlugins().getPlugin(KotlinPluginWrapper.class).getKotlinPluginVersion();
|
||||
String kotlinVersion = getKotlinVersion(project);
|
||||
extraProperties.set("kotlin.version", kotlinVersion);
|
||||
}
|
||||
enableJavaParametersOption(project);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private String getKotlinVersion(Project project) {
|
||||
return project.getPlugins().getPlugin(KotlinPluginWrapper.class).getKotlinPluginVersion();
|
||||
}
|
||||
|
||||
private void enableJavaParametersOption(Project project) {
|
||||
project.getTasks().withType(KotlinCompile.class,
|
||||
(compile) -> compile.getKotlinOptions().setJavaParameters(true));
|
||||
|
||||
Reference in New Issue
Block a user