command line flag to repeat compilation multiple times
This commit is contained in:
+5
@@ -43,6 +43,11 @@ public abstract class CommonCompilerArguments {
|
|||||||
@Argument(value = "Xno-inline", description = "Disable method inlining")
|
@Argument(value = "Xno-inline", description = "Disable method inlining")
|
||||||
public boolean noInline;
|
public boolean noInline;
|
||||||
|
|
||||||
|
// TODO Remove in 1.0
|
||||||
|
@Argument(value = "Xrepeat", description = "Repeat compilation (for performance analysis)")
|
||||||
|
@ValueDescription("<count>")
|
||||||
|
public String repeat;
|
||||||
|
|
||||||
@Argument(value = "Xplugin", description = "Load plugins from the given classpath")
|
@Argument(value = "Xplugin", description = "Load plugins from the given classpath")
|
||||||
@ValueDescription("<path>")
|
@ValueDescription("<path>")
|
||||||
public String[] pluginClasspaths;
|
public String[] pluginClasspaths;
|
||||||
|
|||||||
@@ -144,15 +144,29 @@ public abstract class CLICompiler<A extends CommonCompilerArguments> {
|
|||||||
|
|
||||||
GroupingMessageCollector groupingCollector = new GroupingMessageCollector(messageCollector);
|
GroupingMessageCollector groupingCollector = new GroupingMessageCollector(messageCollector);
|
||||||
try {
|
try {
|
||||||
Disposable rootDisposable = Disposer.newDisposable();
|
ExitCode exitCode = OK;
|
||||||
try {
|
|
||||||
MessageSeverityCollector severityCollector = new MessageSeverityCollector(groupingCollector);
|
int repeatCount = 1;
|
||||||
ExitCode code = doExecute(arguments, services, severityCollector, rootDisposable);
|
if (arguments.repeat != null) {
|
||||||
return severityCollector.anyReported(CompilerMessageSeverity.ERROR) ? COMPILATION_ERROR : code;
|
try {
|
||||||
|
repeatCount = Integer.parseInt(arguments.repeat);
|
||||||
|
}
|
||||||
|
catch (NumberFormatException ignored) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
finally {
|
|
||||||
Disposer.dispose(rootDisposable);
|
for (int i = 0; i < repeatCount; i++) {
|
||||||
|
Disposable rootDisposable = Disposer.newDisposable();
|
||||||
|
try {
|
||||||
|
MessageSeverityCollector severityCollector = new MessageSeverityCollector(groupingCollector);
|
||||||
|
ExitCode code = doExecute(arguments, services, severityCollector, rootDisposable);
|
||||||
|
exitCode = severityCollector.anyReported(CompilerMessageSeverity.ERROR) ? COMPILATION_ERROR : code;
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
Disposer.dispose(rootDisposable);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return exitCode;
|
||||||
}
|
}
|
||||||
catch (Throwable t) {
|
catch (Throwable t) {
|
||||||
groupingCollector.report(CompilerMessageSeverity.EXCEPTION, OutputMessageUtil.renderException(t),
|
groupingCollector.report(CompilerMessageSeverity.EXCEPTION, OutputMessageUtil.renderException(t),
|
||||||
|
|||||||
+1
@@ -1,6 +1,7 @@
|
|||||||
Usage: kotlinc-js <options> <source files>
|
Usage: kotlinc-js <options> <source files>
|
||||||
where advanced options include:
|
where advanced options include:
|
||||||
-Xno-inline Disable method inlining
|
-Xno-inline Disable method inlining
|
||||||
|
-Xrepeat <count> Repeat compilation (for performance analysis)
|
||||||
-Xplugin <path> Load plugins from the given classpath
|
-Xplugin <path> Load plugins from the given classpath
|
||||||
|
|
||||||
Advanced options are non-standard and may be changed or removed without any notice.
|
Advanced options are non-standard and may be changed or removed without any notice.
|
||||||
|
|||||||
+1
@@ -5,6 +5,7 @@ where advanced options include:
|
|||||||
-Xno-optimize Disable optimizations
|
-Xno-optimize Disable optimizations
|
||||||
-Xreport-perf Report detailed performance statistics
|
-Xreport-perf Report detailed performance statistics
|
||||||
-Xno-inline Disable method inlining
|
-Xno-inline Disable method inlining
|
||||||
|
-Xrepeat <count> Repeat compilation (for performance analysis)
|
||||||
-Xplugin <path> Load plugins from the given classpath
|
-Xplugin <path> Load plugins from the given classpath
|
||||||
|
|
||||||
Advanced options are non-standard and may be changed or removed without any notice.
|
Advanced options are non-standard and may be changed or removed without any notice.
|
||||||
|
|||||||
Reference in New Issue
Block a user