Skip to content

Commit bc7e27e

Browse files
committed
Fixing issue with directories having no build file. V 1.0.7 -> 1.0.8
1 parent 0f80dd5 commit bc7e27e

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88

99
allprojects {
1010
group = "com.faire.gradle"
11-
version = "1.0.7"
11+
version = "1.0.8"
1212

1313
repositories {
1414
mavenCentral()

src/main/kotlin/com/faire/gradle/analyze/AnalyzeDependenciesTask.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import org.gradle.api.tasks.CacheableTask
88
import org.gradle.api.tasks.Input
99
import org.gradle.api.tasks.InputFile
1010
import org.gradle.api.tasks.InputFiles
11+
import org.gradle.api.tasks.Optional
1112
import org.gradle.api.tasks.OutputFile
1213
import org.gradle.api.tasks.PathSensitive
1314
import org.gradle.api.tasks.PathSensitivity
@@ -27,6 +28,16 @@ open class AnalyzeDependenciesTask : DefaultTask() {
2728

2829
// Using the buildFile as an input so that if you change any dependencies we invalidate analysis cache.
2930
@InputFile
31+
// Sometimes gradle thinks there is a project at a location with no build file. Use optional here to make sure
32+
// it doesn't fail in those cases. It would probably be better to figure out why this was happening, but there's
33+
// no time for that!
34+
// The situation I had was as follows
35+
// foo (no build file here)
36+
// foo/bar1 (has build file)
37+
// foo/bar2 (has build file)
38+
//
39+
// Running ./gradlew analyzeDependencies would fail at :foo:analyzeDependencies
40+
@Optional
3041
@PathSensitive(PathSensitivity.RELATIVE)
3142
var buildFile = project.buildFile
3243

0 commit comments

Comments
 (0)