Use reflection in Ant task to invoke compiler

This will allow a more controlled management of the runtime that the compiler
is linked against. Incidentally this also allows Ant task to use any of
compiler arguments via <compilerarg> because Ant task is now just a facade for
the CLI compiler.

The test "wrongArguments" is deleted because the full compiler usage is now
printed out on a wrong <compilerarg>, and this will become inconvenient to
update with each change in compiler arguments

 #KT-5618 Fixed
This commit is contained in:
Alexander Udalov
2014-12-11 22:32:14 +03:00
parent 3bde619ca3
commit 14dab749a2
10 changed files with 102 additions and 89 deletions
@@ -58,6 +58,12 @@ public abstract class CLICompiler<A extends CommonCompilerArguments> {
return exec(errStream, services, MessageRenderer.TAGS, args);
}
@SuppressWarnings("UnusedDeclaration") // Used via reflection in KotlinCompilerBaseTask
@NotNull
public ExitCode execFullPathsInMessages(@NotNull PrintStream errStream, @NotNull String[] args) {
return exec(errStream, Services.EMPTY, MessageRenderer.PLAIN, args);
}
@Nullable
private A parseArguments(@NotNull PrintStream errStream, @NotNull MessageRenderer messageRenderer, @NotNull String[] args) {
try {