-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #611 from sourcegraph/olafurpg/no-relative-path
Add `-no-relative-path:` flag to control indexing of generated files
- Loading branch information
Showing
5 changed files
with
117 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
semanticdb-javac/src/main/java/com/sourcegraph/semanticdb_javac/NoRelativePathMode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.sourcegraph.semanticdb_javac; | ||
|
||
/** | ||
* Configuration options to determine how semanticdb-javac should handle files that have no good | ||
* relative paths. | ||
* | ||
* <p>When indexing a file at an absolute path /project/src/main/example/Foo.java, SemanticDB needs | ||
* to know the "sourceroot" path /project in order to relativize the path of the source file into | ||
* src/main/example/Foo.java. This configuration option determines what the compiler plugin should | ||
* do when it's not able to find a good relative path. | ||
*/ | ||
public enum NoRelativePathMode { | ||
|
||
/** | ||
* Come up with a unique relative path for the SemanticDB path with no guarantee that this path | ||
* corresponds to the original path of the generated source file. | ||
*/ | ||
INDEX_ANYWAY, | ||
|
||
/** Silently ignore the file, don't index it. */ | ||
SKIP, | ||
|
||
/** Report an error message and fail the compilation. */ | ||
ERROR, | ||
|
||
/** Ignore the file, but print a message explaining it's ignored. */ | ||
WARNING | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters