Skip to content

Delayed writing of results to build/.../fileStates.txt #35

Description

@danwallach

I'm building an autograder for my class, and I'm planning to use your tool to ensure students' code is properly formatted. My problem is that I need to parse fileStates.txt so I can give a summary in the autograder (e.g., "8/9 files are formatted; run gradle googleJavaFormat to fix this"). So far as I can tell, here's your relevant code:

    private FileInfoStore setupFileStore(FileInfoStore store, FileToStateMapper mapper) {
        project.gradle.buildFinished {
            try {
                store.update(mapper)
            } catch (IOException e) {
                project.getLogger().error("Failed to write formatting states to disk", e)
            } finally {
                store.close()
            }
        }
        return store
    }

I think my problem is that you're delaying the write until the build finishes, and I need this information as part of the same build. I'm not an expert on the guts of Gradle, but I think you want to do this after the project is finished, or just right away, rather than waiting until the entire build has finished.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions