diff --git a/build.gradle b/build.gradle index 8c48e0c739..0df62fc365 100644 --- a/build.gradle +++ b/build.gradle @@ -316,19 +316,19 @@ List getExternalRuntimeDependencies(Project project) { List list = new ArrayList() if (project.configurations.find { it.name == 'api' }) { - list.addAll(getExternalDependencies(project, project.configurations.api)); + list.addAll(getExternalRuntimeDependencies(project, project.configurations.api)); } if (project.configurations.find { it.name == 'implementation' }) { - list.addAll(getExternalDependencies(project, project.configurations.implementation)); + list.addAll(getExternalRuntimeDependencies(project, project.configurations.implementation)); } if (project.configurations.find { it.name == 'runtimeOnly' }) { - list.addAll(getExternalDependencies(project, project.configurations.runtimeOnly)); + list.addAll(getExternalRuntimeDependencies(project, project.configurations.runtimeOnly)); } return list } -List getExternalDependencies(Project project, Configuration configuration) { +List getExternalRuntimeDependencies(Project project, Configuration configuration) { List list = new ArrayList<>(); configuration.dependencies.each { dep -> @@ -350,14 +350,11 @@ List getExternalDependencies(Project project, Configuration configuratio searchString+= "-$cls" } } - - // loop back through all the dependency files, looking for one that contains the dependency name. - String depPath = project.configurations - .findAll {it.isCanBeResolved()} - .collect {it.resolve()} - .flatten() - .find {it.getAbsolutePath().contains(searchString) + // search for the dependency in the runtime class path + String depPath = project.configurations.runtimeClasspath.find { + it.name.contains(searchString) } + if (depPath == null) { println("****************DID NOT FIND DEPENDENCY: name = "+name+" version = "+version) } @@ -370,20 +367,7 @@ List getExternalDependencies(Project project, Configuration configuratio return list; } -/********************************************************************************* - * Returns a list of all the external library paths declared as dependencies for the - * given project - * - *********************************************************************************/ -Set getAllExternalDependencies(Project project) { - Set set = new HashSet() - - project.getConfigurations().each { config -> - set.addAll(getExternalDependencies(project, config)) - } - - return set -} + /****************************************************************************************** * @@ -415,37 +399,6 @@ String generateLibraryDependencyMapping() { } return libsFile.absolutePath } -/****************************************************************************************** - * - * Creates a file that lists all external jars used to build and run Ghidra - * - ******************************************************************************************/ -String generateAllExternalLibsFile() { - File libsFile = file("$buildDir/AllExternalLibs.txt") - - // Check to make sure the build folder exists - if it doesn't, the 'libsFile.withWriter' - // call (below) will fail miserably. - def buildFolder = file ("$buildDir") - if (!buildFolder.exists()) { - buildFolder.mkdirs() - } - Set allLibs = new HashSet<>(); - subprojects { p -> - p.plugins.withType(JavaPlugin) { - Set libs = getAllExternalDependencies(p); - if (libs != null) { - allLibs.addAll(libs); - } - } - } - libsFile.withWriter { out -> - allLibs.each { path -> - out.println "$path" - } - } - return libsFile.absolutePath -} - task allSleighCompile { } diff --git a/gradle/root/prepDev.gradle b/gradle/root/prepDev.gradle index 6daec0a34d..6c25a46106 100644 --- a/gradle/root/prepDev.gradle +++ b/gradle/root/prepDev.gradle @@ -25,21 +25,6 @@ task prepDev { // the GhidraLauncher depends on this file to build the classpath in dev mode dependsOn { generateLibraryDependencyMapping } - - // generate list of all library files used to build and run ghidra. (not strictly necessary here, but nice to have) - dependsOn { generateAllExternalLibsFile } - -} - -/****************************************************************************************** - * TASK generateAllExternalLibsFile - * - * Summary: Creates a file that lists all libraries used to build and run Ghidra - ******************************************************************************************/ -task generateAllExternalLibsFile { - doFirst{ - generateAllExternalLibsFile() - } } /******************************************************************************************