mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-25 13:42:06 +00:00
#2219 Copy Jars into lib folder during plugin build automatically
This commit is contained in:
parent
656060a1a5
commit
71b70cf8e5
@ -46,3 +46,29 @@ else {
|
||||
throw new GradleException("GHIDRA_INSTALL_DIR is not defined!")
|
||||
}
|
||||
//----------------------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
|
||||
}
|
||||
}
|
||||
|
||||
task cleanDependencyJars(type: Delete) {
|
||||
delete fileTree("lib").matching {
|
||||
include "**/*.jar"
|
||||
}
|
||||
}
|
||||
|
||||
tasks.buildExtension.dependsOn(copyDependencies)
|
||||
tasks.copyDependencies.dependsOn(cleanDependencyJars)
|
||||
tasks.clean.dependsOn(cleanDependencyJars)
|
||||
|
@ -1,3 +1,3 @@
|
||||
The "lib" directory is intended to hold Jar files which this module
|
||||
is dependent upon. This directory may be eliminated from a specific
|
||||
module if no other Jar files are needed.
|
||||
is dependent upon. If you use the copyDependencies task, this directory
|
||||
is automatically managed by Gradle and should not be modified.
|
||||
|
Loading…
Reference in New Issue
Block a user