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
+11 -9
View File
@@ -82,15 +82,17 @@ String getSevenZipJarPath() {
} }
task extractSevenZipNativeLibs(type: Copy) { task extractSevenZipNativeLibs(type: Copy) {
String jarPath = getSevenZipJarPath(); gradle.taskGraph.whenReady {
from zipTree(jarPath) String jarPath = getSevenZipJarPath();
include "Linux-amd64/*.so" from zipTree(jarPath)
include "Windows-amd64/*.dll" include "Linux-amd64/*.so"
include "Mac-x86_64/*.dylib" include "Windows-amd64/*.dll"
exclude "META-INF" include "Mac-x86_64/*.dylib"
exclude "Linux-i386" exclude "META-INF"
exclude "Windows-x86" exclude "Linux-i386"
into ("build/data/sevenzipnativelibs") exclude "Windows-x86"
into ("build/data/sevenzipnativelibs")
}
} }
rootProject.prepDev.dependsOn extractSevenZipNativeLibs rootProject.prepDev.dependsOn extractSevenZipNativeLibs
+6 -4
View File
@@ -45,10 +45,12 @@ task jythonUnpack(type: Copy) {
!file("build/data/${JYTHON_DIR}").exists() !file("build/data/${JYTHON_DIR}").exists()
} }
from zipTree(configurations.jython.singleFile) gradle.taskGraph.whenReady {
include "Lib/**" from zipTree(configurations.jython.singleFile)
include "Lib/**"
destinationDir = file("build/data/${JYTHON_DIR}")
destinationDir = file("build/data/${JYTHON_DIR}")
}
} }
task jythonSrcCopy(type: Copy) { task jythonSrcCopy(type: Copy) {
+1 -1
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
@@ -53,7 +53,9 @@ dependencies {
evaluationDependsOn(p.path) evaluationDependsOn(p.path)
api p p.plugins.withType(JavaPlugin) {
api p
}
} }
} }
+3 -3
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())
} }
} }
+2 -2
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
+7 -8
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()
} }
} }
} }
+10 -12
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
[ 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.file
f.file, args file("${destinationDir.path}/${htmlPath}")
file("${destinationDir.path}/${htmlPath}") }.result.get()
].execute()
}
} }
} }