当前位置: 首页>>代码示例>>Java>>正文


Java JDepend.addDirectory方法代码示例

本文整理汇总了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);
}
 
开发者ID:jerkar,项目名称:jerkar,代码行数:20,代码来源:PackageDependency.java

示例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;
}
 
开发者ID:iloveeclipse,项目名称:jdepend4eclipse,代码行数:27,代码来源:PackageTreeView.java

示例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());
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:17,代码来源:CycleTestCase.java

示例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();
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:13,代码来源:PackageDependenciesTest.java

示例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();
}
 
开发者ID:HeliosTeam,项目名称:jenkins-filesize-monitor,代码行数:13,代码来源:CyclicDependencyTest.java

示例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());
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:12,代码来源:CycleTestCase.java

示例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();
}
 
开发者ID:cyChop,项目名称:daily-tasks,代码行数:13,代码来源:CyclicDependenciesTest.java

示例8: setUpClass

import jdepend.framework.JDepend; //导入方法依赖的package包/类
@BeforeClass
public static void setUpClass() throws Exception
{
	jdepend = new JDepend();
	jdepend.addDirectory("target/classes");
}
 
开发者ID:B4dT0bi,项目名称:silvertunnel-ng,代码行数:7,代码来源:DependencyLocalTest.java

示例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.");
    }
}
 
开发者ID:grahamedgecombe,项目名称:apiviz,代码行数:45,代码来源:APIviz.java

示例10: before

import jdepend.framework.JDepend; //导入方法依赖的package包/类
@Before
public void before() throws IOException {
    jdepend = new JDepend();
    jdepend.addDirectory("build/classes/main");
}
 
开发者ID:ContainerSolutions,项目名称:minimesos,代码行数:6,代码来源:JDependCyclesTest.java

示例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();
}
 
开发者ID:Stefku,项目名称:intellij-reference-diagram,代码行数:7,代码来源:DependencyTest.java

示例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);
}
 
开发者ID:universal-automata,项目名称:liblevenshtein-java,代码行数:7,代码来源:JDependIntegTest.java

示例13: setUp

import jdepend.framework.JDepend; //导入方法依赖的package包/类
@Before
public void setUp() throws IOException {
    jdepend = new JDepend();
    jdepend.addDirectory("build/classes/main");
}
 
开发者ID:spring-projects,项目名称:spring-ldap,代码行数:6,代码来源:TestsWithJdepend.java

示例14: setUpClass

import jdepend.framework.JDepend; //导入方法依赖的package包/类
@BeforeClass
public static void setUpClass() throws Exception {
    jdepend = new JDepend();
    jdepend.addDirectory("build/classes");
}
 
开发者ID:sirvaliance,项目名称:netlib,代码行数:6,代码来源:DependencyLocalTest.java


注:本文中的jdepend.framework.JDepend.addDirectory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。