@Test
 public void testLoadSources() throws SQLException {
   final SourceSet set = new SourceSet();
   set.loadSources(
       Thread.currentThread()
           .getContextClassLoader()
           .getResourceAsStream("net/codemate/databases.yml"));
   Assert.assertNotNull(set.getConnection("hsqlSource"));
 }
示例#2
0
 public void configureForSourceSet(final SourceSet sourceSet, AbstractCompile compile) {
   ConventionMapping conventionMapping;
   compile.setDescription(String.format("Compiles the %s.", sourceSet.getJava()));
   conventionMapping = compile.getConventionMapping();
   compile.setSource(sourceSet.getJava());
   conventionMapping.map(
       "classpath",
       new Callable<Object>() {
         public Object call() throws Exception {
           return sourceSet.getCompileClasspath();
         }
       });
   conventionMapping.map(
       "destinationDir",
       new Callable<Object>() {
         public Object call() throws Exception {
           return sourceSet.getOutput().getClassesDir();
         }
       });
 }