Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
* Bug fix to handle export dependencies file path correctly.

### Version 0.53.3
* Add configuration cleanCacheDir to conditionally delete the cache directory or
just the existing dependency rules files
* Add configuration cleanCacheDir to conditionally delete the cache directory or just the existing dependency rules files

### Version 0.54.0
* Stop using /tmp for Android Lint gen-rule and use buck-out tmp instead
Expand Down Expand Up @@ -40,3 +39,4 @@
- Updated `actions/setup-java` to v4 with temurin distribution
- Removed rxPermissions and XLog dependencies
- Updated to Python 3.8
* Added support for Kotlin 2.2.0
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,10 @@
import org.gradle.api.tasks.compile.JavaCompile;
import org.gradle.api.tasks.testing.Test;
import org.gradle.jvm.tasks.Jar;
import org.jetbrains.kotlin.allopen.gradle.AllOpenGradleSubplugin;
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions;
import org.jetbrains.kotlin.gradle.dsl.KotlinSingleTargetExtension;
import org.jetbrains.kotlin.gradle.plugin.KotlinBasePluginWrapper;
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation;
import org.jetbrains.kotlin.gradle.plugin.SubpluginOption;
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinCommonCompilation;
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile;

Expand Down Expand Up @@ -470,30 +468,15 @@ public Map<String, List<String>> getKotlinFriendPaths(boolean isTest) {
}

protected List<String> getKotlinCompilerPlugins() {
List<SubpluginOption> subpluginOptions = getAllOpenSubpluginOptions();

if (subpluginOptions.size() > 0) {
return ImmutableList.of(KotlinManager.KOTLIN_AO_PLUGIN_TARGET);
} else {
return ImmutableList.of();
}
return ImmutableList.of();
}

protected List<String> getKotlinCompilerOptions() {
if (!isKotlin) {
return ImmutableList.of();
}

ImmutableList.Builder<String> optionBuilder = ImmutableList.builder();
optionBuilder.addAll(readKotlinCompilerArguments());

for (SubpluginOption option : getAllOpenSubpluginOptions()) {
optionBuilder.add("-P");
optionBuilder.add(
"plugin:org.jetbrains.kotlin.allopen:" + option.getKey() + "=" + option.getValue());
}

return optionBuilder.build();
return ImmutableList.copyOf(readKotlinCompilerArguments());
}

private List<String> readKotlinCompilerArguments() {
Expand Down Expand Up @@ -571,27 +554,6 @@ private List<String> readKotlinCompilerArguments() {
}
}

private ImmutableList<SubpluginOption> getAllOpenSubpluginOptions() {
if (!getProject().getPlugins().hasPlugin(KotlinManager.KOTLIN_ALLOPEN_MODULE)) {
return ImmutableList.of();
}

KotlinSingleTargetExtension extension =
getProject().getExtensions().findByType(KotlinSingleTargetExtension.class);
if (extension == null) {
return ImmutableList.of();
}

AllOpenGradleSubplugin subPlugin =
(AllOpenGradleSubplugin)
getProject().getPlugins().getPlugin(KotlinManager.KOTLIN_ALLOPEN_MODULE);
KotlinCompilation fakeCompilation =
new KotlinCommonCompilation(extension.getTarget(), "fakeCompilation");
return new ImmutableList.Builder<SubpluginOption>()
.addAll(subPlugin.applyToCompilation(fakeCompilation).get())
.build();
}

@SuppressWarnings("NoFunctionalReturnType")
private static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) {
Set<Object> seen = ConcurrentHashMap.newKeySet();
Expand Down
11 changes: 0 additions & 11 deletions libraries/kotlinlibrary/src/test/java/demo/AllOpenTest.kt

This file was deleted.