mirror of
https://gitee.com/zhangsken/AndroidIDE.git
synced 2026-10-16 07:49:44 +08:00
Updated dependency configurations
This commit is contained in:
Vendored
+1
-1
@@ -19,7 +19,7 @@
|
||||
-keep class com.itsaky.androidide.builder.model.** { *; }
|
||||
|
||||
# JSONRpc
|
||||
-keep class org.eclipse.lsp4j.** { *; }
|
||||
-keep class org.eclipse.lemminx.uriresolver.URIResolverExtensionManager { *; }
|
||||
|
||||
# EventBus
|
||||
-keepattributes *Annotation*
|
||||
|
||||
Binary file not shown.
+19
-22
@@ -58,9 +58,8 @@ abstract class ModuleProject(
|
||||
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>()
|
||||
|
||||
@JvmStatic val COMPLETION_MODULE_KEY = Lookup.Key<ModuleProject>()
|
||||
}
|
||||
|
||||
@JvmField val compileJavaSourceClasses = SourceClassTrie()
|
||||
@@ -109,55 +108,53 @@ abstract class ModuleProject(
|
||||
indexSources()
|
||||
indexClasspaths()
|
||||
}
|
||||
|
||||
|
||||
internal fun indexClasspaths() {
|
||||
|
||||
|
||||
this.compileClasspathClasses.clear()
|
||||
|
||||
|
||||
val watch = StopWatch("Indexing classpaths")
|
||||
val paths = getCompileClasspaths().filter { it.exists() }
|
||||
|
||||
|
||||
for (path in paths) {
|
||||
// Use 'getCanonicalFile' just to be sure that caches are stored with correct keys
|
||||
// See JavacFileManager.getContainer(Path) for more details
|
||||
CacheFSInfoSingleton.cache(CacheFSInfoSingleton.getCanonicalFile(path.toPath()))
|
||||
}
|
||||
|
||||
|
||||
val topLevelClasses = JarFsClasspathReader().listClasses(paths).filter { it.isTopLevel }
|
||||
topLevelClasses.forEach { this.compileClasspathClasses.append(it.name) }
|
||||
|
||||
|
||||
watch.log()
|
||||
log.debug("Found ${topLevelClasses.size} classpaths.")
|
||||
|
||||
|
||||
if (this is AndroidModule) {
|
||||
BootClasspathProvider.update(bootClassPaths.map { it.path })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
internal fun indexSources() {
|
||||
|
||||
|
||||
this.compileJavaSourceClasses.clear()
|
||||
|
||||
|
||||
val watch = StopWatch("Indexing sources")
|
||||
var count = 0
|
||||
getCompileSourceDirectories().forEach {
|
||||
val sourceDir = it.toPath()
|
||||
it
|
||||
.walk()
|
||||
.filter { file ->
|
||||
file.isFile && file.exists() && DocumentUtils.isJavaFile(file.toPath()) }
|
||||
.map { file ->
|
||||
file.toPath() }
|
||||
.filter { file -> file.isFile && file.exists() && DocumentUtils.isJavaFile(file.toPath()) }
|
||||
.map { file -> file.toPath() }
|
||||
.forEach { file ->
|
||||
this.compileJavaSourceClasses.append(file, sourceDir)
|
||||
count++
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
watch.log()
|
||||
log.debug("Found $count source files.")
|
||||
}
|
||||
|
||||
|
||||
fun getSourceFilesInDir(dir: Path): List<SourceNode> =
|
||||
this.compileJavaSourceClasses.getSourceFilesInDir(dir)
|
||||
|
||||
@@ -222,11 +219,11 @@ abstract class ModuleProject(
|
||||
.findInPackage(packageName)
|
||||
.filterIsInstance(SourceNode::class.java)
|
||||
}
|
||||
|
||||
open fun isFromThisModule(file: File) : Boolean {
|
||||
|
||||
open fun isFromThisModule(file: File): Boolean {
|
||||
return isFromThisModule(file.toPath())
|
||||
}
|
||||
|
||||
|
||||
open fun isFromThisModule(file: Path): Boolean {
|
||||
// TODO This can be probably improved
|
||||
return file.startsWith(this.projectDir.toPath())
|
||||
|
||||
@@ -64,7 +64,6 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project (path: ':logger')
|
||||
implementation project (path: ':build-tools:tooling-api')
|
||||
|
||||
implementation common.jkotlin
|
||||
|
||||
@@ -32,8 +32,9 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
implementation project (path: ':logger')
|
||||
implementation project (path: ':build-tools:jsonrpc')
|
||||
implementation project (path: ':build-tools:xml-dom')
|
||||
|
||||
api project (path: ':build-tools:jsonrpc')
|
||||
api project (path: ':build-tools:xml-dom')
|
||||
api project (path: ':build-tools:builder-model-impl')
|
||||
|
||||
implementation common.jkotlin
|
||||
|
||||
@@ -26,16 +26,16 @@ java {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project (path: ':logger')
|
||||
api project (path: ':logger')
|
||||
api project (path: ':build-tools:jsonrpc')
|
||||
api project (path: ':build-tools:tooling-api-model')
|
||||
api project (path: ':build-tools:tooling-api-events')
|
||||
|
||||
api google.gson
|
||||
implementation common.jkotlin
|
||||
|
||||
testImplementation tests.junit
|
||||
testImplementation tests.google_truth
|
||||
api google.gson
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
||||
@@ -31,8 +31,6 @@ import kotlin.io.path.nameWithoutExtension
|
||||
open class SourceClassTrie(root: SourcePackageNode = SourcePackageNode()) : ClassTrie(root) {
|
||||
|
||||
companion object {
|
||||
private val log = ILogger.newInstance(javaClass.simpleName)
|
||||
|
||||
@JvmStatic
|
||||
private val pkgNameMethod by lazy {
|
||||
Class.forName("com.itsaky.androidide.projects.util.StringSearch")
|
||||
@@ -42,7 +40,6 @@ open class SourceClassTrie(root: SourcePackageNode = SourcePackageNode()) : Clas
|
||||
@JvmStatic
|
||||
private fun packageName(file: Path): String {
|
||||
return try { pkgNameMethod.invoke(null, file) as String } catch (error: Throwable) {
|
||||
log.error(error)
|
||||
throw RuntimeException(error)
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user