Examples of Ivy


Examples of fr.jayasoft.ivy.Ivy

  }

  public void execute()
    throws BuildException {

    Ivy ivy = new Ivy();
    DependencyResolver resolver = null;
    Repository rep = null;
   
    if (repositoryUrl != null) {
      resolver = new URLResolver();
      ((URLResolver)resolver).addArtifactPattern(
          repositoryUrl + "/" + artifactPattern
          );
      ((URLResolver)resolver).addIvyPattern(
          repositoryUrl + "/" + ivyPattern
          );
      resolver.setName("default");
    }
    else if (repositoryDir != null) {
      resolver = new FileSystemResolver();
      ((FileSystemResolver)resolver).addArtifactPattern(
          repositoryDir + "/" + artifactPattern
          );
      ((FileSystemResolver)resolver).addIvyPattern(
          repositoryDir + "/" + ivyPattern
          );
    }
    else if (ivyConfUrl != null) {
      try {
        ivy.configure(ivyConfUrl);
      }
      catch (IOException e) {
        throw new BuildException(e);
      }
      catch (ParseException e) {
        throw new BuildException(e);
      }
    }
    else if (ivyConfFile != null) {
      try {
        ivy.configure(ivyConfFile);
      }
      catch (IOException e) {
        throw new BuildException(e);
      }
      catch (ParseException e) {
        throw new BuildException(e);
      }
    }
    else {
      resolver = new IvyRepResolver();
    }
    resolver.setName("default");
    ivy.addResolver(resolver);
    ivy.setDefaultResolver(resolver.getName());
   
    ModuleId moduleId =
      new ModuleId(org, module);   
    ModuleRevisionId revId =
      new ModuleRevisionId(moduleId, rev);
    ModuleDescriptor md =
      new DefaultModuleDescriptor(revId, "integration", new Date());   
    Artifact artifact =
      new MDArtifact(md, module, type, type);
   
    ArtifactDownloadReport report =
      ivy.download(artifact, null);
   
    DownloadStatus status = report.getDownloadStatus();
    if (status == DownloadStatus.FAILED) {
      throw new BuildException("Could not resolve resource.");
    }
   
    String path = ivy.getArchivePathInCache(artifact);
   
    File file = new File(ivy.getDefaultCache(), path);
   
    File importFile = null;
   
      if ("xml".equalsIgnoreCase(type)) {
        importFile = file;
View Full Code Here

Examples of org.apache.ivy.Ivy

        }});
    }

    private Ivy setUpIvyFactory(final IvySettings ivySettingsDummy, DefaultIvyService ivyService) {
        final IvyFactory ivyFactoryStub = context.mock(IvyFactory.class);
        final Ivy ivyStub = context.mock(Ivy.class);
        context.checking(new Expectations() {{
            allowing(ivyFactoryStub).createIvy(ivySettingsDummy);
            will(returnValue(ivyStub));

            allowing(ivyStub).getSettings();
View Full Code Here

Examples of org.apache.ivy.Ivy

    public IvyDependencyPublisher getDependencyPublisher() {
        return dependencyPublisher;
    }

    public ResolvedConfiguration resolve(final Configuration configuration) {
        Ivy ivy = ivyForResolve(resolverProvider.getResolvers(), metaDataProvider.getGradleUserHomeDir(),
                clientModuleRegistry);
        ModuleDescriptor moduleDescriptor = resolveModuleDescriptorConverter.convert(configuration.getAll(),
                metaDataProvider.getModule(), ivy.getSettings());
        return dependencyResolver.resolve(configuration, ivy, moduleDescriptor);
    }
View Full Code Here

Examples of org.apache.ivy.Ivy

        return dependencyResolver.resolve(configuration, ivy, moduleDescriptor);
    }

    public void publish(Set<Configuration> configurationsToPublish, File descriptorDestination,
                        List<DependencyResolver> publishResolvers) {
        Ivy ivy = ivyForPublish(publishResolvers, metaDataProvider.getGradleUserHomeDir());
        Set<String> confs = Configurations.getNames(configurationsToPublish, false);
        writeDescriptorFile(descriptorDestination, configurationsToPublish, ivy.getSettings());
        dependencyPublisher.publish(
                confs,
                publishResolvers,
                publishModuleDescriptorConverter.convert(configurationsToPublish, metaDataProvider.getModule(), ivy.getSettings()),
                descriptorDestination,
                ivy.getPublishEngine());
    }
View Full Code Here

Examples of org.apache.ivy.Ivy

        final Configuration configurationDummy = context.mock(Configuration.class);
        final Set<Configuration> configurations = WrapUtil.toSet(configurationDummy);
        final ResolvedConfiguration resolvedConfiguration = context.mock(ResolvedConfiguration.class);
        final ModuleDescriptor moduleDescriptorDummy = HelperUtil.createModuleDescriptor(WrapUtil.toSet("someConf"));
        final IvyFactory ivyFactoryStub = context.mock(IvyFactory.class);
        final Ivy ivyStub = context.mock(Ivy.class);
        final IvySettings ivySettingsDummy = new IvySettings();

        context.checking(new Expectations() {{
            allowing(ivyFactoryStub).createIvy(ivySettingsDummy);
            will(returnValue(ivyStub));
View Full Code Here

Examples of org.apache.ivy.Ivy

*/
public class DefaultIvyFactoryTest {
    @Test
    public void testCreateIvy() {
        IvySettings ivySettings = new IvySettings();
        Ivy ivy = new DefaultIvyFactory().createIvy(ivySettings);
        assertThat(ivy, notNullValue());
        assertThat(ivy.getSettings(), equalTo(ivySettings));
    }
View Full Code Here

Examples of org.apache.ivy.Ivy

        ModuleDescriptor parseDescriptor(URL projectURL) throws ParseException,
            IOException
        {
            if (defaultSettings == null)
            {
                Ivy ivy = IvyContext.getContext().peekIvy();
                if (ivy == null)
                    throw new IllegalStateException(
                        "can't get default settings - no ivy context.");
                defaultSettings = ivy.getSettings();
            }

            URL ivyURL = new URL(projectURL, ivyFile);
            String cacheKey = ivyURL.toString() + defaultSettings.hashCode();
            DefaultModuleDescriptor dmd = rawCache.get(cacheKey);
View Full Code Here

Examples of org.apache.ivy.Ivy

         */
        private IBldResolver findResolver()
        {
            if (resolver == null)
            {
                Ivy ivy = IvyContext.getContext().peekIvy();
                if (ivy != null)
                {
                    if (resolverName != null)
                    {
                        DependencyResolver r = ivy.getSettings().getResolver(resolverName);
                        if (r == null)
                        {
                            throw new Error("SigilParser: resolver \"" + resolverName
                                + "\" not defined.");
                        }
                        else if (r instanceof IBldResolver)
                        {
                            resolver = (IBldResolver) r;
                        }
                        else
                        {
                            throw new Error("SigilParser: resolver \"" + resolverName
                                + "\" is not a SigilResolver.");
                        }
                    }
                    else
                    {
                        for (Object r : ivy.getSettings().getResolvers())
                        {
                            if (r instanceof IBldResolver)
                            {
                                resolver = (IBldResolver) r;
                                break;
View Full Code Here

Examples of org.apache.ivy.Ivy

    private Ivy ivy;

    private File _cache;

    protected void setUp() throws Exception {
        ivy = new Ivy();
        ivy.configure(RegexpConflictManagerTest.class.getResource("ivysettings-regexp-test.xml"));
        _cache = new File("build/cache");
        _cache.mkdirs();
    }
View Full Code Here

Examples of org.apache.ivy.Ivy

    protected void tearDown() throws Exception {
        fixture.clean();
    }

    public void testInitFromSettings() throws Exception {
        Ivy ivy = new Ivy();
        ivy.configure(LatestCompatibleConflictManagerTest.class
                .getResource("ivysettings-latest-compatible.xml"));
        ConflictManager cm = ivy.getSettings().getDefaultConflictManager();
        assertTrue(cm instanceof LatestCompatibleConflictManager);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.