Skip to content

Commit

Permalink
gh-18 Gradle is working for one example
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew O. Smith committed May 7, 2015
1 parent a4ec9c3 commit 6b3727e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,29 @@ public class GradleProjectsCreator {
println deps0;
def deps = deps0.grep({ it.scope == gradleScope });
println deps;
println "COntect Roots:" + model.contentRoots;
def crs = model.contentRoots;
def dependencies = model.dependencies;

[ dependencies : deps.gather{it.file.toString()},
[ dependencies : dependencies.collect({ it.file.absolutePath}),

resources: [] ,

sources: "test" == scope ? model.modules.contentRoots.testDirectories.gather({it.directory}) :
model.modules.contentRoots.sourceDirectories.gather({it.directory}),
sources: "test" == scope ? crs.collect({cr -> [cr.testDirectories.collect({it.directory.absolutePath}),
cr.generatedTestDirectories.collect({it.directory.absolutePath})
]}).flatten()
:
crs.collect({cr -> [cr.sourceDirectories.collect({it.directory.absolutePath}),
cr.generatedSourceDirectories.collect({it.directory.absolutePath})

]}).flatten() ,


elements: "test" == scope ? model.compilerOutput.outputDir.toString() :
model.compilerOutput.testOutputDir.toString() ]

}



}
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public class MavenProjectHandler {
projectInfo['runtime']['elements'] +
projectInfo['test']['classpath'];
def resourceCache = new ResourceCache();
classpath.each({if(it != null) resourceCache.submit(it)});
classpath.each({if(it != null) {println "IT:" + it; resourceCache.submit(it)}});
bootClasspath.split(System.getProperty("path.separator")).each({if(it != null) resourceCache.submit(it)});

def staticClassloader = createClassLoaderStatic(classpath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@ public class TestGradleProjectsCreator {
GradleProjectsCreator target = new GradleProjectsCreator();

@Test
void testArgs(){
println System.getProperty ('user.dir');
target.create("", ".");
void testArgs() throws Exception {
println "USER.DIR" + System.getProperty ('user.dir');
def proj = target.create("", ".");
println "GRADLE PROJECT:" + proj;
Class c = proj[0].getClass();
Class[] theInterfaces = c.getInterfaces();
for (int i = 0; i < theInterfaces.length; i++) {
String interfaceName = theInterfaces[i].getName();
System.out.println( "INTERFACE:" + interfaceName);
}
println "DEPENDENCIES: " + target.resolveDependencies( proj[0], "", "runtime") ;

}

Expand Down

0 comments on commit 6b3727e

Please sign in to comment.