Add support for --source and --target in JavacOptions

This commit is contained in:
Erik C. Thauvin 2025-12-27 12:06:12 -08:00
parent c71a98c6ee
commit fea026a9c6
No known key found for this signature in database
GPG key ID: 776702A6A2DA330E

View file

@ -253,6 +253,30 @@ public class JavacOptions extends ArrayList<String> {
return this;
}
/**
* Provide source compatibility with the specified Java SE release.
*
* @return this list of options
* @since 2.3.1
*/
public JavacOptions source(int version) {
add("--source");
add(Convert.toString(version));
return this;
}
/**
* Generate class files suitable for the specified Java SE release.
*
* @return this list of options
* @since 2.3.1
*/
public JavacOptions target(int version) {
add("--target");
add(Convert.toString(version));
return this;
}
/**
* Generate debugging info
*