Skip to content

Commit

Permalink
#26 gradle 3.5 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jk1 committed Apr 24, 2017
1 parent 610816d commit ea1344c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ The plugin makes use of default artifact cache, downloading each dependency only
###Simple example

```groovy
// Gradle 3.1+
// Gradle 3.5+
plugins {
id 'com.github.jk1.tcdeps' version '0.13'
}
// Gradle 3.1-3.4
plugins {
id 'com.github.jk1.tcdeps' version '0.12'
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins{

group = 'com.github.jk1'
description = 'TeamCity dependencies plugin resolves project dependencies via local TeamCity server'
version = '0.12'
version = '0.13'
sourceCompatibility = 1.6
targetCompatibility = 1.6

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class TeamCityDependenciesPlugin implements Plugin<Project> {
def current = GradleVersion.current().version.split("\\.")
def major = current[0].toInteger()
def minor = current[1].split("-")[0].toInteger()
if (major < 3 || (major == 3 && minor < 1)) {
throw new GradleException("TeamCity dependencies plugin requires Gradle 3.1. ${GradleVersion.current()} detected.")
if (major < 3 || (major == 3 && minor < 5)) {
throw new GradleException("TeamCity dependencies plugin requires Gradle 3.5. ${GradleVersion.current()} detected.")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import org.gradle.api.artifacts.ModuleDependency
import org.gradle.api.artifacts.result.ComponentArtifactsResult
import org.gradle.api.artifacts.result.ResolvedArtifactResult
import org.gradle.api.artifacts.result.ResolvedDependencyResult
import org.gradle.api.internal.artifacts.DefaultImmutableModuleIdentifierFactory
import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.DisconnectedDescriptorParseContext
import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.DownloadedIvyModuleDescriptorParser
import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.IvyModuleDescriptorConverter
import org.gradle.internal.component.external.descriptor.Artifact
import org.gradle.ivy.IvyDescriptorArtifact
import org.gradle.ivy.IvyModule
Expand Down Expand Up @@ -98,7 +100,8 @@ class ArtifactRegexResolver {

private Set<Artifact> readArtifactsSet(File ivyFile, Project project) {
project.logger.debug("Parsing ivy file [$ivyFile]")
new DownloadedIvyModuleDescriptorParser()
def factory = new DefaultImmutableModuleIdentifierFactory()
new DownloadedIvyModuleDescriptorParser(new IvyModuleDescriptorConverter(factory), factory)
.parseMetaData(new DisconnectedDescriptorParseContext(), ivyFile)
.descriptor
.artifacts
Expand Down

0 comments on commit ea1344c

Please sign in to comment.