Skip to content

Commit

Permalink
release 0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
jk1 committed Mar 5, 2017
1 parent c6ec6d3 commit 7f90d2c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The plugin makes use of default artifact cache, downloading each dependency only
```groovy
// Gradle 3.1+
plugins {
id 'com.github.jk1.tcdeps' version '0.11'
id 'com.github.jk1.tcdeps' version '0.12'
}
// Gradle 3.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class RestClient {
int code = -1 // non-http error, e.g. TLS
String body = "No response recorded. Rerun with --stacktrace to see an exception."

public isOk() {
boolean isOk() {
return (200..<300).contains(code)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.github.jk1.tcdeps.processing

import com.github.jk1.tcdeps.util.ResourceLocator
import org.gradle.api.Project
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.DependencyArtifact
Expand All @@ -13,21 +14,21 @@ import org.gradle.internal.component.external.descriptor.Artifact
import org.gradle.ivy.IvyDescriptorArtifact
import org.gradle.ivy.IvyModule

import static com.github.jk1.tcdeps.util.ResourceLocator.getLogger
import static com.github.jk1.tcdeps.util.ResourceLocator.getProject
import static com.github.jk1.tcdeps.util.ResourceLocator.logger
import static com.github.jk1.tcdeps.util.ResourceLocator.project

class ArtifactRegexResolver {

def process() {
try {
// make configuration resolution as lazy, as possible
project.configurations.findAll { it.state != Configuration.State.UNRESOLVED }.each { configuration ->
project.logger.debug("Post-processing dependency configuration $configuration")
resolveArtifacts(configuration)
}
def capturedProject = project
project.configurations.findAll { it.state == Configuration.State.UNRESOLVED }.each { configuration ->
configuration.incoming.beforeResolve {
project.logger.debug("Post-processing dependency configuration $configuration")
ResourceLocator.setContext(capturedProject)
resolveArtifacts(configuration)
}
}
Expand All @@ -43,7 +44,7 @@ class ArtifactRegexResolver {
}

def resolveArtifacts(Configuration configuration) {
logger.debug("processing $project, $configuration")
logger.debug("Processing $project, $configuration")

def ivyDescriptors = getIvyDescriptorsForConfiguration(configuration.copy())

Expand Down
8 changes: 4 additions & 4 deletions src/main/groovy/com.github.jk1.tcdeps/util/LogFacade.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ class LogFacade {

private static final PREFIX = '[TCdeps]'

public debug(message) {
def debug(message) {
ResourceLocator.project.logger.debug("$PREFIX $message")
}

public info(message) {
def info(message) {
ResourceLocator.project.logger.info("$PREFIX $message")
}

public warn(message) {
def warn(message) {
ResourceLocator.project.logger.warn("$PREFIX $message")
}

public warn(message, exception) {
def warn(message, exception) {
ResourceLocator.project.logger.warn("$PREFIX $message", exception)
}
}

0 comments on commit 7f90d2c

Please sign in to comment.