Skip to content
This repository has been archived by the owner on Jul 17, 2022. It is now read-only.

Fix deprecation warning "The DefaultSourceDirectorySet constructor has been deprecated" #53

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: groovy
jdk:
- oraclejdk8
- openjdk8
install: ./gradlew resolveAllDependencies test
before_script:
- "echo $JAVA_OPTS"
Expand Down
20 changes: 14 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "com.gradle.plugin-publish" version "0.9.4"
id "com.jfrog.bintray" version "1.6"
id "com.gradle.plugin-publish" version "0.10.1"
id "com.jfrog.bintray" version "1.8.4"
}

apply plugin: 'groovy'
Expand All @@ -10,8 +10,8 @@ apply plugin: 'signing'
apply plugin: 'idea'
apply plugin: 'jacoco'

sourceCompatibility = 1.6
targetCompatibility = 1.6
sourceCompatibility = 1.7
targetCompatibility = 1.7

defaultTasks 'clean', 'build'

Expand Down Expand Up @@ -225,6 +225,14 @@ def getPomConfiguration() {
// download dependencies all at once, keeps downloads out of travis output
task resolveAllDependencies {
doLast {
configurations.all { it.resolve() }
configurations.all { configuration ->
if (configuration.isCanBeResolved()) {
println "Resolving $configuration"
configuration.resolve()
}
else {
println "$configuration is not resolvable"
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ class DefaultCssSourceSet implements CssSourceSet {
DefaultCssSourceSet(String name, Project project, Instantiator instantiator, FileResolver fileResolver) {
this.name = name
this.displayName = GUtil.toWords(name)
if (GradleVersion.current().compareTo(GradleVersion.version("2.12")) >= 0) {
if (GradleVersion.current().compareTo(GradleVersion.version("5.0")) >= 0) {
this.css = project.objects.sourceDirectorySet(name, String.format("%s CSS source", displayName))
} else if (GradleVersion.current().compareTo(GradleVersion.version("2.12")) >= 0) {
Class fileTreeFactory = Class.forName("org.gradle.api.internal.file.collections.DefaultDirectoryFileTreeFactory")
def directoryFileTreeFactory = fileTreeFactory.getConstructor().newInstance()
this.css = new DefaultSourceDirectorySet(name, String.format("%s CSS source", displayName), fileResolver, directoryFileTreeFactory)
Expand Down