GP-1144: Some tweaks to extension dependency pull-request

This commit is contained in:
Ryan Kurtz
2021-07-20 15:27:02 -04:00
parent 71b70cf8e5
commit a17d00bf0c
3 changed files with 37 additions and 36 deletions
+8 -22
View File
@@ -47,28 +47,14 @@ else {
}
//----------------------END "DO NOT MODIFY" SECTION-------------------------------
// Include the code below if you want dependency jars to be automatically managed
task copyDependencies(type: Copy) {
from configurations.default
into "lib"
exclude {fileTreeElement ->
def fileAbsPath = fileTreeElement.getFile().getCanonicalFile().toPath()
// Avoid including Ghidra Jars in lib folder...
def isGhidraJar = fileAbsPath.startsWith(ghidraInstallDir)
// ...and jars already in the destination location
def destLibDir = project.file("lib").getCanonicalFile().toPath()
def isFromDest = fileAbsPath.startsWith(destLibDir)
return isGhidraJar || isFromDest
}
repositories {
// Declare dependency repositories here. This is not needed if dependencies are manually
// dropped into the lib/ directory.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html for more info.
// Ex: mavenCentral()
}
task cleanDependencyJars(type: Delete) {
delete fileTree("lib").matching {
include "**/*.jar"
}
dependencies {
// Any external dependencies added here will automatically be copied to the lib/ directory when
// this extension is built.
}
tasks.buildExtension.dependsOn(copyDependencies)
tasks.copyDependencies.dependsOn(cleanDependencyJars)
tasks.clean.dependsOn(cleanDependencyJars)
+3 -3
View File
@@ -1,3 +1,3 @@
The "lib" directory is intended to hold Jar files which this module
is dependent upon. If you use the copyDependencies task, this directory
is automatically managed by Gradle and should not be modified.
The "lib" directory is intended to hold Jar files which this module is dependent upon. Jar files
may be placed in this directory manually, or automatically by maven via the dependencies block
of this module's build.gradle file.