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,6 +82,7 @@ String getSevenZipJarPath() {
} }
task extractSevenZipNativeLibs(type: Copy) { task extractSevenZipNativeLibs(type: Copy) {
gradle.taskGraph.whenReady {
String jarPath = getSevenZipJarPath(); String jarPath = getSevenZipJarPath();
from zipTree(jarPath) from zipTree(jarPath)
include "Linux-amd64/*.so" include "Linux-amd64/*.so"
@@ -92,6 +93,7 @@ task extractSevenZipNativeLibs(type: Copy) {
exclude "Windows-x86" exclude "Windows-x86"
into ("build/data/sevenzipnativelibs") into ("build/data/sevenzipnativelibs")
} }
}
rootProject.prepDev.dependsOn extractSevenZipNativeLibs rootProject.prepDev.dependsOn extractSevenZipNativeLibs
jar.dependsOn extractSevenZipNativeLibs jar.dependsOn extractSevenZipNativeLibs

View File

@@ -45,11 +45,13 @@ task jythonUnpack(type: Copy) {
!file("build/data/${JYTHON_DIR}").exists() !file("build/data/${JYTHON_DIR}").exists()
} }
gradle.taskGraph.whenReady {
from zipTree(configurations.jython.singleFile) from zipTree(configurations.jython.singleFile)
include "Lib/**" include "Lib/**"
destinationDir = file("build/data/${JYTHON_DIR}") destinationDir = file("build/data/${JYTHON_DIR}")
} }
}
task jythonSrcCopy(type: Copy) { task jythonSrcCopy(type: Copy) {
description = "Copy jython-src directory (for Feature Jython)" description = "Copy jython-src directory (for Feature Jython)"

View File

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

View File

@@ -53,9 +53,11 @@ dependencies {
evaluationDependsOn(p.path) evaluationDependsOn(p.path)
p.plugins.withType(JavaPlugin) {
api p api p
} }
} }
}
// some tests use classes in Base, FunctionGraph and PDB // some tests use classes in Base, FunctionGraph and PDB
testImplementation project(path: ':Pty', configuration: 'testArtifacts') testImplementation project(path: ':Pty', configuration: 'testArtifacts')

View File

@@ -25,12 +25,12 @@ dependencies {
} }
project.afterEvaluate { project.afterEvaluate {
rootProject.ext.mdDeps.clear() rootProject.ext.markdownDeps.clear()
configurations.runtimeClasspath.resolve().each { File f -> 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 -> 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. * Force all project compile classpaths to be resolved at configuration time.
*********************************************************************************/ *********************************************************************************/
allprojects { allprojects {
afterEvaluate { gradle.taskGraph.whenReady {
configurations.matching { it.name.endsWith("compileClasspath") }.all { cfg -> configurations.matching { it.name.endsWith("compileClasspath") }.all { cfg ->
if (cfg.canBeResolved) { if (cfg.canBeResolved) {
try { try {
@@ -107,7 +107,7 @@ allprojects {
/********************************************************************************* /*********************************************************************************
* Store :MarkdownSupport ClassPath to fix issues with Gradle 9. * Store :MarkdownSupport ClassPath to fix issues with Gradle 9.
*********************************************************************************/ *********************************************************************************/
ext.mdDeps = [] ext.markdownDeps = []
/********************************************************************************* /*********************************************************************************
* Imports * Imports

View File

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

View File

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