private static ConventionMapping conventionMapping(Object conventionAware) { // TODO: try other alternatives to convention mapping // Convention mapping is an internal API. // Other options here: // http://forums.gradle.org/gradle/topics/how_can_i_do_convention_mappings_from_java_without_depending_on_an_internal_api return ((IConventionAware) conventionAware).getConventionMapping(); }
private static ConventionMapping conventionMapping(Object conventionAware) { // TODO: try other alternatives to convention mapping // Convention mapping is an internal API. // Other options here: // http://forums.gradle.org/gradle/topics/how_can_i_do_convention_mappings_from_java_without_depending_on_an_internal_api return ((IConventionAware) conventionAware).getConventionMapping(); } }
protected static ConventionMapping conventionMappingOf(Object object) { return ((IConventionAware) object).getConventionMapping(); }
protected void configure(final GwtCompileOptions options) { ((IConventionAware)this).getConventionMapping().map("localWorkers", new Callable<Integer>() { @Override public Integer call() throws Exception { return options.getLocalWorkers(); } }); }
public ConventionMapping getConventionMapping() { if (conventionMapping == null) { this.conventionMapping = toType(object, IConventionAware.class).getConventionMapping(); } return conventionMapping; }
@Override public void execute( final Report report ) { ConventionMapping reportMapping = ( (IConventionAware) report ).getConventionMapping(); reportMapping.map( "destination", new Callable<File>() { @Override public File call() { return reportingExtension.file( "jgiven" + "/" + test.getName() + "/" + report.getName() ); } } ); } } );
public void configure(final GwtExtension extension) { ConventionMapping mapping = ((IConventionAware) this).getConventionMapping(); mapping.map("modules", new Callable<List<String>>() { @Override public List<String> call() { return extension.getModule(); } }); }
/** * Propagate 'defaultResourcesDirectory' */ private void configureDefaultResourcesDirectory(final Project project, final IConventionAware conventionAwareRebelTask) { conventionAwareRebelTask.getConventionMapping().map(RebelGenerateTask.NAME_DEFAULT_RESOURCES_DIRECTORY, new Callable<File>() { public File call() { try { return getMainOutput(project).getResourcesDir(); } catch (Exception e) { return null; } } }); }
public void configure(final PutnamiExtension extension) { ConventionMapping mapping = ((IConventionAware) this).getConventionMapping(); mapping.map("modules", new Callable<List<String>>() { @Override public List<String> call() { return extension.getModule(); } }); }
/** * Propagate 'defaultResourcesDirectory' */ private void configureDefaultResourcesDirectory(final Project project, final IConventionAware conventionAwareRebelTask) { conventionAwareRebelTask.getConventionMapping().map(RebelGenerateTask.NAME_DEFAULT_RESOURCES_DIRECTORY, new Callable<File>() { public File call() { try { return getMainOutput(project).getResourcesDir(); } catch (Exception e) { return null; } } }); }
/** * Propagate 'defaultClassesDirectory' */ private void configureDefaultClassesDirectory(final Project project, final IConventionAware conventionAwareRebelTask) { conventionAwareRebelTask.getConventionMapping().map(RebelGenerateTask.NAME_DEFAULT_CLASSES_DIRECTORIES, new Callable<List<File>>() { public List<File> call() { try { return getClassesDirs(getMainOutput(project)); } catch (Exception e) { return null; } } }); }
/** * Propagate 'defaultClassesDirectory' */ private void configureDefaultClassesDirectory(final Project project, final IConventionAware conventionAwareRebelTask) { conventionAwareRebelTask.getConventionMapping().map(RebelGenerateTask.NAME_DEFAULT_CLASSES_DIRECTORIES, new Callable<List<File>>() { public List<File> call() { try { return getClassesDirs(getMainOutput(project)); } catch (Exception e) { return null; } } }); }
/** * Handle the 'rebelXmlDirectory' configuration option */ private void configureRebelXmlDirectory(final Project project, final IConventionAware conventionAwareRebelTask, final RebelDslMain rebelExtension) { conventionAwareRebelTask.getConventionMapping().map(RebelGenerateTask.NAME_REBEL_XML_DIRECTORY, new Callable<Object>() { public Object call() throws Exception { if (project.hasProperty("rebel.rebelXmlDirectory")) { return new File(project.property("rebel.rebelXmlDirectory").toString()); } else if (rebelExtension.getRebelXmlDirectory() != null) { return new File(rebelExtension.getRebelXmlDirectory()); } else { return getMainOutput(project).getResourcesDir(); } } }); }
/** * Handle the 'rebelXmlDirectory' configuration option */ private void configureRebelXmlDirectory(final Project project, final IConventionAware conventionAwareRebelTask, final RebelDslMain rebelExtension) { conventionAwareRebelTask.getConventionMapping().map(RebelGenerateTask.NAME_REBEL_XML_DIRECTORY, new Callable<Object>() { public Object call() throws Exception { if (project.hasProperty("rebel.rebelXmlDirectory")) { return new File(project.property("rebel.rebelXmlDirectory").toString()); } else if (rebelExtension.getRebelXmlDirectory() != null) { return new File(rebelExtension.getRebelXmlDirectory()); } else { return getMainOutput(project).getResourcesDir(); } } }); }
public void execute(Plugin p) { generateRebelTask.setPackaging(RebelGenerateTask.PACKAGING_TYPE_WAR); // Propagate 'defaultWebappDirectory' conventionAwareRebelTask.getConventionMapping().map(RebelGenerateTask.NAME_DEFAULT_WEBAPP_DIRECTORY, new Callable<Object>() { public Object call() throws Exception { try { WarPluginConvention warConvention = project.getConvention().getPlugin(WarPluginConvention.class); return warConvention.getWebAppDir(); } catch (Exception e) { return null; } } }); } });
public void execute(Plugin p) { generateRebelTask.setPackaging(RebelGenerateTask.PACKAGING_TYPE_WAR); // Propagate 'defaultWebappDirectory' conventionAwareRebelTask.getConventionMapping().map(RebelGenerateTask.NAME_DEFAULT_WEBAPP_DIRECTORY, new Callable<Object>() { public Object call() throws Exception { try { WarPluginConvention warConvention = project.getConvention().getPlugin(WarPluginConvention.class); return warConvention.getWebAppDir(); } catch (Exception e) { return null; } } }); } });
public void configureCodeServer(final Project project, final PutnamiExtension extention) { final DevOption options = extention.getDev(); options.init(project); ConventionMapping convention = ((IConventionAware) this).getConventionMapping(); convention.map("modules", new Callable<List<String>>() { @Override public List<String> call() { return extention.getModule(); } }); }
public void configureCodeServer(final Project project, final GwtExtension extention) { final DevOption options = extention.getDev(); options.init(project); ConventionMapping convention = ((IConventionAware) this).getConventionMapping(); convention.map("modules", new Callable<List<String>>() { @Override public List<String> call() { return extention.getModule(); } }); }
@Override public void execute(final GwtSuperDev task) { task.configure(extension.getSuperDev()); ConventionMapping conventionMapping = ((IConventionAware)task).getConventionMapping(); conventionMapping.map("workDir", new Callable<File>() { @Override public File call() throws Exception { return extension.getWorkDir(); }}); } });
conventionAware.getConventionMapping().map("war", new Callable<File>(){ @Override public File call() throws Exception { return extension.getDevWar(); }}); conventionAware.getConventionMapping().map("extra", new Callable<File>(){ @Override public File call() throws Exception { return extension.getExtraDir(); }}); conventionAware.getConventionMapping().map("workDir", new Callable<File>(){ @Override public File call() throws Exception { return extension.getWorkDir(); }}); conventionAware.getConventionMapping().map("gen", new Callable<File>(){ @Override public File call() throws Exception { return extension.getGenDir(); }}); conventionAware.getConventionMapping().map("cacheDir", new Callable<File>(){ @Override public File call() throws Exception { return extension.getCacheDir(); }}); conventionAware.getConventionMapping().map("logLevel", new Callable<LogLevel>(){ @Override public LogLevel call() throws Exception {