Search in sources :

Example 1 with ModuleBuilder

use of org.robovm.compiler.ModuleBuilder in project robovm by robovm.

the class AnnotationImplPluginTest method createAnnoImpl.

private File createAnnoImpl(Class<? extends Annotation> annoClass) {
    AnnotationImplPlugin plugin = new AnnotationImplPlugin();
    Clazz clazz = toClazz(annoClass);
    clazz.resetClazzInfo();
    plugin.beforeClass(config, clazz, new ModuleBuilder());
    assertFalse(clazz.getClazzInfo().getAllDependencies().isEmpty());
    Dependency dep = clazz.getClazzInfo().getAllDependencies().iterator().next();
    assertEquals(clazz.getInternalName() + "$Impl", dep.getClassName());
    final File implFile = new File(config.getGeneratedClassDir(clazz.getPath()), clazz.getInternalName() + "$Impl.class");
    assertTrue(implFile.exists());
    return implFile;
}
Also used : ModuleBuilder(org.robovm.compiler.ModuleBuilder) Clazz(org.robovm.compiler.clazz.Clazz) Dependency(org.robovm.compiler.clazz.Dependency) File(java.io.File)

Example 2 with ModuleBuilder

use of org.robovm.compiler.ModuleBuilder in project robovm by robovm.

the class AnnotationImplPluginTest method testNotVisibleAnno.

@Test
public void testNotVisibleAnno() throws Exception {
    AnnotationImplPlugin plugin = new AnnotationImplPlugin();
    Clazz clazz = toClazz(Anno1.class);
    clazz.resetClazzInfo();
    plugin.beforeClass(config, clazz, new ModuleBuilder());
    assertFalse(clazz.getClazzInfo().getAllDependencies().isEmpty());
}
Also used : ModuleBuilder(org.robovm.compiler.ModuleBuilder) Clazz(org.robovm.compiler.clazz.Clazz) Test(org.junit.Test)

Aggregations

ModuleBuilder (org.robovm.compiler.ModuleBuilder)2 Clazz (org.robovm.compiler.clazz.Clazz)2 File (java.io.File)1 Test (org.junit.Test)1 Dependency (org.robovm.compiler.clazz.Dependency)1