mirror of
https://gitee.com/zhangsken/AndroidIDE.git
synced 2026-10-16 07:49:44 +08:00
feat: ignore 'package-info' when indexing sources and libraries
This commit is contained in:
Binary file not shown.
+2
-2
@@ -166,9 +166,9 @@ public class SourceFileManager extends ForwardingJavaFileManager<JavacFileManage
|
||||
String className = removeExtension(source.path.getFileName().toString());
|
||||
if (!packageName.isEmpty()) className = packageName + "." + className;
|
||||
return className;
|
||||
} else {
|
||||
return super.inferBinaryName(location, file);
|
||||
}
|
||||
|
||||
return super.inferBinaryName(location, file);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -31,7 +31,8 @@ public class DocumentUtils {
|
||||
return name.endsWith(".java")
|
||||
&& Files.exists(file)
|
||||
&& !Files.isDirectory(file)
|
||||
&& !name.equals("module-info.java");
|
||||
&& !name.equals("module-info.java")
|
||||
&& !name.equals("package-info.java");
|
||||
}
|
||||
|
||||
public static boolean isXmlFile(Path file) {
|
||||
|
||||
@@ -55,10 +55,6 @@ abstract class ModuleProject(
|
||||
private val log = ILogger.newInstance(javaClass.simpleName)
|
||||
|
||||
companion object {
|
||||
const val PROP_USAGE = "org.gradle.usage"
|
||||
const val USAGE_API = "java-api"
|
||||
const val USAGE_RUNTIME = "java-runtime"
|
||||
|
||||
@JvmStatic val COMPLETION_MODULE_KEY = Lookup.Key<ModuleProject>()
|
||||
}
|
||||
|
||||
@@ -102,7 +98,6 @@ abstract class ModuleProject(
|
||||
abstract fun getCompileModuleProjects(): List<ModuleProject>
|
||||
|
||||
/** Finds the source files and classes from source directories and classpaths and indexes them. */
|
||||
@Suppress("UnstableApiUsage")
|
||||
internal fun indexSourcesAndClasspaths() {
|
||||
log.info("Indexing sources and classpaths for project:", path)
|
||||
indexSources()
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ class JarFsClasspathReader : IClasspathReader {
|
||||
|
||||
override fun visitFile(file: Path, attrs: BasicFileAttributes): FileVisitResult {
|
||||
var name = file.pathString
|
||||
if (!name.endsWith(".class")) {
|
||||
if (name.endsWith("/package-info.class") || !name.endsWith(".class")) {
|
||||
return CONTINUE
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user