Skip to content

Commit

Permalink
Add support for creating extra dependency caches (#411)
Browse files Browse the repository at this point in the history
  • Loading branch information
kageiit committed Mar 18, 2017
1 parent 910c27e commit a1616d5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class OkBuckGradlePlugin implements Plugin<Project> {
public static final String WRAPPER = "wrapper"
public static final String BUCK_WRAPPER = "buckWrapper"
public static final String DEFAULT_CACHE_PATH = ".okbuck/cache"
public static final String EXTRA_DEP_CACHE_PATH = ".okbuck/cache/extra"
public static final String GROUP = "okbuck"
public static final String BUCK_LINT = "buckLint"
public static final String BUCK_LINT_LIBRARY = "buckLintLibrary"
Expand Down Expand Up @@ -157,6 +158,13 @@ class OkBuckGradlePlugin implements Plugin<Project> {
if (test.robolectric) {
RobolectricUtil.download(project)
}

// Create extra dependency caches if needed
okbuckExt.extraDepCaches.each { String cacheName ->
Configuration extraConfiguration = project.configurations.maybeCreate("${cacheName}ExtraDepCache")
new DependencyCache(cacheName, project, "${EXTRA_DEP_CACHE_PATH}/${cacheName}",
Collections.singleton(extraConfiguration))
}
}

// Configure okbuck task
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ public class OkBuckExtension {
*/
public boolean resourceUnion = true;

/**
* Additional dependency caches.
* Every entry will create a new configuration "entryDepCache"
* that can be used to fetch and cache dependencies.
*/
public Set<String> extraDepCaches = new HashSet<>();

public OkBuckExtension(Project project) {
buckProjects = project.getSubprojects();
}
Expand Down

0 comments on commit a1616d5

Please sign in to comment.