Skip to content

Commit

Permalink
Add BuildTask.configDirectory option to support AOT compilation with …
Browse files Browse the repository at this point in the history
…GraalVM
  • Loading branch information
saudet committed Jun 9, 2020
1 parent 7ac296d commit 1eafec8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/org/bytedeco/gradle/javacpp/BuildTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ public class BuildTask extends DefaultTask {
/** Copy to output directory resources listed in properties. */
boolean copyResources = false;

/** Also create config files for GraalVM native-image in directory. */
File configDirectory = null;

/** Also create a JAR file named {@code <jarPrefix>-<platform>.jar}. */
String jarPrefix = null;

Expand Down Expand Up @@ -172,6 +175,8 @@ public BuildTask() {
@Input boolean getHeader() { return header; } void setHeader (boolean b) { header = b; }
@Input boolean getCopyLibs() { return copyLibs; } void setCopyLibs (boolean b) { copyLibs = b; }
@Input boolean getCopyResources() { return copyResources; } void setCopyResources (boolean b) { copyResources = b; }
@Optional
@OutputDirectory File getConfigDirectory() { return configDirectory; } void setConfigDirectory(File f) { configDirectory = f; }
@Optional @Input String getJarPrefix() { return jarPrefix; } void setJarPrefix (String s) { jarPrefix = s; }
@Optional @Input String getProperties() { return properties; } void setProperties (String s) { properties = s; }
@Optional @InputFile File getPropertyFile() { return propertyFile; } void setPropertyFile (File f) { propertyFile = f; }
Expand Down Expand Up @@ -199,6 +204,7 @@ public BuildTask() {
.header(getHeader())
.copyLibs(getCopyLibs())
.copyResources(getCopyResources())
.configDirectory(getConfigDirectory())
.jarPrefix(getJarPrefix())
.properties(getProperties())
.propertyFile(getPropertyFile())
Expand All @@ -223,7 +229,7 @@ public BuildTask() {

String extension = builder.getProperty("platform.extension");
getLogger().info("Detected platform \"" + Loader.Detector.getPlatform() + "\"");
getLogger().info("Building for platform \"" + builder.getProperty("platform") + "\""
getLogger().info("Building platform \"" + builder.getProperty("platform") + "\""
+ (extension != null && extension.length() > 0 ? " with extension \"" + extension + "\"" : ""));

ExtraPropertiesExtension projectProperties = getProject().getExtensions().getExtraProperties();
Expand Down

0 comments on commit 1eafec8

Please sign in to comment.