Skip to content
This repository was archived by the owner on Feb 11, 2022. It is now read-only.

Commit 8f1b80f

Browse files
author
Xavi Rigau
authored
Merge pull request #143 from novoda/update-gradle-4.2
Upgrade to the latest gradle version (4.2.1)
2 parents e1eca2c + 42c402d commit 8f1b80f

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ allprojects {
55
google()
66
jcenter()
77
}
8-
version = "0.6.1"
8+
version = "0.7.0"
99
}

core/src/main/groovy/com/novoda/gradle/release/AndroidLibrary.groovy

+14-6
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,25 @@ import org.gradle.api.attributes.Usage
99
import org.gradle.api.internal.DefaultDomainObjectSet
1010
import org.gradle.api.internal.component.SoftwareComponentInternal
1111
import org.gradle.api.internal.component.UsageContext
12+
import org.gradle.api.model.ObjectFactory
1213

1314
class AndroidLibrary implements SoftwareComponentInternal {
1415

1516
private final UsageContext runtimeUsage
1617

1718
public static AndroidLibrary newInstance(Project project) {
19+
20+
ObjectFactory objectFactory = project.getObjects();
21+
Usage usage = objectFactory.named(Usage.class, Usage.JAVA_RUNTIME);
22+
23+
1824
def configuration = project.configurations.getByName("compile")
19-
return configuration ? from(configuration) : empty()
25+
return configuration ? from(configuration, usage) : empty()
2026
}
2127

22-
static AndroidLibrary from(def configuration) {
23-
def usage = new RuntimeUsage(configuration.dependencies)
24-
new AndroidLibrary(usage)
28+
static AndroidLibrary from(def configuration, Usage usage) {
29+
def runtimeUsage = new RuntimeUsage(configuration.dependencies, usage)
30+
new AndroidLibrary(runtimeUsage)
2531
}
2632

2733
static AndroidLibrary empty() {
@@ -44,13 +50,15 @@ class AndroidLibrary implements SoftwareComponentInternal {
4450
private static class RuntimeUsage implements UsageContext {
4551

4652
private final DomainObjectSet<Dependency> runtimeDependencies
53+
private final Usage usage;
4754

48-
RuntimeUsage(DomainObjectSet<Dependency> runtimeDependencies) {
55+
RuntimeUsage(DomainObjectSet<Dependency> runtimeDependencies, Usage usage) {
56+
this.usage = usage;
4957
this.runtimeDependencies = runtimeDependencies
5058
}
5159

5260
Usage getUsage() {
53-
return Usage.FOR_RUNTIME
61+
return usage;
5462
}
5563

5664
public Set<PublishArtifact> getArtifacts() {

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.2.1-all.zip

0 commit comments

Comments
 (0)