GP-6385: Some more gradle tweaks

This commit is contained in:
Ryan Kurtz
2026-01-30 11:07:46 -05:00
parent d160f22f09
commit 675be71ebb
8 changed files with 43 additions and 40 deletions

View File

@@ -82,15 +82,17 @@ String getSevenZipJarPath() {
}
task extractSevenZipNativeLibs(type: Copy) {
String jarPath = getSevenZipJarPath();
from zipTree(jarPath)
include "Linux-amd64/*.so"
include "Windows-amd64/*.dll"
include "Mac-x86_64/*.dylib"
exclude "META-INF"
exclude "Linux-i386"
exclude "Windows-x86"
into ("build/data/sevenzipnativelibs")
gradle.taskGraph.whenReady {
String jarPath = getSevenZipJarPath();
from zipTree(jarPath)
include "Linux-amd64/*.so"
include "Windows-amd64/*.dll"
include "Mac-x86_64/*.dylib"
exclude "META-INF"
exclude "Linux-i386"
exclude "Windows-x86"
into ("build/data/sevenzipnativelibs")
}
}
rootProject.prepDev.dependsOn extractSevenZipNativeLibs

View File

@@ -45,10 +45,12 @@ task jythonUnpack(type: Copy) {
!file("build/data/${JYTHON_DIR}").exists()
}
from zipTree(configurations.jython.singleFile)
include "Lib/**"
destinationDir = file("build/data/${JYTHON_DIR}")
gradle.taskGraph.whenReady {
from zipTree(configurations.jython.singleFile)
include "Lib/**"
destinationDir = file("build/data/${JYTHON_DIR}")
}
}
task jythonSrcCopy(type: Copy) {

View File

@@ -55,7 +55,7 @@ def getAllHelpTasks() {
*/
tasks.register('buildHelp') {
description 'Build all Ghidra help'
description = 'Build all Ghidra help'
dependsOn { getAllHelpTasks() } // all 'buildHelpModule' tasks
dependsOn 'validateHelpTocFiles' // the validate TOC task to run after all help is built

View File

@@ -53,7 +53,9 @@ dependencies {
evaluationDependsOn(p.path)
api p
p.plugins.withType(JavaPlugin) {
api p
}
}
}

View File

@@ -25,12 +25,12 @@ dependencies {
}
project.afterEvaluate {
rootProject.ext.mdDeps.clear()
rootProject.ext.markdownDeps.clear()
configurations.runtimeClasspath.resolve().each { File f ->
rootProject.ext.mdDeps.add(f.getAbsolutePath())
rootProject.ext.markdownDeps.add(f.getAbsolutePath())
}
sourceSets.main.output.files.each { File f ->
rootProject.ext.mdDeps.add(f.getAbsolutePath())
rootProject.ext.markdownDeps.add(f.getAbsolutePath())
}
}

View File

@@ -93,7 +93,7 @@ else {
* Force all project compile classpaths to be resolved at configuration time.
*********************************************************************************/
allprojects {
afterEvaluate {
gradle.taskGraph.whenReady {
configurations.matching { it.name.endsWith("compileClasspath") }.all { cfg ->
if (cfg.canBeResolved) {
try {
@@ -107,7 +107,7 @@ allprojects {
/*********************************************************************************
* Store :MarkdownSupport ClassPath to fix issues with Gradle 9.
*********************************************************************************/
ext.mdDeps = []
ext.markdownDeps = []
/*********************************************************************************
* Imports

View File

@@ -300,14 +300,13 @@ tasks.register('buildGlobalMarkdown') {
doLast {
markdownFiles.each { f ->
def htmlFile = "build/src/global/docs/" + f.name[0..-3] + "html"
[
'java',
'-cp', project.files(rootProject.ext.mdDeps).asPath,
'ghidra.markdown.MarkdownToHtml',
f,
file(htmlFile)
].execute()
def htmlName = f.name[0..-3] + "html"
providers.javaexec {
classpath = rootProject.files(rootProject.ext.markdownDeps)
mainClass = 'ghidra.markdown.MarkdownToHtml'
args f
args file("build/src/global/docs/${htmlName}")
}.result.get()
}
}
}

View File

@@ -551,18 +551,16 @@ task assembleMarkdownToHtml (type: Copy) {
outputs.upToDateWhen {false}
destinationDir = file(DISTRIBUTION_DIR.getPath() + "/" + ZIP_DIR_PREFIX)
doLast {
eachFile { f ->
def htmlName = f.sourceName[0..-3] + "html"
def htmlPath = f.relativePath.replaceLastName(htmlName).pathString
[
'java',
'-cp', project.files(rootProject.ext.mdDeps).asPath,
'ghidra.markdown.MarkdownToHtml',
f.file,
file("${destinationDir.path}/${htmlPath}")
].execute()
}
eachFile { f ->
def htmlName = f.sourceName[0..-3] + "html"
def htmlPath = f.relativePath.replaceLastName(htmlName).pathString
providers.javaexec {
classpath = rootProject.files(rootProject.ext.markdownDeps)
mainClass = 'ghidra.markdown.MarkdownToHtml'
args f.file
args file("${destinationDir.path}/${htmlPath}")
}.result.get()
}
}