本文整理汇总了Java中jdepend.framework.JDepend.addDirectory方法的典型用法代码示例。如果您正苦于以下问题:Java JDepend.addDirectory方法的具体用法?Java JDepend.addDirectory怎么用?Java JDepend.addDirectory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jdepend.framework.JDepend
的用法示例。
在下文中一共展示了JDepend.addDirectory方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: of
import jdepend.framework.JDepend; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public static PackageAnalyser of(File classDir, final String packagePrefix) {
final PackageFilter filter = new PackageFilter() {
@Override
public boolean accept(String name) {
return name.startsWith(packagePrefix);
}
};
final JDepend depend = new JDepend(filter);
try {
depend.addDirectory(classDir.getPath());
} catch (final IOException e) {
throw new RuntimeException(e);
}
final Collection<JavaPackage> packages = depend.analyze();
return new PackageAnalyser(packages);
}
示例2: runJDepend
import jdepend.framework.JDepend; //导入方法依赖的package包/类
/**
* @param treeObjects not null
* @return non null list
*/
protected List<JavaPackage> runJDepend(JDepend jdepend, TreeObject[] treeObjects) {
for (int i = 0; i < treeObjects.length; i++) {
try {
if(!treeObjects[i].isLeaf()){
TreeFolder folder = (TreeFolder)treeObjects[i];
// add roots
ArrayList<String> dirs = folder.getClassesLocation();
for (int j = 0; j < dirs.size(); j++) {
jdepend.addDirectory("" + dirs.get(j)); //$NON-NLS-1$
}
}
} catch (Exception e) {
// if directory doesn't exist, may be project need to be rebuild
JDepend4EclipsePlugin.handle(e);
}
}
final List<?> packages = new ArrayList<Object>(jdepend.analyze());
List<JavaPackage> filteredPackages = filterPackages(packages, jdepend);
Collections.sort(filteredPackages, new PackageComparator(PackageComparator.byName()));
return filteredPackages;
}
示例3: setUp
import jdepend.framework.JDepend; //导入方法依赖的package包/类
protected void setUp() {
jdepend = new JDepend();
try {
String dirs = System.getProperty(BUILD_DIRS_LIST_PROPERTY, ".");
StringTokenizer tok = new StringTokenizer(dirs, ",");
while (tok.hasMoreTokens()) {
String dir = tok.nextToken().trim();
System.out.println("Analyzing source from " + dir);
jdepend.addDirectory(dir);
}
jdepend.analyzeTestClasses(false);
} catch (IOException ioe) {
ioe.printStackTrace();
fail(ioe.getMessage());
}
}
示例4: setUp
import jdepend.framework.JDepend; //导入方法依赖的package包/类
@Override
protected void setUp() throws Exception {
super.setUp();
// Get the classes root directory
String rootDirectory = getClass().getResource("/").getFile();
// Setup the JDepend analysis
engine = new JDepend();
engine.addDirectory(rootDirectory);
engine.analyze();
}
示例5: initJdepend
import jdepend.framework.JDepend; //导入方法依赖的package包/类
/**
* Initializes {@link #jdepend}.
*
* @throws IOException when initialization fails
*/
@Before
public void initJdepend() throws IOException {
jdepend = new JDepend();
jdepend.addDirectory("target/classes");
jdepend.analyze();
}
示例6: setUp
import jdepend.framework.JDepend; //导入方法依赖的package包/类
protected void setUp() {
jdepend = new JDepend();
try {
String dir = System.getProperty("build.dir", ".");
jdepend.addDirectory(dir);
jdepend.analyzeTestClasses(false);
} catch (IOException ioe) {
ioe.printStackTrace();
fail(ioe.getMessage());
}
}
示例7: initJdepend
import jdepend.framework.JDepend; //导入方法依赖的package包/类
/**
* Initializes {@link JDepend}.
*
* @throws IOException when initialization fails
*/
@Before
public void initJdepend() throws IOException {
jdepend = new JDepend();
jdepend.addDirectory("target/classes");
jdepend.analyze();
}
示例8: setUpClass
import jdepend.framework.JDepend; //导入方法依赖的package包/类
@BeforeClass
public static void setUpClass() throws Exception
{
jdepend = new JDepend();
jdepend.addDirectory("target/classes");
}
示例9: generateOverviewSummary
import jdepend.framework.JDepend; //导入方法依赖的package包/类
private static void generateOverviewSummary(RootDoc root, ClassDocGraph graph, File outputDirectory) throws IOException {
final Map<String, PackageDoc> packages = getPackages(root);
PackageFilter packageFilter = PackageFilter.all();
for (Map.Entry<String, PackageDoc> entry : packages.entrySet()) {
String packageName = entry.getKey();
PackageDoc p = entry.getValue();
if (!ClassDocGraph.isHidden(p)) {
packageFilter.including(packageName);
}
}
JDepend jdepend = new JDepend(packageFilter.excludingRest());
File[] classPath = getClassPath(root.options());
for (File e: classPath) {
if (e.isDirectory()) {
root.printNotice(
"Included into dependency analysis: " + e);
jdepend.addDirectory(e.toString());
} else {
root.printNotice(
"Excluded from dependency analysis: " + e);
}
}
jdepend.analyze();
if (checkClasspathOption(root, jdepend)) {
instrumentDiagram(
root, outputDirectory, "overview-summary",
graph.getOverviewSummaryDiagram(jdepend));
} else {
root.printWarning(
"Please make sure that the '" +
OPTION_SOURCE_CLASS_PATH +
"' option was specified correctly.");
root.printWarning(
"Package dependency diagram will not be generated " +
"to avoid the inaccurate result.");
}
}
示例10: before
import jdepend.framework.JDepend; //导入方法依赖的package包/类
@Before
public void before() throws IOException {
jdepend = new JDepend();
jdepend.addDirectory("build/classes/main");
}
示例11: init
import jdepend.framework.JDepend; //导入方法依赖的package包/类
@BeforeClass
public static void init() throws IOException {
depend = new JDepend(PackageFilter.all().including("ch.docksnet").excludingRest());
depend.addDirectory("out/production/intellij-reference-diagram");
depend.analyze();
}
示例12: addConfigDir
import jdepend.framework.JDepend; //导入方法依赖的package包/类
private void addConfigDir(final JDepend jdepend, final String config) throws IOException {
final String projectDir = System.getProperty("user.dir");
final String classesDir =
String.format("%s/build/classes/%s", projectDir, config);
jdepend.addDirectory(classesDir);
}
示例13: setUp
import jdepend.framework.JDepend; //导入方法依赖的package包/类
@Before
public void setUp() throws IOException {
jdepend = new JDepend();
jdepend.addDirectory("build/classes/main");
}
示例14: setUpClass
import jdepend.framework.JDepend; //导入方法依赖的package包/类
@BeforeClass
public static void setUpClass() throws Exception {
jdepend = new JDepend();
jdepend.addDirectory("build/classes");
}