Oracle has depreciated nashorn and I use it in my apache ant build scripts.
Here is a short example;
try{load("nashorn:mozilla_compat.js");}catch(e){;}
importClass(java.io.File);
var sourceName = project.getProperty("build.source.dir") + "/" +project.getProperty("teiFile") + ".xml";
var targetName = project.getProperty("build.search.dir") + "/" + project.getProperty("teiFile") + ".xml";
var sourceFile = new File("", sourceName);
var targetFile = new File("", targetName);
var uptodate = targetFile.exists() && sourceFile.lastModified() < targetFile.lastModified();
var sourcePrefix = project.getProperty("teiFile");
if(!uptodate & !sourcePrefix.startsWith("G")) {
......
}
}
I've heard mentions of Rhino or graalVM as a replacement, but each seems to have a fairly long list of deficiencies.Suggestions for a library that is currently active and stable.
thanks, scott
......line represents, I suspect the parts you’ve shown can be done with regular Ant tasks.