Skip to content

Commit

Permalink
Fix more slashes
Browse files Browse the repository at this point in the history
  • Loading branch information
illicitonion committed May 3, 2024
1 parent ab743d5 commit a3f56ff
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions java/gazelle/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,18 @@ func (l javaLang) GenerateRules(args language.GenerateArgs) language.GenerateRes
}
allPackageNames.Add(mJavaPkg.Name)

mRelFilepath := filepath.FromSlash(mRel)
if !mJavaPkg.TestPackage {
addNonLocalImportsAndExports(productionJavaImports, nonLocalJavaExports, mJavaPkg.ImportedClasses, mJavaPkg.ImportedPackagesWithoutSpecificClasses, mJavaPkg.ExportedClasses, mJavaPkg.Name, javaClassNamesFromFileNames)
for _, f := range mJavaPkg.Files.SortedSlice() {
productionJavaFiles.Add(filepath.Join(mRel, f))
productionJavaFiles.Add(filepath.Join(mRelFilepath, f))
}
allMains.AddAll(mJavaPkg.Mains)
} else {
// Tests don't get to export things, as things shouldn't depend on them.
addNonLocalImportsAndExports(testJavaImports, nil, mJavaPkg.ImportedClasses, mJavaPkg.ImportedPackagesWithoutSpecificClasses, mJavaPkg.ExportedClasses, mJavaPkg.Name, javaClassNamesFromFileNames)
for _, f := range mJavaPkg.Files.SortedSlice() {
path := filepath.Join(mRel, f)
path := filepath.Join(mRelFilepath, f)
file := javaFile{
pathRelativeToBazelWorkspaceRoot: path,
pkg: mJavaPkg.Name,
Expand All @@ -163,7 +164,7 @@ func (l javaLang) GenerateRules(args language.GenerateArgs) language.GenerateRes
}
allMains.AddAll(javaPkg.Mains)
for _, f := range javaFilenamesRelativeToPackage {
path := filepath.Join(args.Rel, f)
path := filepath.Join(filepath.FromSlash(args.Rel), f)
if javaPkg.TestPackage {
file := javaFile{
pathRelativeToBazelWorkspaceRoot: path,
Expand Down

0 comments on commit a3f56ff

Please sign in to comment.