Protobuf/Gradle Case Sensitivity Issue on macOS - class x is public should be declared in a file named x.java
#14.555 aperta il 30 ott 2023
Metriche repository
- Star
- (71.223 star)
- Metriche merge PR
- (Merge medio 2g 11h) (185 PR mergiate in 30 g)
Descrizione
I encountered an issue with Protobuf and Gradle on macOS, which I believe may be related to case sensitivity of file names. When using two Protobuf message types, ChecklistItemMsg and CheckListItemMsg, where the only difference is the letter 'L' case, the Gradle build process fails on macOS but works fine on Linux.
message ChecklistItemMsg {
}
message CheckListItemMsg {
}
error: class ChecklistItemMsg is public, should be declared in a file named ChecklistItemMsg.java public final class ChecklistItemMsg extends ^
Expected Behavior: I expected that the Gradle build process would generate two Java files, one for each of the .proto files. Specifically, it should generate ChecklistItemMsg.java and CheckListItemMsg.java.
Actual Behavior: However, on macOS, the build process only generates one of the expected files (e.g., CheckListItemMsg.java), while the other file (ChecklistItemMsg.java) is missing. This results in a build error because the missing file is referenced in the code.
Platform Information:
- Laptop: Macbook Pro with M2 chip
- Operating System: macOS [Version]
- Development Environment: IntelliJ IDEA 2023.2.4
- Java Version: OpenJDK 17
- Protobuf Version: 3.x
- Gradle: Embedded with the IDE
Additional Information:
- I've verified that the issue is specific to macOS as the build process works as expected on a Linux system.
- I had to change the name of one of the messages to resolve the issue, which is not an ideal solution.
- It appears that the issue is related to the case sensitivity of file names in the macOS file system.