JkEclipseClasspathGenerator { public String generate() { try { return _generate(); } catch (final Exception e) { throw JkUtilsThrowable.unchecked(e); } } private  JkEclipseClasspathGenerator(JkJavaIdeSupport ideSupport); static JkEclipseClasspathGenerator of(JkJavaIdeSupport ideSupport); JkEclipseClasspathGenerator setIncludeJavadoc(boolean includeJavadoc); JkEclipseClasspathGenerator setJreContainer(String jreContainer); JkEclipseClasspathGenerator setUsePathVariables(boolean usePathVariables); JkEclipseClasspathGenerator setImportedProjects(List<Path> importedBuildProjects); JkEclipseClasspathGenerator setDefDependencies(JkDependencyResolver buildDependencyResolver,
                                                          JkDependencySet buildDependencies); JkEclipseClasspathGenerator addAttribute(JkDependency dependency, String name, String value); JkEclipseClasspathGenerator addAttributes(JkDependency dependency, Properties attributes); JkEclipseClasspathGenerator addAccessRule(JkDependency dependency, String kind, String pattern); JkEclipseClasspathGenerator addAccessRules(JkDependency dependency, Properties rules); String generate();  }
@Test public void generate() throws Exception { final Path top = unzipToDir(ZIP_NAME); final JkJavaProject baseProject = JkJavaProject.of() .apply(this::configureCompileLayout) .apply(this::configureTestCompileLayout) .setBaseDir(top.resolve("base")) .getJarProduction() .getDependencyManagement() .addDependencies(JkDependencySet.of() .and(JkPopularModules.APACHE_HTTP_CLIENT, "4.5.6")).__.__; final JkEclipseClasspathGenerator baseGenerator = JkEclipseClasspathGenerator.of(baseProject.getJavaIdeSupport()) .setUsePathVariables(true) .setDefDependencies(baseProject.getJarProduction().getDependencyManagement().getResolver(), JkDependencySet.of().and(JkPopularModules.GUAVA, "21.0")); final String baseClasspath = baseGenerator.generate(); System.out.println("\nbase .classpath"); System.out.println(baseClasspath); final JkJavaProject coreProject = JkJavaProject.of() .apply(this::configureCompileLayout) .setBaseDir(top.resolve("core")) .getJarProduction() .getDependencyManagement() .addDependencies(JkDependencySet.of().and(baseProject.toDependency())).__ .getTesting() .getCompilation() .getLayout() .emptySources().addSource("test") .emptyResources().addResource("res-test").__.__ .getTestProcessor() .setForkingProcess(true).__.__.__; final JkEclipseClasspathGenerator coreGenerator = JkEclipseClasspathGenerator.of(coreProject.getJavaIdeSupport()); final String coreClasspath = coreGenerator.generate(); System.out.println("\ncore .classpath"); System.out.println(coreClasspath); final JkJavaProject desktopProject = JkJavaProject.of() .apply(this::configureCompileLayout) .apply(this::configureTestCompileLayout) .setBaseDir(top.resolve("desktop")) .getJarProduction() .getDependencyManagement() .addDependencies(JkDependencySet.of().and(coreProject.toDependency())).__.__; desktopProject.getPublication().getArtifactProducer().makeAllArtifacts(); final JkEclipseClasspathGenerator desktopGenerator = JkEclipseClasspathGenerator.of(desktopProject.getJavaIdeSupport()); final String result2 = desktopGenerator.generate(); System.out.println("\ndesktop .classpath"); System.out.println(result2); }