libraries: jdkHeaders -> altHeaders
This commit is contained in:
+13
-14
@@ -23,10 +23,9 @@ import org.apache.maven.plugin.AbstractMojo;
|
|||||||
import org.apache.maven.plugin.MojoExecutionException;
|
import org.apache.maven.plugin.MojoExecutionException;
|
||||||
import org.apache.maven.plugin.MojoFailureException;
|
import org.apache.maven.plugin.MojoFailureException;
|
||||||
import org.apache.maven.plugin.logging.Log;
|
import org.apache.maven.plugin.logging.Log;
|
||||||
import org.jetbrains.jet.cli.jvm.K2JVMCompilerArguments;
|
|
||||||
import org.jetbrains.jet.cli.jvm.K2JVMCompiler;
|
|
||||||
import org.jetbrains.jet.cli.common.ExitCode.*;
|
|
||||||
import org.jetbrains.jet.cli.common.ExitCode;
|
import org.jetbrains.jet.cli.common.ExitCode;
|
||||||
|
import org.jetbrains.jet.cli.jvm.K2JVMCompiler;
|
||||||
|
import org.jetbrains.jet.cli.jvm.K2JVMCompilerArguments;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -204,8 +203,8 @@ public abstract class KotlinCompileMojoBase extends AbstractMojo {
|
|||||||
log.info("Classes directory is " + output);
|
log.info("Classes directory is " + output);
|
||||||
arguments.setOutputDir(output);
|
arguments.setOutputDir(output);
|
||||||
|
|
||||||
arguments.jdkHeaders = getJdkHeaders().getPath();
|
arguments.altHeaders = getAltHeaders().getPath();
|
||||||
log.debug("Using jdk headers from " + arguments.jdkHeaders);
|
log.debug("Using jdk headers from " + arguments.altHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Make a better runtime detection or get rid of it entirely
|
// TODO: Make a better runtime detection or get rid of it entirely
|
||||||
@@ -223,25 +222,25 @@ public abstract class KotlinCompileMojoBase extends AbstractMojo {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private File jdkHeadersPath;
|
private File altHeadersPath;
|
||||||
|
|
||||||
protected File getJdkHeaders() {
|
protected File getAltHeaders() {
|
||||||
if (jdkHeadersPath != null)
|
if (altHeadersPath != null)
|
||||||
return jdkHeadersPath;
|
return altHeadersPath;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
jdkHeadersPath = extractJdkHeaders();
|
altHeadersPath = extractAltHeaders();
|
||||||
|
|
||||||
if (jdkHeadersPath == null)
|
if (altHeadersPath == null)
|
||||||
throw new RuntimeException("Can't find kotlin jdk headers in maven plugin resources");
|
throw new RuntimeException("Can't find kotlin alt headers in maven plugin resources");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return jdkHeadersPath;
|
return altHeadersPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
private File extractJdkHeaders() throws IOException {
|
private File extractAltHeaders() throws IOException {
|
||||||
final String kotlin_jdk_headers = "kotlin-jdk-headers.jar";
|
final String kotlin_jdk_headers = "kotlin-jdk-headers.jar";
|
||||||
|
|
||||||
final URL jdkHeadersResource = Resources.getResource(kotlin_jdk_headers);
|
final URL jdkHeadersResource = Resources.getResource(kotlin_jdk_headers);
|
||||||
|
|||||||
Reference in New Issue
Block a user