Beispiel #1
0
  private void _configureTaskBuildSoyForJavaPlugin(final BuildSoyTask buildSoyTask) {

    buildSoyTask.setSource(
        new Callable<File>() {

          @Override
          public File call() throws Exception {
            return _getResourcesDir(buildSoyTask.getProject());
          }
        });
  }
Beispiel #2
0
  private BuildSoyTask _addTaskBuildSoy(Project project) {
    final BuildSoyTask buildSoyTask =
        GradleUtil.addTask(project, BUILD_SOY_TASK_NAME, BuildSoyTask.class);

    buildSoyTask.setDescription("Compiles Closure Templates into JavaScript functions.");
    buildSoyTask.setGroup(BasePlugin.BUILD_GROUP);
    buildSoyTask.setIncludes(Collections.singleton("**/*.soy"));

    PluginContainer pluginContainer = project.getPlugins();

    pluginContainer.withType(
        JavaPlugin.class,
        new Action<JavaPlugin>() {

          @Override
          public void execute(JavaPlugin javaPlugin) {
            _configureTaskBuildSoyForJavaPlugin(buildSoyTask);
          }
        });

    return buildSoyTask;
  }
Beispiel #3
0
  private void _configureTaskBuildSoyClasspath(
      BuildSoyTask buildSoyTask, FileCollection fileCollection) {

    buildSoyTask.setClasspath(fileCollection);
  }