Revert [JS IR] commits that failed build

Revert "[JS IR] Build hybrid versions of stdlib and kotlin.test"
This reverts commit b9f88350dd.

Revert "[JS IR] Add gradle plugin integration tests"
This reverts commit d872b27663.

Revert "Update bootstrap"
This reverts commit bc47594c7a.

Revert "[JS IR] Support generating both IR and pre-IR libraries"
This reverts commit 1b8df45bfe.
This commit is contained in:
Nikolay Krasko
2019-11-05 13:57:49 +03:00
parent 722f7ff056
commit 740f851a10
28 changed files with 338 additions and 423 deletions
@@ -36,7 +36,6 @@ import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys;
import org.jetbrains.kotlin.cli.common.CommonCompilerPerformanceManager;
import org.jetbrains.kotlin.cli.common.ExitCode;
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments;
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArgumentsKt;
import org.jetbrains.kotlin.cli.common.arguments.K2JsArgumentConstants;
import org.jetbrains.kotlin.cli.common.config.ContentRootsKt;
import org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport;
@@ -187,13 +186,8 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
) {
MessageCollector messageCollector = configuration.getNotNull(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY);
ExitCode exitCode = OK;
if (K2JSCompilerArgumentsKt.isIrBackendEnabled(arguments)) {
exitCode = getIrCompiler().doExecute(arguments, configuration.copy(), rootDisposable, paths);
}
if (K2JSCompilerArgumentsKt.isPreIrBackendDisabled(arguments)) {
return exitCode;
if (arguments.getIrBackend()) {
return getIrCompiler().doExecute(arguments, configuration, rootDisposable, paths);
}
if (arguments.getFreeArgs().isEmpty() && !IncrementalCompilation.isEnabledForJs()) {
@@ -394,10 +388,8 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
@NotNull CompilerConfiguration configuration, @NotNull K2JSCompilerArguments arguments,
@NotNull Services services
) {
if (K2JSCompilerArgumentsKt.isIrBackendEnabled(arguments)) {
if (arguments.getIrBackend()) {
getIrCompiler().setupPlatformSpecificArgumentsAndServices(configuration, arguments, services);
}
if (K2JSCompilerArgumentsKt.isPreIrBackendDisabled(arguments)) {
return;
}
@@ -175,12 +175,17 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
it.libraryFile.absolutePath in friendAbsolutePaths
}
if (arguments.irProduceKlibDir || arguments.irProduceKlibFile) {
val produceKind = produceMap[arguments.irProduceOnly]
if (produceKind == null) {
messageCollector.report(ERROR, "Unknown produce kind: ${arguments.irProduceOnly}. Valid values are: js, klib")
}
if (produceKind == ProduceKind.KLIB || (produceKind == ProduceKind.DEFAULT && arguments.metaInfo)) {
val outputKlibPath =
if (arguments.irProduceKlibDir)
if (arguments.irLegacyGradlePluginCompatibility)
File(outputFilePath).parent
else
outputFilePath
"$outputFilePath.klib"
generateKLib(
project = config.project,
@@ -189,11 +194,11 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
allDependencies = resolvedLibraries,
friendDependencies = friendDependencies,
outputKlibPath = outputKlibPath,
nopack = arguments.irProduceKlibDir
nopack = arguments.irLegacyGradlePluginCompatibility
)
}
if (arguments.irProduceJs) {
if (produceKind == ProduceKind.JS || produceKind == ProduceKind.DEFAULT) {
val phaseConfig = createPhaseConfig(jsPhases, arguments, messageCollector)
val compiledModule = compile(