diff options
author | Jerome Dochez <jedo@google.com> | 2018-09-25 21:06:39 -0700 |
---|---|---|
committer | TreeHugger Robot <treehugger-gerrit@google.com> | 2018-09-26 22:14:28 +0000 |
commit | ed52ed7ac98d51e9d6ec04ee327828ed591fe567 (patch) | |
tree | 93962c0a022136d8f456e1a2badf695249681833 /extensions-support/library | |
parent | 007714939a839fe6b0d08c2e780d5ed7e9e13223 (diff) | |
download | data-binding-ed52ed7ac98d51e9d6ec04ee327828ed591fe567.tar.gz |
made custom transforms to be Gradle 5.0 compliant
2 custom transforms were using copy() APIs from
the implementation of ConfigurableFileTree which have
disapeared in 5.0.
Replaced with plain old JDK file copy facilities
Bug:N/A
Test: Existing
Change-Id: I15715685210f77102f7148dfc5191a6b0a8dce1a
Diffstat (limited to 'extensions-support/library')
-rw-r--r-- | extensions-support/library/build.gradle | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/extensions-support/library/build.gradle b/extensions-support/library/build.gradle index b3d4d6e9..7624606a 100644 --- a/extensions-support/library/build.gradle +++ b/extensions-support/library/build.gradle @@ -13,6 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import java.nio.file.StandardCopyOption; +import java.nio.file.Files; + import com.android.build.api.transform.Format; import com.android.build.api.transform.QualifiedContent; import com.android.build.api.transform.QualifiedContent.ContentType; @@ -143,8 +146,12 @@ class ExcludeShimTransform extends Transform { tree.include '**/*.class' tree.exclude 'android/databinding/DataBindingComponent.*' tree.exclude 'android/databinding/DataBinderMapperImpl.*' - tree.copy { - into outputDir + java.nio.file.Path sourcePath = it.getFile().toPath() + java.nio.file.Path outputPath = outputDir.toPath() + tree.each { file -> + java.nio.file.Path fileOutputPath = outputPath.resolve(sourcePath.relativize(file.toPath())) + fileOutputPath.toFile().getParentFile().mkdirs() + Files.copy(file.toPath(), fileOutputPath , StandardCopyOption.REPLACE_EXISTING) } } } |