use of javax.tools.JavaCompiler in project ceylon-compiler by ceylon.
the class Xprint method main.
public static void main(String[] args) {
JavaCompiler javac = ToolProvider.getSystemJavaCompiler();
javac.run(System.in, null, null, "-Xprint", "com.sun.tools.javac.code.Types", "com.sun.tools.javac.parser.Parser", "java.util.EnumSet");
}
use of javax.tools.JavaCompiler in project ceylon-compiler by ceylon.
the class T6199075 method compileAndCheck.
void compileAndCheck(VarargsMethod m1, VarargsMethod m2, TypeKind actual, ArgumentsArity argsArity) throws Exception {
final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
JavaSource source = new JavaSource(m1, m2, actual, argsArity);
ErrorChecker ec = new ErrorChecker();
JavacTask ct = (JavacTask) tool.getTask(null, fm, ec, null, null, Arrays.asList(source));
ct.generate();
check(source, ec, m1, m2, actual, argsArity);
}
use of javax.tools.JavaCompiler in project ceylon-compiler by ceylon.
the class T7042566 method compileAndCheck.
void compileAndCheck() throws Exception {
final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
JavaSource source = new JavaSource();
ErrorChecker ec = new ErrorChecker();
JavacTask ct = (JavacTask) tool.getTask(null, fm, ec, null, null, Arrays.asList(source));
ct.call();
check(source, ec);
}
use of javax.tools.JavaCompiler in project ceylon-compiler by ceylon.
the class TestSuperclass method main.
public static void main(String... args) throws Exception {
JavaCompiler comp = ToolProvider.getSystemJavaCompiler();
StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null);
int errors = 0;
for (ClassKind ck : ClassKind.values()) {
for (GenericKind gk : GenericKind.values()) {
for (SuperKind sk : SuperKind.values()) {
errors += new TestSuperclass(ck, gk, sk).run(comp, fm);
}
}
}
if (errors > 0)
throw new Exception(errors + " errors found");
}
use of javax.tools.JavaCompiler in project ceylon-compiler by ceylon.
the class Warn5 method test.
static void test(SourceLevel sourceLevel, XlintOption xlint, TrustMe trustMe, SuppressLevel suppressLevel, ModifierKind modKind, MethodKind methKind, SignatureKind sig, BodyKind body) throws Exception {
final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
JavaSource source = new JavaSource(trustMe, suppressLevel, modKind, methKind, sig, body);
DiagnosticChecker dc = new DiagnosticChecker();
JavacTask ct = (JavacTask) tool.getTask(null, fm, dc, Arrays.asList(xlint.getXlintOption(), "-source", sourceLevel.sourceKey), null, Arrays.asList(source));
ct.analyze();
check(sourceLevel, dc, source, xlint, trustMe, suppressLevel, modKind, methKind, sig, body);
}
Aggregations