diff --git a/examples/java/bld/src/bld/java/com/example/ExampleBuild.java b/examples/java/bld/src/bld/java/com/example/ExampleBuild.java index d00568c..7bf9e50 100644 --- a/examples/java/bld/src/bld/java/com/example/ExampleBuild.java +++ b/examples/java/bld/src/bld/java/com/example/ExampleBuild.java @@ -3,11 +3,20 @@ package com.example; import rife.bld.BuildCommand; import rife.bld.Project; +import java.io.File; import java.util.List; import static rife.bld.dependencies.Repository.*; import static rife.bld.dependencies.Scope.compile; +/** + * Example build. + * + *
+ * To incorporate the generated source code into the source tree, add this directory as an additional source + * location in your IDE. + */ + @Override + public void compile() throws Exception { + var generated = new File(buildDirectory(), "generated"); + var ignore = generated.mkdir(); + this.compileOperation().compileOptions().addAll(List.of("-s", generated.getAbsolutePath())); + super.compile(); + } + + @BuildCommand(summary = "Run the example") + public void runExample() throws Exception { + runOperation().fromProject(this).mainClass("com.example.Example").execute(); + } }