Skip to content

Support configuration-cache/isolated-project feature #344

Description

@ganadist

It looks Isolated Projects feature graduate experimental, soon and will promote as incubation stage.
gradle/gradle#38302

snyk gradle plugin (and cli) don't support configuration-cache/isolated-project feature, yet.

// Gradle 7 introduced configuration caching which we don't support yet
// If it is enabled in a gradle.properties file, it can be disabled on the command line with --no-configuration-cache
// It is enabled by default in Gradle 9.
// The regex matches Gradle 7, 8, 9 and any future two-digit versions (10, 11, etc.).
if (gradleVersion.match(/Gradle ([7-9]|\d{2,})/)) {
args.push('--no-configuration-cache');
}

By this block, snyk cli was failed on gradle project which is enabled Isolated Projects feature.

./gradlew     
           snykResolvedDepsJson -q --project-dir /some/where/projectDir -                                
           Pconfiguration=.*([Dd]ebug|[Rr]elease)(Compile|Runtime)Classpath$ -          
           Dorg.gradle.parallel= -Dorg.gradle.console=plain -PonlySubProject=app -I     
          /tmp-585-FzuNOJ9t3n3t--init.gradle --no-configuration-cache  


 FAILURE: Build failed with an exception.  
                                   
* What went wrong:                                                           
    Configuration Cache cannot be disabled when Isolated Projects is enabled. 

It is expected that this will make it difficult to use the Snyk CLI in large Gradle-based projects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions