Package org.gradle.internal.component.model

Examples of org.gradle.internal.component.model.IvyArtifactName


    public ArtifactIdentifier toArtifactIdentifier() {
        return new DefaultArtifactIdentifier(id);
    }

    public Artifact toIvyArtifact() {
        IvyArtifactName ivyArtifactName = id.getName();
        return new DefaultArtifact(IvyUtil.createModuleRevisionId(id.getComponentIdentifier()), null, ivyArtifactName.getName(), ivyArtifactName.getType(), ivyArtifactName.getExtension(), ivyArtifactName.getAttributes());
    }
View Full Code Here


    private final MapSerializer<String, String> attributesSerializer = new MapSerializer<String, String>(STRING_SERIALIZER, STRING_SERIALIZER);

    public void write(Encoder encoder, ModuleComponentArtifactIdentifier value) throws Exception {
        DefaultModuleComponentArtifactIdentifier artifact = (DefaultModuleComponentArtifactIdentifier) value;
        componentIdentifierSerializer.write(encoder, artifact.getComponentIdentifier());
        IvyArtifactName ivyArtifactName = artifact.getName();
        encoder.writeString(ivyArtifactName.getName());
        encoder.writeString(ivyArtifactName.getType());
        encoder.writeNullableString(ivyArtifactName.getExtension());
        attributesSerializer.write(encoder, ivyArtifactName.getAttributes());
    }
View Full Code Here

    public void addArtifacts(MutableLocalComponentMetaData metaData, Iterable<? extends Configuration> configurations) {
        ModuleVersionIdentifier id = metaData.getId();
        for (Configuration configuration : configurations) {
            for (PublishArtifact publishArtifact : configuration.getArtifacts()) {
                IvyArtifactName ivyArtifact = createIvyArtifact(publishArtifact, id);
                metaData.addArtifact(configuration.getName(), ivyArtifact, publishArtifact.getFile());
            }
        }
    }
View Full Code Here

    private ResolvedArtifact createArtifact(String name) {
        return createResolvedArtifact(context, name, "someType", "someExt", new File("pathTo" + name));
    }

    public static DefaultResolvedArtifact createResolvedArtifact(final Mockery context, final String name, final String type, final String extension, final File file) {
        final IvyArtifactName artifactStub = context.mock(IvyArtifactName.class, "artifact" + name);
        context.checking(new Expectations() {{
            allowing(artifactStub).getName();
            will(returnValue(name));
            allowing(artifactStub).getType();
            will(returnValue(type));
View Full Code Here

            });
            checkErrors();
            checkConfigurations();
            replaceConfigurationWildcards();
            if (!artifactsDeclared) {
                IvyArtifactName implicitArtifact = new DefaultIvyArtifactName(getMd().getModuleRevisionId().getName(), "jar", "jar");
                Set<String> configurationNames = Sets.newHashSet(getMd().getConfigurationsNames());
                metaData.addArtifact(implicitArtifact, configurationNames);
            }
            checkErrors();
            getMd().check();
View Full Code Here

TOP

Related Classes of org.gradle.internal.component.model.IvyArtifactName

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.