@Test public void testMergeConfigsFromClasspath() throws Exception { File tmpDir = createTempDir(); File cacheDir = new File(tmpDir, "cache"); File p1 = createMergeConfig(tmpDir, "p1", "Foo", OS.macosx, Arch.x86, false); File p2 = createMergeConfig(tmpDir, "p2", "Wooz", OS.linux, Arch.x86, false); createMergeConfig(tmpDir, "p3", "Baaz", OS.macosx, Arch.x86, false); File p3 = createMergeConfig(tmpDir, "p3", "Raaz", OS.macosx, Arch.x86_64, true); Config.Builder builder = new Config.Builder(); builder.cacheDir(cacheDir); builder.os(OS.macosx); builder.arch(Arch.x86); builder.targetType(ConsoleTarget.TYPE); builder.mainClass("Main"); builder.addClasspathEntry(p1); builder.addClasspathEntry(p2); builder.addClasspathEntry(p3); builder.addExportedSymbol("YADA*"); builder.addFrameworkPath(new File(p1, "yada")); builder.addFramework("Yada"); builder.addForceLinkClass("org.yada.**"); builder.addLib(new Lib("yada", true)); builder.addResource(new Resource(new File(p1, "resources"))); builder.addWeakFramework("WeakYada"); builder.home(fakeHome); Config config = builder.build(); File p1X86Root = new File(p1, "META-INF/robovm/macosx/x86"); File p3X86Cache = config.getCacheDir(config.getClazzes().getClasspathPaths().get(2)); File p3X86Root = new File(p3X86Cache.getParentFile(), p3X86Cache.getName() + ".extracted/META-INF/robovm/macosx/x86"); assertEquals(Arrays.asList("FOO*", "BAAZ*", "YADA*"), config.getExportedSymbols()); assertEquals(Arrays.asList("com.foo.**", "com.baaz.**", "org.yada.**"), config.getForceLinkClasses()); assertEquals(Arrays.asList( new File(p1X86Root, "foo/bar"), new File(p3X86Root, "baaz/bar"), new File(p1, "yada")), config.getFrameworkPaths()); assertEquals(Arrays.asList("Foo", "Baaz", "Yada"), config.getFrameworks()); assertEquals(Arrays.asList( new Lib("foo", true), new Lib(new File(p1X86Root, "libfoo.a").getAbsolutePath(), true), new Lib("baaz", true), new Lib(new File(p3X86Root, "libbaaz.a").getAbsolutePath(), true), new Lib("yada", true)), config.getLibs()); assertEquals(Arrays.asList( new Resource(new File(p1X86Root, "resources")), new Resource(new File(p3X86Root, "resources")), new Resource(new File(p1, "resources"))), config.getResources()); assertEquals(Arrays.asList("WeakFoo", "WeakBaaz", "WeakYada"), config.getWeakFrameworks()); config = config.builder().arch(Arch.x86_64).build(); File p3X86_64Cache = config.getCacheDir(config.getClazzes().getClasspathPaths().get(2)); File p3X86_64Root = new File(p3X86_64Cache.getParentFile(), p3X86_64Cache.getName() + ".extracted/META-INF/robovm/macosx/x86_64"); assertEquals(Arrays.asList("RAAZ*", "YADA*"), config.getExportedSymbols()); assertEquals(Arrays.asList("com.raaz.**", "org.yada.**"), config.getForceLinkClasses()); assertEquals(Arrays.asList( new File(p3X86_64Root, "raaz/bar"), new File(p1, "yada")), config.getFrameworkPaths()); assertEquals(Arrays.asList("Raaz", "Yada"), config.getFrameworks()); assertEquals(Arrays.asList( new Lib("raaz", true), new Lib(new File(p3X86_64Root, "libraaz.a").getAbsolutePath(), true), new Lib("yada", true)), config.getLibs()); assertEquals(Arrays.asList( new Resource(new File(p3X86_64Root, "resources")), new Resource(new File(p1, "resources"))), config.getResources()); assertEquals(Arrays.asList("WeakRaaz", "WeakYada"), config.getWeakFrameworks()); }
private void mergeConfigsFromClasspath() throws IOException { List<String> dirs = Arrays.asList( "META-INF/robovm/" + os + "/" + sliceArch, "META-INF/robovm/" + os); Config config = new Config(); for (Path path : clazzes.getPaths()) { for (String dir : dirs) { if (path.contains(dir + "/robovm.xml")) { File configXml = new File(new File(extractIfNeeded(path), dir), "robovm.xml"); Builder builder = new Builder(); builder.read(configXml); mergeConfig(builder.config, config); break; } } } mergeConfig(this, config); this.exportedSymbols = config.exportedSymbols; this.unhideSymbols = config.unhideSymbols; this.forceLinkClasses = config.forceLinkClasses; this.frameworkPaths = config.frameworkPaths; this.frameworks = config.frameworks; this.libs = config.libs; this.resources = config.resources; this.weakFrameworks = config.weakFrameworks; }
Config { private void mergeConfigsFromClasspath() throws IOException { List<String> dirs = Arrays.asList( "META-INF/robovm/" + os + "/" + sliceArch, "META-INF/robovm/" + os); Config config = new Config(); for (Path path : clazzes.getPaths()) { for (String dir : dirs) { if (path.contains(dir + "/robovm.xml")) { File configXml = new File(new File(extractIfNeeded(path), dir), "robovm.xml"); Builder builder = new Builder(); builder.read(configXml); mergeConfig(builder.config, config); break; } } } mergeConfig(this, config); this.exportedSymbols = config.exportedSymbols; this.unhideSymbols = config.unhideSymbols; this.forceLinkClasses = config.forceLinkClasses; this.frameworkPaths = config.frameworkPaths; this.frameworks = config.frameworks; this.libs = config.libs; this.resources = config.resources; this.weakFrameworks = config.weakFrameworks; } }
Config { private void mergeConfigsFromClasspath() throws IOException { List<String> dirs = Arrays.asList( "META-INF/robovm/" + os + "/" + sliceArch, "META-INF/robovm/" + os); Config config = new Config(); for (Path path : clazzes.getPaths()) { for (String dir : dirs) { if (path.contains(dir + "/robovm.xml")) { File configXml = new File(new File(extractIfNeeded(path), dir), "robovm.xml"); Builder builder = new Builder(); builder.read(configXml); mergeConfig(builder.config, config); break; } } } mergeConfig(this, config); this.exportedSymbols = config.exportedSymbols; this.unhideSymbols = config.unhideSymbols; this.forceLinkClasses = config.forceLinkClasses; this.frameworkPaths = config.frameworkPaths; this.frameworks = config.frameworks; this.libs = config.libs; this.resources = config.resources; this.weakFrameworks = config.weakFrameworks; } protected  Config(); }
Config { private void mergeConfigsFromClasspath() throws IOException { List<String> dirs = Arrays.asList( "META-INF/robovm/" + os + "/" + sliceArch, "META-INF/robovm/" + os); Config config = new Config(); for (Path path : clazzes.getPaths()) { for (String dir : dirs) { if (path.contains(dir + "/robovm.xml")) { File configXml = new File(new File(extractIfNeeded(path), dir), "robovm.xml"); Builder builder = new Builder(); builder.read(configXml); mergeConfig(builder.config, config); break; } } } mergeConfig(this, config); this.exportedSymbols = config.exportedSymbols; this.unhideSymbols = config.unhideSymbols; this.forceLinkClasses = config.forceLinkClasses; this.frameworkPaths = config.frameworkPaths; this.frameworks = config.frameworks; this.libs = config.libs; this.resources = config.resources; this.weakFrameworks = config.weakFrameworks; } protected  Config(); Builder builder(); Home getHome(); File getInstallDir(); String getExecutableName(); String getImageName(); File getExecutablePath(); File getImagePath(); File getCacheDir(); File getCcBinPath(); OS getOs(); Arch getArch(); List<Arch> getArchs(); String getTriple(); String getClangTriple(); DataLayout getDataLayout(); boolean isClean(); boolean isDebug(); boolean isUseDebugLibs(); boolean isDumpIntermediates(); boolean isSkipRuntimeLib(); boolean isSkipLinking(); boolean isSkipInstall(); int getThreads(); File getMainJar(); String getMainClass(); Cacerts getCacerts(); List<Path> getResourcesPaths(); void addResourcesPath(Path path); DependencyGraph getDependencyGraph(); File getTmpDir(); List<String> getForceLinkClasses(); List<String> getExportedSymbols(); List<String> getUnhideSymbols(); List<Lib> getLibs(); List<String> getFrameworks(); List<String> getWeakFrameworks(); List<File> getFrameworkPaths(); List<Resource> getResources(); File getOsArchDepLibDir(); Clazzes getClazzes(); VTable.Cache getVTableCache(); ITable.Cache getITableCache(); MarshalerLookup getMarshalerLookup(); List<CompilerPlugin> getCompilerPlugins(); List<LaunchPlugin> getLaunchPlugins(); List<TargetPlugin> getTargetPlugins(); List<Plugin> getPlugins(); List<String> getPluginArguments(); List<File> getBootclasspath(); List<File> getClasspath(); Properties getProperties(); Logger getLogger(); Target getTarget(); String getTargetType(); TreeShakerMode getTreeShakerMode(); String getIosSdkVersion(); String getIosDeviceType(); InfoPList getIosInfoPList(); InfoPList getInfoPList(); File getIosEntitlementsPList(); SigningIdentity getIosSignIdentity(); ProvisioningProfile getIosProvisioningProfile(); boolean isIosSkipSigning(); Tools getTools(); String getArchiveName(Path path); File getLlFile(Clazz clazz); File getCFile(Clazz clazz); File getBcFile(Clazz clazz); File getSFile(Clazz clazz); File getOFile(Clazz clazz); File getLinesOFile(Clazz clazz); File getLinesLlFile(Clazz clazz); File getInfoFile(Clazz clazz); File getCacheDir(Path path); File getGeneratedClassDir(Path path); }
Config { private void mergeConfigsFromClasspath() throws IOException { List<String> dirs = Arrays.asList( "META-INF/robovm/" + os + "/" + sliceArch, "META-INF/robovm/" + os); Config config = new Config(); for (Path path : clazzes.getPaths()) { for (String dir : dirs) { if (path.contains(dir + "/robovm.xml")) { File configXml = new File(new File(extractIfNeeded(path), dir), "robovm.xml"); Builder builder = new Builder(); builder.read(configXml); mergeConfig(builder.config, config); break; } } } mergeConfig(this, config); this.exportedSymbols = config.exportedSymbols; this.unhideSymbols = config.unhideSymbols; this.forceLinkClasses = config.forceLinkClasses; this.frameworkPaths = config.frameworkPaths; this.frameworks = config.frameworks; this.libs = config.libs; this.resources = config.resources; this.weakFrameworks = config.weakFrameworks; } protected  Config(); Builder builder(); Home getHome(); File getInstallDir(); String getExecutableName(); String getImageName(); File getExecutablePath(); File getImagePath(); File getCacheDir(); File getCcBinPath(); OS getOs(); Arch getArch(); List<Arch> getArchs(); String getTriple(); String getClangTriple(); DataLayout getDataLayout(); boolean isClean(); boolean isDebug(); boolean isUseDebugLibs(); boolean isDumpIntermediates(); boolean isSkipRuntimeLib(); boolean isSkipLinking(); boolean isSkipInstall(); int getThreads(); File getMainJar(); String getMainClass(); Cacerts getCacerts(); List<Path> getResourcesPaths(); void addResourcesPath(Path path); DependencyGraph getDependencyGraph(); File getTmpDir(); List<String> getForceLinkClasses(); List<String> getExportedSymbols(); List<String> getUnhideSymbols(); List<Lib> getLibs(); List<String> getFrameworks(); List<String> getWeakFrameworks(); List<File> getFrameworkPaths(); List<Resource> getResources(); File getOsArchDepLibDir(); Clazzes getClazzes(); VTable.Cache getVTableCache(); ITable.Cache getITableCache(); MarshalerLookup getMarshalerLookup(); List<CompilerPlugin> getCompilerPlugins(); List<LaunchPlugin> getLaunchPlugins(); List<TargetPlugin> getTargetPlugins(); List<Plugin> getPlugins(); List<String> getPluginArguments(); List<File> getBootclasspath(); List<File> getClasspath(); Properties getProperties(); Logger getLogger(); Target getTarget(); String getTargetType(); TreeShakerMode getTreeShakerMode(); String getIosSdkVersion(); String getIosDeviceType(); InfoPList getIosInfoPList(); InfoPList getInfoPList(); File getIosEntitlementsPList(); SigningIdentity getIosSignIdentity(); ProvisioningProfile getIosProvisioningProfile(); boolean isIosSkipSigning(); Tools getTools(); String getArchiveName(Path path); File getLlFile(Clazz clazz); File getCFile(Clazz clazz); File getBcFile(Clazz clazz); File getSFile(Clazz clazz); File getOFile(Clazz clazz); File getLinesOFile(Clazz clazz); File getLinesLlFile(Clazz clazz); File getInfoFile(Clazz clazz); File getCacheDir(Path path); File getGeneratedClassDir(Path path);  }