Skip to content

Commit

Permalink
Use gradle files API instead of Java file API (#118)
Browse files Browse the repository at this point in the history
Fixes #118
  • Loading branch information
arunkumar9t2 committed Nov 9, 2023
1 parent baa9789 commit 37b50ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import org.gradle.api.tasks.PathSensitivity
import org.gradle.api.tasks.TaskAction
import org.gradle.api.tasks.TaskProvider
import org.gradle.kotlin.dsl.register
import java.io.File

@CacheableTask
abstract class ComputeWorkspaceDependenciesTask : DefaultTask() {
Expand Down Expand Up @@ -65,10 +64,7 @@ abstract class ComputeWorkspaceDependenciesTask : DefaultTask() {
val computeTask = rootProject.tasks
.register<ComputeWorkspaceDependenciesTask>(TASK_NAME) {
workspaceDependencies.set(
File(
rootProject.buildDir,
"grazel/mergedDependencies.json"
)
rootProject.layout.buildDirectory.file("grazel/mergedDependencies.json")
)
}
ResolveVariantDependenciesTask.register(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ import org.gradle.api.tasks.TaskAction
import org.gradle.api.tasks.TaskProvider
import org.gradle.kotlin.dsl.named
import org.gradle.kotlin.dsl.register
import java.io.File
import java.util.*
import java.util.TreeMap
import java.util.TreeSet
import kotlin.streams.asSequence

@CacheableTask
Expand Down Expand Up @@ -250,10 +250,9 @@ internal abstract class ResolveVariantDependenciesTask : DefaultTask() {

}

val resolvedDependenciesJson = File(
project.buildDir,
"grazel/${variant.name}/dependencies.json"
)
val resolvedDependenciesJson = project.layout
.buildDirectory
.file("grazel/${variant.name}/dependencies.json")

val resolveVariantDependenciesTask = project.tasks
.register<ResolveVariantDependenciesTask>(
Expand Down

0 comments on commit 37b50ed

Please sign in to comment.