File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed 
src/main/kotlin/com/faire/gradle/analyze Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ plugins {
88
99allprojects {
1010  group =  " com.faire.gradle" 
11-   version =  " 1.0.7 " 
11+   version =  " 1.0.8 " 
1212
1313  repositories {
1414    mavenCentral()
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import org.gradle.api.tasks.CacheableTask
88import  org.gradle.api.tasks.Input 
99import  org.gradle.api.tasks.InputFile 
1010import  org.gradle.api.tasks.InputFiles 
11+ import  org.gradle.api.tasks.Optional 
1112import  org.gradle.api.tasks.OutputFile 
1213import  org.gradle.api.tasks.PathSensitive 
1314import  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
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments