|
56 | 56 | import org.gradle.api.tasks.compile.JavaCompile; |
57 | 57 | import org.gradle.api.tasks.testing.Test; |
58 | 58 | import org.gradle.jvm.tasks.Jar; |
59 | | -import org.jetbrains.kotlin.allopen.gradle.AllOpenGradleSubplugin; |
60 | 59 | import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions; |
61 | 60 | import org.jetbrains.kotlin.gradle.dsl.KotlinSingleTargetExtension; |
62 | 61 | import org.jetbrains.kotlin.gradle.plugin.KotlinBasePluginWrapper; |
63 | 62 | import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation; |
64 | | -import org.jetbrains.kotlin.gradle.plugin.SubpluginOption; |
65 | 63 | import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinCommonCompilation; |
66 | 64 | import org.jetbrains.kotlin.gradle.tasks.KotlinCompile; |
67 | 65 |
|
@@ -470,30 +468,15 @@ public Map<String, List<String>> getKotlinFriendPaths(boolean isTest) { |
470 | 468 | } |
471 | 469 |
|
472 | 470 | protected List<String> getKotlinCompilerPlugins() { |
473 | | - List<SubpluginOption> subpluginOptions = getAllOpenSubpluginOptions(); |
474 | | - |
475 | | - if (subpluginOptions.size() > 0) { |
476 | | - return ImmutableList.of(KotlinManager.KOTLIN_AO_PLUGIN_TARGET); |
477 | | - } else { |
478 | | - return ImmutableList.of(); |
479 | | - } |
| 471 | + return ImmutableList.of(); |
480 | 472 | } |
481 | 473 |
|
482 | 474 | protected List<String> getKotlinCompilerOptions() { |
483 | 475 | if (!isKotlin) { |
484 | 476 | return ImmutableList.of(); |
485 | 477 | } |
486 | 478 |
|
487 | | - ImmutableList.Builder<String> optionBuilder = ImmutableList.builder(); |
488 | | - optionBuilder.addAll(readKotlinCompilerArguments()); |
489 | | - |
490 | | - for (SubpluginOption option : getAllOpenSubpluginOptions()) { |
491 | | - optionBuilder.add("-P"); |
492 | | - optionBuilder.add( |
493 | | - "plugin:org.jetbrains.kotlin.allopen:" + option.getKey() + "=" + option.getValue()); |
494 | | - } |
495 | | - |
496 | | - return optionBuilder.build(); |
| 479 | + return ImmutableList.copyOf(readKotlinCompilerArguments()); |
497 | 480 | } |
498 | 481 |
|
499 | 482 | private List<String> readKotlinCompilerArguments() { |
@@ -571,27 +554,6 @@ private List<String> readKotlinCompilerArguments() { |
571 | 554 | } |
572 | 555 | } |
573 | 556 |
|
574 | | - private ImmutableList<SubpluginOption> getAllOpenSubpluginOptions() { |
575 | | - if (!getProject().getPlugins().hasPlugin(KotlinManager.KOTLIN_ALLOPEN_MODULE)) { |
576 | | - return ImmutableList.of(); |
577 | | - } |
578 | | - |
579 | | - KotlinSingleTargetExtension extension = |
580 | | - getProject().getExtensions().findByType(KotlinSingleTargetExtension.class); |
581 | | - if (extension == null) { |
582 | | - return ImmutableList.of(); |
583 | | - } |
584 | | - |
585 | | - AllOpenGradleSubplugin subPlugin = |
586 | | - (AllOpenGradleSubplugin) |
587 | | - getProject().getPlugins().getPlugin(KotlinManager.KOTLIN_ALLOPEN_MODULE); |
588 | | - KotlinCompilation fakeCompilation = |
589 | | - new KotlinCommonCompilation(extension.getTarget(), "fakeCompilation"); |
590 | | - return new ImmutableList.Builder<SubpluginOption>() |
591 | | - .addAll(subPlugin.applyToCompilation(fakeCompilation).get()) |
592 | | - .build(); |
593 | | - } |
594 | | - |
595 | 557 | @SuppressWarnings("NoFunctionalReturnType") |
596 | 558 | private static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) { |
597 | 559 | Set<Object> seen = ConcurrentHashMap.newKeySet(); |
|
0 commit comments