Kotlinc: Exclude module-info.class from resulting jar when "-include-runtime" is specified

This commit is contained in:
scaventz
2020-12-24 21:44:32 +08:00
committed by Alexander Udalov
parent 742fef9042
commit 4374438ff1
2 changed files with 33 additions and 12 deletions
@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.cli.jvm.compiler;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.io.FileUtilRt;
import kotlin.io.FilesKt;
import kotlin.text.StringsKt;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.backend.common.output.OutputFile;
@@ -131,6 +132,9 @@ public class CompileEnvironmentUtil {
if (e == null) {
break;
}
if (StringsKt.substringAfterLast(e.getName(), "/", e.getName()).equals("module-info.class")) {
continue;
}
if (resetJarTimestamps) {
e.setTime(DOS_EPOCH);
}