
org.kuali.maven.plugins.graph.mojo.MultiMojo Maven / Gradle / Ivy
/**
* Copyright 2010-2011 The Kuali Foundation
*
* Licensed under the Educational Community License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/licenses/ecl2.php
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.kuali.maven.plugins.graph.mojo;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import org.kuali.maven.plugins.graph.pojo.Category;
import org.kuali.maven.plugins.graph.pojo.GraphDescriptor;
import org.kuali.maven.plugins.graph.pojo.MojoContext;
import org.kuali.maven.plugins.graph.util.Helper;
/**
*
* Convenience mojo for generating multiple graphs.
*
*
* @goal multi
* @requiresDependencyResolution compile|test|runtime
*/
public class MultiMojo extends BaseGraphMojo {
/**
*
* List of graphs to generate organized into categories and rows.
*
*
*
* For example:
*
*
*
* <categories>
* <category>
* <name>logging</name>
* <description>Dependencies on logging libraries</description>
* <rows>
* <row>
* <name>logging</name>
* <description>Dependencies on logging libraries</description>
* <descriptors>
* <descriptor>
* <includes>org.slf4j,log4j</includes>
* <name>other-logging</name>
* </descriptor>
* <descriptor>
* <includes>commons-logging</includes>
* <filterType>PATH</filterType>
* <name>commons-logging</name>
* </descriptor>
* </descriptors>
* </row>
* </rows>
* </category>
* </categories>
*
*
* @parameter
*/
List categories;
/**
*
* The directory graphs are generated into.
*
*
* @parameter expression="${graph.outputDir}" default-value="${project.build.directory}/graph"
* @required
*/
File outputDir;
/**
*
* The output format for the graph. This can be any format supported by Graphviz (png, jpg, gif, pdf, ...)
*
*
* @parameter expression="${graph.outputFormat}" default-value="png"
* @required
*/
String outputFormat;
/**
*
* If true, the default set of graphs is generated in addition to those provided in categories
list.
*
*
* @parameter expression="${graph.generateDefaultGraphs}" default-value="true"
*/
boolean generateDefaultGraphs;
@Override
public void execute() {
MojoContext mc = Helper.copyProperties(MojoContext.class, this);
GraphDescriptor gc = Helper.copyProperties(GraphDescriptor.class, this);
MojoHelper helper = new MojoHelper();
categories = Helper.isEmpty(categories) ? new ArrayList() : categories;
helper.categories(mc, gc, categories);
}
public File getOutputDir() {
return outputDir;
}
public void setOutputDir(File dir) {
this.outputDir = dir;
}
public boolean isGenerateDefaultGraphs() {
return generateDefaultGraphs;
}
public void setGenerateDefaultGraphs(boolean generateDefaultGraphs) {
this.generateDefaultGraphs = generateDefaultGraphs;
}
public String getOutputFormat() {
return outputFormat;
}
public void setOutputFormat(String type) {
this.outputFormat = type;
}
public List getCategories() {
return categories;
}
public void setCategories(List categories) {
this.categories = categories;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy