Package org.apache.tools.ant

Examples of org.apache.tools.ant.Project


        cleanCache();
    }

    private void cleanCache() {
        Delete del = new Delete();
        del.setProject(new Project());
        del.setDir(cache);
        del.execute();
    }
View Full Code Here


    private Project project;

    protected void setUp() throws Exception {
        createCache();
        project = new Project();
        project.setProperty("ivy.settings.file", "test/repositories/ivysettings.xml");

        fileset = new IvyCacheFileset();
        fileset.setProject(project);
        System.setProperty("ivy.cache.dir", cache.getAbsolutePath());
View Full Code Here

        cleanCache();
    }

    private void cleanCache() {
        Delete del = new Delete();
        del.setProject(new Project());
        del.setDir(cache);
        del.execute();
    }
View Full Code Here

                getArchiveFileInCache("org1", "mod1.2", "2.0", "mod1.2", "jar", "jar", cache2)
                        .getAbsolutePath(), new File(directoryScanner.getBasedir(),
                        directoryScanner.getIncludedFiles()[0]).getAbsolutePath());
        } finally {
            Delete del = new Delete();
            del.setProject(new Project());
            del.setDir(cache2);
            del.execute();
        }
    }
View Full Code Here

                .getResource("mirror-resolver-settings.xml"));
    }

    protected void tearDown() throws Exception {
        Delete del = new Delete();
        del.setProject(new Project());
        del.setDir(cache);
        del.execute();
    }
View Full Code Here

     * @param project
     *            TODO add text.
     * @return An IvySetting instance.
     */
    public static IvyAntSettings getDefaultInstance(ProjectComponent task) {
        Project project = task.getProject();
        Object defaultInstanceObj = project.getReference("ivy.instance");
        if (defaultInstanceObj != null
                && defaultInstanceObj.getClass().getClassLoader() != IvyAntSettings.class
                        .getClassLoader()) {
            task.log("ivy.instance reference an ivy:settings defined in an other classloader.  "
                    + "An new default one will be used in this project.", Project.MSG_WARN);
            defaultInstanceObj = null;
        }
        if (defaultInstanceObj != null && !(defaultInstanceObj instanceof IvyAntSettings)) {
            throw new BuildException("ivy.instance reference a "
                    + defaultInstanceObj.getClass().getName()
                    + " an not an IvyAntSettings.  Please don't use this reference id ()");
        }
        if (defaultInstanceObj == null) {
            task.log("No ivy:settings found for the default reference 'ivy.instance'.  "
                    + "A default instance will be used", Project.MSG_VERBOSE);

            IvyAntSettings settings = new IvyAntSettings();
            settings.setProject(project);
            project.addReference("ivy.instance", settings);
            settings.createIvyEngine(task);
            return settings;
        } else {
            return (IvyAntSettings) defaultInstanceObj;
        }
View Full Code Here

    private Project project;

    protected void setUp() throws Exception {
        createCache();
        project = new Project();
        project.setProperty("ivy.settings.file", "test/repositories/ivysettings.xml");

        path = new IvyCachePath();
        path.setProject(project);
        System.setProperty("ivy.cache.dir", cache.getAbsolutePath());
View Full Code Here

    public Ivy getConfiguredIvyInstance(Task task) {
        return getConfiguredIvyInstance((ProjectComponent) task);
    }

    void createIvyEngine(final ProjectComponent task) {
        Project project = task.getProject();
        Property prop = new Property() {
            public void execute() throws BuildException {
                addProperties(getDefaultProperties(task));
            }
        };
        prop.setProject(project);
        prop.init();
        prop.execute();

        IvyAntVariableContainer ivyAntVariableContainer = new IvyAntVariableContainer(project);
        IvySettings settings = new IvySettings(ivyAntVariableContainer);
        settings.setBaseDir(project.getBaseDir());

        if (file == null && url == null) {
            defineDefaultSettingFile(ivyAntVariableContainer, task);
        }
View Full Code Here

        cleanCache();
    }

    private void cleanCache() {
        Delete del = new Delete();
        del.setProject(new Project());
        del.setDir(cache);
        del.execute();
    }
View Full Code Here

        assertEquals(getArchiveFileInCache("org1", "mod1.2", "2.0", "mod1.2", "jar", "jar")
                .getAbsolutePath(), new File(p.list()[0]).getAbsolutePath());
    }

    public void testWithResolveIdWithoutResolve() throws Exception {
        Project otherProject = new Project();
        otherProject.setProperty("ivy.settings.file", "test/repositories/ivysettings.xml");

        IvyResolve resolve = new IvyResolve();
        resolve.setProject(otherProject);
        resolve.setFile(new File("test/java/org/apache/ivy/ant/ivy-simple.xml"));
        resolve.setResolveId("withResolveId");
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.Project

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.