Skip to content

Commit

Permalink
Be more precise about which Kotlin jars are not part of the Gradle API (
Browse files Browse the repository at this point in the history
  • Loading branch information
bamboo committed May 24, 2024
2 parents 0ee5e86 + 841fa38 commit c98cd71
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
Expand Down Expand Up @@ -126,10 +127,11 @@ private Set<File> gradleApiFileCollection(Collection<File> apiClasspath) {
}

private void removeKotlin(Collection<File> apiClasspath) {
for (File file : new ArrayList<>(apiClasspath)) {
String name = file.getName();
if (name.contains("kotlin")) {
apiClasspath.remove(file);
Iterator<File> iterator = apiClasspath.iterator();
while (iterator.hasNext()) {
String name = iterator.next().getName();
if (name.startsWith("kotlin-") || name.startsWith("gradle-kotlin-")) {
iterator.remove();
}
}
}
Expand Down

0 comments on commit c98cd71

Please sign in to comment.