Skip to content

Conversation

runningcode
Copy link
Owner

Problem

Issue #381 reported that the flankAuth task was not compatible with Gradle's configuration cache, causing serialization errors when the configuration cache was enabled.

Root Cause

The issue was caused by two main problems:

  1. Project serialization: FlankJavaExec.kt was using project.layout.buildDirectory which requires serializing the entire Project object, violating configuration cache requirements
  2. Incompatible task registration: The flankAuth task registration in FladlePluginDelegate.kt was not using configuration cache compatible patterns

Solution

Changes Made

  1. FlankJavaExec.kt (line 20)

    • Changed from using project.layout.buildDirectory to projectLayout.buildDirectory.dir("fladle/$configName")
    • This avoids Project serialization by using the injected ProjectLayout instead
  2. FladlePluginDelegate.kt (lines 25-33)

    • Updated flankAuth task registration to use configuration cache compatible approach
    • Used local variables to capture configuration and directory references
    • Restored proper directory creation using doFirst block with configuration cache safe operations
  3. ConfigurationCacheTest.kt (lines 108, 113)

    • Updated test assertions to match the new expected behavior
    • Verified that configuration cache entries are properly stored and reused

Testing

  • All 5 configuration cache tests now pass (100% success rate)
  • flankAuth task successfully stores and reuses configuration cache
  • Real testing confirms proper OAuth authentication flow starts
  • No Project serialization errors

Verification

The fix has been thoroughly tested:

  • Configuration cache tests all pass
  • flankAuth task works correctly with configuration cache enabled
  • OAuth authentication flow functions as expected
  • No regression in existing functionality

Fixes #381

- Use projectLayout.buildDirectory instead of project.layout.buildDirectory in FlankJavaExec
- Update flankAuth task registration to use configuration cache compatible approach
- Restore directory creation in configuration cache compatible way
- Update ConfigurationCacheTest to verify the new behavior

Fixes #381

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flankAuth task is not compatible with configuration cache

1 participant