BuildObjectsJava编译工具
BuildObjects 提供了一些 Java 类,你可以通过这些类来编译Java代码,它对你的代码的结构没有任何要求。
示例代码:
import org.buildobjects.BuildBase;
import org.buildobjects.artifacts.Classes;
import org.buildobjects.artifacts.FileLocation;
import org.buildobjects.artifacts.Location;
import org.buildobjects.projectmodel.JavaModule;
public class Build extends BuildBase {
private JavaModule module;
public Build() {
Location location = new FileLocation(".");
Classes libraries = location.jarDir("lib");
module = new JavaModule(tasks, location, libraries);
}
public void build() {
build.publish(module.publishable());
}
public static void main(String[] args) {
new Build().build();
}
}
评论