Search in sources :

Example 1 with PublishArtifactLocalArtifactMetadata

use of org.gradle.internal.component.local.model.PublishArtifactLocalArtifactMetadata in project gradle by gradle.

the class EclipsePlugin method createArtifact.

private static LocalComponentArtifactMetadata createArtifact(String extension, ProjectComponentIdentifier projectId, String projectName, Project project) {
    File projectFile = new File(project.getProjectDir(), "." + extension);
    Task byName = project.getTasks().getByName("eclipseProject");
    String type = "eclipse." + extension;
    PublishArtifact publishArtifact = new DefaultPublishArtifact(projectName, extension, type, null, null, projectFile, byName);
    return new PublishArtifactLocalArtifactMetadata(projectId, publishArtifact);
}
Also used : Task(org.gradle.api.Task) DefaultPublishArtifact(org.gradle.api.internal.artifacts.publish.DefaultPublishArtifact) PublishArtifactLocalArtifactMetadata(org.gradle.internal.component.local.model.PublishArtifactLocalArtifactMetadata) DefaultPublishArtifact(org.gradle.api.internal.artifacts.publish.DefaultPublishArtifact) PublishArtifact(org.gradle.api.artifacts.PublishArtifact) File(java.io.File)

Example 2 with PublishArtifactLocalArtifactMetadata

use of org.gradle.internal.component.local.model.PublishArtifactLocalArtifactMetadata in project gradle by gradle.

the class IdeaPlugin method createImlArtifact.

private static LocalComponentArtifactMetadata createImlArtifact(ProjectComponentIdentifier projectId, Project project) {
    String moduleName = project.getExtensions().getByType(IdeaModel.class).getModule().getName();
    File imlFile = new File(project.getProjectDir(), moduleName + ".iml");
    Task byName = project.getTasks().getByName("ideaModule");
    PublishArtifact publishArtifact = new DefaultPublishArtifact(moduleName, "iml", "iml", null, null, imlFile, byName);
    return new PublishArtifactLocalArtifactMetadata(projectId, publishArtifact);
}
Also used : Task(org.gradle.api.Task) DefaultPublishArtifact(org.gradle.api.internal.artifacts.publish.DefaultPublishArtifact) PublishArtifactLocalArtifactMetadata(org.gradle.internal.component.local.model.PublishArtifactLocalArtifactMetadata) DefaultPublishArtifact(org.gradle.api.internal.artifacts.publish.DefaultPublishArtifact) PublishArtifact(org.gradle.api.artifacts.PublishArtifact) File(java.io.File)

Example 3 with PublishArtifactLocalArtifactMetadata

use of org.gradle.internal.component.local.model.PublishArtifactLocalArtifactMetadata in project gradle by gradle.

the class CompositeProjectComponentArtifactMetadataSerializer method read.

@Override
public CompositeProjectComponentArtifactMetadata read(Decoder decoder) throws Exception {
    ProjectComponentIdentifier componentIdentifier = (ProjectComponentIdentifier) componentIdentifierSerializer.read(decoder);
    PublishArtifactLocalArtifactMetadata delegate = publishArtifactLocalArtifactMetadataSerializer.read(decoder);
    File file = new File(decoder.readString());
    return new CompositeProjectComponentArtifactMetadata(componentIdentifier, delegate, file);
}
Also used : PublishArtifactLocalArtifactMetadata(org.gradle.internal.component.local.model.PublishArtifactLocalArtifactMetadata) ProjectComponentIdentifier(org.gradle.api.artifacts.component.ProjectComponentIdentifier) File(java.io.File)

Example 4 with PublishArtifactLocalArtifactMetadata

use of org.gradle.internal.component.local.model.PublishArtifactLocalArtifactMetadata in project gradle by gradle.

the class PublishArtifactLocalArtifactMetadataSerializer method read.

@Override
public PublishArtifactLocalArtifactMetadata read(Decoder decoder) throws Exception {
    ComponentIdentifier identifier = componentIdentifierSerializer.read(decoder);
    String artifactName = decoder.readString();
    String artifactExtension = decoder.readString();
    String artifactType = decoder.readString();
    String artifactClassifier = decoder.readNullableString();
    File artifactFile = new File(decoder.readString());
    return new PublishArtifactLocalArtifactMetadata(identifier, new ImmutablePublishArtifact(artifactName, artifactExtension, artifactType, artifactClassifier, artifactFile));
}
Also used : PublishArtifactLocalArtifactMetadata(org.gradle.internal.component.local.model.PublishArtifactLocalArtifactMetadata) ImmutablePublishArtifact(org.gradle.api.internal.artifacts.publish.ImmutablePublishArtifact) ComponentIdentifier(org.gradle.api.artifacts.component.ComponentIdentifier) File(java.io.File)

Aggregations

File (java.io.File)4 PublishArtifactLocalArtifactMetadata (org.gradle.internal.component.local.model.PublishArtifactLocalArtifactMetadata)4 Task (org.gradle.api.Task)2 PublishArtifact (org.gradle.api.artifacts.PublishArtifact)2 DefaultPublishArtifact (org.gradle.api.internal.artifacts.publish.DefaultPublishArtifact)2 ComponentIdentifier (org.gradle.api.artifacts.component.ComponentIdentifier)1 ProjectComponentIdentifier (org.gradle.api.artifacts.component.ProjectComponentIdentifier)1 ImmutablePublishArtifact (org.gradle.api.internal.artifacts.publish.ImmutablePublishArtifact)1