Skip to content

Commit

Permalink
Avoid deprecation warning from GitPublishReset
Browse files Browse the repository at this point in the history
This is to resolve the second location affected by #64. This was missed
in the first pass at fixing it.
  • Loading branch information
ajoberstar committed Mar 25, 2019
1 parent 212884c commit 10cac9c
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.gradle.api.tasks.OutputDirectory;
import org.gradle.api.tasks.TaskAction;
import org.gradle.api.tasks.util.PatternFilterable;
import org.gradle.util.GradleVersion;

public class GitPublishReset extends DefaultTask {
private final Property<Grgit> grgit;
Expand All @@ -40,7 +41,11 @@ public class GitPublishReset extends DefaultTask {
@Inject
public GitPublishReset(ProjectLayout layout, ObjectFactory objectFactory) {
this.grgit = objectFactory.property(Grgit.class);
this.repoDirectory = layout.directoryProperty();
if (GradleVersion.current().compareTo(GradleVersion.version("5.0")) >= 0) {
this.repoDirectory = getProject().getObjects().directoryProperty();
} else {
this.repoDirectory = getProject().getLayout().directoryProperty();
}
this.repoUri = objectFactory.property(String.class);
this.referenceRepoUri = objectFactory.property(String.class);
this.branch = objectFactory.property(String.class);
Expand Down

0 comments on commit 10cac9c

Please sign in to comment.