Skip to content

Commit

Permalink
Don't resolve configurations in config phase.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnrengelman committed Jun 23, 2016
1 parent 708b5dc commit 5013695
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.github.jengelman.gradle.plugins.shadow.internal;

import org.gradle.api.artifacts.Configuration;
import org.gradle.api.internal.file.AbstractFileCollection;

import java.io.File;
import java.util.List;
import java.util.Set;

public class DependencyFileCollection extends AbstractFileCollection {

private final DependencyFilter filter;
private final List<Configuration> configurations;

public DependencyFileCollection(DependencyFilter filter, List<Configuration> configurations) {
this.filter = filter;
this.configurations = configurations;
}

@Override
public String getDisplayName() {
return "Shadow Dependencies to Merge";
}

@Override
public Set<File> getFiles() {
return filter.resolve(configurations).getFiles();
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package com.github.jengelman.gradle.plugins.shadow.tasks;

import com.github.jengelman.gradle.plugins.shadow.ShadowStats;
import com.github.jengelman.gradle.plugins.shadow.internal.DefaultDependencyFilter;
import com.github.jengelman.gradle.plugins.shadow.internal.DependencyFilter;
import com.github.jengelman.gradle.plugins.shadow.internal.GradleVersionUtil;
import com.github.jengelman.gradle.plugins.shadow.internal.ZipCompressor;
import com.github.jengelman.gradle.plugins.shadow.internal.*;
import com.github.jengelman.gradle.plugins.shadow.relocation.Relocator;
import com.github.jengelman.gradle.plugins.shadow.relocation.SimpleRelocator;
import com.github.jengelman.gradle.plugins.shadow.transformers.AppendingTransformer;
Expand All @@ -19,7 +16,6 @@
import org.gradle.api.internal.DocumentationRegistry;
import org.gradle.api.internal.file.FileResolver;
import org.gradle.api.internal.file.copy.CopyAction;
import org.gradle.api.java.archives.Manifest;
import org.gradle.api.tasks.InputFiles;
import org.gradle.api.tasks.Optional;
import org.gradle.api.tasks.TaskAction;
Expand Down Expand Up @@ -73,7 +69,7 @@ protected void copy() {

@InputFiles @Optional
public FileCollection getIncludedDependencies() {
return dependencyFilter.resolve(configurations);
return new DependencyFileCollection(dependencyFilter, configurations);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/shadow-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.3
1.3.0-SNAPSHOT

0 comments on commit 5013695

Please sign in to comment.