After doing a complex build of a multi-module project in IntelliJ, somehow several 0-length files get generated or created somehow. I want to debug the build process and set a conditional breakpoint whenever a file is created with a specific name. Is there a way to do that?
I tried setting a breakpoint in the File() constructors, but apparently these zero-length files get created without creating a File class instance, because my conditional breakpoint is never hit. I also tried a breakpoint in File#createNewFile(), but it was never hit.
I even tried creating directories with the names of the 0-length files, so that attempting to create them as files would fail. After the build, those remained directories, and no exceptions or errors occurred during the build.
This seems like it ought to be possible. There is too much IntelliJ code and Gradle code and my own application's code to look through and guess where these zero-length files are being created.
I think maybe an external static util class create the file, so even you set a breakpoint in
Filebut never hit it.Some debug advices in this situation:
20240125.txt, then search something likeDate+".txt"Interceptor, check the folder size or file name all the time, if the new file appears then hit it.