Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package com.liferay.gradle.plugins.wsdl.builder;
import com.liferay.gradle.util.FileUtil;
import com.liferay.gradle.util.GradleUtil;
import groovy.lang.Closure;
import java.io.File;
import java.util.Collections;
import java.util.Iterator;
import java.util.Set;
import java.util.concurrent.Callable;
import org.gradle.api.Action;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.Task;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.artifacts.DependencySet;
import org.gradle.api.file.CopySpec;
import org.gradle.api.file.FileCollection;
import org.gradle.api.file.SourceDirectorySet;
import org.gradle.api.plugins.BasePlugin;
import org.gradle.api.plugins.JavaPlugin;
import org.gradle.api.plugins.PluginContainer;
import org.gradle.api.plugins.WarPlugin;
import org.gradle.api.plugins.WarPluginConvention;
import org.gradle.api.tasks.JavaExec;
import org.gradle.api.tasks.SourceSet;
import org.gradle.api.tasks.TaskContainer;
import org.gradle.api.tasks.TaskInputs;
import org.gradle.api.tasks.TaskOutputs;
import org.gradle.api.tasks.bundling.Jar;
import org.gradle.api.tasks.compile.JavaCompile;
/**
* @author Andrea Di Giorgi
*/
public class WSDLBuilderPlugin implements Plugin {
public static final String BUILD_WSDL_TASK_NAME = "buildWSDL";
public static final String CONFIGURATION_NAME = "wsdlBuilder";
@Override
public void apply(Project project) {
GradleUtil.applyPlugin(project, JavaPlugin.class);
final Configuration wsdlBuilderConfiguration =
addConfigurationWSDLBuilder(project);
addTaskBuildWSDL(project);
project.afterEvaluate(
new Action() {
@Override
public void execute(Project project) {
configureTasksBuildWSDL(project, wsdlBuilderConfiguration);
}
});
}
protected Configuration addConfigurationWSDLBuilder(final Project project) {
Configuration configuration = GradleUtil.addConfiguration(
project, CONFIGURATION_NAME);
configuration.defaultDependencies(
new Action() {
@Override
public void execute(DependencySet dependencySet) {
addDependenciesWSDLBuilder(project);
}
});
configuration.setDescription(
"Configures Apache Axis for generating WSDL client stubs.");
configuration.setVisible(false);
return configuration;
}
protected void addDependenciesWSDLBuilder(Project project) {
GradleUtil.addDependency(
project, CONFIGURATION_NAME, "axis", "axis-wsdl4j", "1.5.1");
GradleUtil.addDependency(
project, CONFIGURATION_NAME, "com.liferay", "org.apache.axis",
"1.4.LIFERAY-PATCHED-1");
GradleUtil.addDependency(
project, CONFIGURATION_NAME, "commons-discovery",
"commons-discovery", "0.2");
GradleUtil.addDependency(
project, CONFIGURATION_NAME, "commons-logging", "commons-logging",
"1.0.4");
GradleUtil.addDependency(
project, CONFIGURATION_NAME, "javax.activation", "activation",
"1.1");
GradleUtil.addDependency(
project, CONFIGURATION_NAME, "javax.mail", "mail", "1.4");
GradleUtil.addDependency(
project, CONFIGURATION_NAME, "org.apache.axis", "axis-jaxrpc",
"1.4");
GradleUtil.addDependency(
project, CONFIGURATION_NAME, "org.apache.axis", "axis-saaj", "1.4");
}
protected BuildWSDLTask addTaskBuildWSDL(Project project) {
final BuildWSDLTask buildWSDLTask = GradleUtil.addTask(
project, BUILD_WSDL_TASK_NAME, BuildWSDLTask.class);
buildWSDLTask.setDescription("Generates WSDL client stubs.");
buildWSDLTask.setDestinationDir(
new Callable