GP-5257: Fixing Gradle warnings

This commit is contained in:
Ryan Kurtz 2025-01-10 13:51:33 -05:00
parent eaa2a5c6b3
commit 44fb13b292
36 changed files with 234 additions and 346 deletions

View file

@ -1,41 +0,0 @@
/* ###
* IP: GHIDRA
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
apply from: "$rootProject.projectDir/gradle/debugger/hasNodepJar.gradle"
task executableJar {
ext.execsh = file("src/main/sh/execjar.sh")
ext.jarfile = nodepJar.archiveFile
ext.outjar = file("${buildDir}/bin/run")
dependsOn(nodepJar)
inputs.file { execsh }
inputs.file { jarfile }
outputs.file { outjar }
doLast {
outjar.parentFile.mkdirs()
outjar.withOutputStream { output ->
execsh.withInputStream { input ->
output << input
}
jarfile.withInputStream { input ->
output << input
}
}
exec {
commandLine("chmod", "+x", outjar)
}
}
}

View file

@ -1,61 +0,0 @@
/* ###
* IP: GHIDRA
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
def boolean filterJar(File jarfile) {
if (jarfile.name.contains("gradle-api")) {
return false
} else if (jarfile.name.contains("groovy-all")) {
return false
} else if (jarfile.name.contains("gradle-installation-beacon")) {
return false
}
return true
}
task configureNodepJar {
dependsOn(configurations.runtimeClasspath)
doLast {
configurations.runtimeClasspath.files.forEach { jar ->
if (filterJar(jar)) {
nodepJar.from(zipTree(jar)) {
// The real solution here is probably to sort out the dependency graph
// Still, I imagine some of the excludes will be necessary
exclude "help/**"
exclude "images/**"
exclude "OSGI-OPT/**"
exclude "org/osgi/**"
exclude "aQute/**"
// Duplicate. And signature breaks nodep jar
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
// Ensure all LICENSES are included, by renaming to avoid collisions
rename("((LICENSE)|(AL2\\.0)|(LGPL2\\.1)|(NOTICE)|(NOTICE.txt)|(DEPENDENCIES))", "${jar.name}-\$1")
}
}
}
}
}
task nodepJar(type: Jar) {
inputs.file(jar.archiveFile)
dependsOn(configureNodepJar)
dependsOn(jar)
archiveAppendix = 'nodep'
from(zipTree(jar.archiveFile))
duplicatesStrategy = 'exclude'
}

View file

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -73,10 +73,10 @@ task generateProto {
if (!isCurrentWindows()) {
exe.setExecutable(true)
}
exec {
providers.exec {
commandLine exe, "--java_out=$outdir", "-I$srcdir"
args src
}
}.result.get()
}
}

View file

@ -47,17 +47,24 @@ task buildPyPackage {
inputs.files(assemblePyPackage)
outputs.dir(dist)
def debuggerRmiTraceProject = project(":Debugger-rmi-trace")
doLast {
if (rootProject.PYTHON3 == null) {
throw new GradleException("A supported version of Python [${PYTHON_SUPPORTED}] was not found!")
}
File setuptools = project(":Debugger-rmi-trace").findPyDep(".")
exec {
File setuptools = debuggerRmiTraceProject.findPyDep(".")
def exec = providers.exec {
workingDir { file("build/pypkg") }
ignoreExitValue = true
commandLine rootProject.PYTHON3
args "-m", "pip", "wheel", "-w", "dist/", "--no-index", "--no-deps", "-f", setuptools, "."
}
if (exec.result.get().exitValue != 0) {
throw new GradleException(exec.standardError.asText.get().strip())
}
}
}

View file

@ -229,8 +229,8 @@ tasks.register('cleanHelp') {
// Task for calling the java help indexer, which creates a searchable index of the help contents
tasks.register('indexHelp', JavaExec) {
group "private"
description "indexes the helps files for this module. [gradle/helpProject.gradle]"
group = "private"
description = "indexes the helps files for this module. [gradle/helpProject.gradle]"
File helpRootDir = file('src/main/help/help')
File outputFile = file("build/help/main/help/${project.name}_JavaHelpSearch")
@ -287,7 +287,7 @@ tasks.register('indexHelp', JavaExec) {
// Task for building Markdown in src/global/docs to HTML
// - the files generated will be placed in a build directory usable during development mode
tasks.register('buildGlobalMarkdown') {
group "private"
group = "private"
dependsOn ':MarkdownSupport:classes'
FileTree markdownFiles = this.project.fileTree('src/global/docs') {
@ -298,15 +298,17 @@ tasks.register('buildGlobalMarkdown') {
inputs.files markdownFiles
def markdownProject = project(':MarkdownSupport')
doFirst {
markdownFiles.each { f ->
def htmlName = f.name[0..-3] + "html"
javaexec {
classpath = project(':MarkdownSupport').sourceSets.main.runtimeClasspath
providers.javaexec {
classpath = markdownProject.sourceSets.main.runtimeClasspath
mainClass = 'ghidra.markdown.MarkdownToHtml'
args f
args file("build/src/global/docs/${htmlName}")
}
}.result.get()
}
}
}
@ -320,7 +322,7 @@ tasks.register('buildGlobalMarkdown') {
// - the <Module>-help.jar file in development mode
tasks.register('buildHelpFiles', JavaExec) {
group "private"
group = "private"
dependsOn 'indexHelp'
@ -423,12 +425,12 @@ tasks.register('buildHelpFiles', JavaExec) {
*/
tasks.register('buildHelp', Jar) {
group rootProject.GHIDRA_GROUP
description " Builds the help for this module. [gradle/helpProject.gradle]\n"
group = rootProject.GHIDRA_GROUP
description = " Builds the help for this module. [gradle/helpProject.gradle]\n"
dependsOn tasks.named('buildHelpFiles')
dependsOn tasks.named('buildGlobalMarkdown')
duplicatesStrategy 'exclude'
duplicatesStrategy = 'exclude'
from "build/help/main" // include the generated help and index files
from "src/main/help" // include the help source files
@ -441,8 +443,8 @@ tasks.register('buildHelp', Jar) {
// Task for finding unused images that are not referenced from Ghidra help files
tasks.register('findUnusedHelp', JavaExec) {
group "private"
description " Finds unused help images for this module. [gradle/helpProject.gradle]\n"
group = "private"
description = " Finds unused help images for this module. [gradle/helpProject.gradle]\n"
File helpRootDir = file('src/main/help/help')
inputs.dir helpRootDir
@ -465,7 +467,7 @@ tasks.register('findUnusedHelp', JavaExec) {
// include the help into the module's jar
jar {
duplicatesStrategy 'exclude'
duplicatesStrategy = 'exclude'
from "build/help/main" // include the generated help and index files
from "src/main/help" // include the help source files
}

View file

@ -25,7 +25,7 @@
test { t ->
forkEvery 1
forkEvery = 1
initTestJVM(t, rootProject.ext.testRootDirName)
// WARNING! WATCH OUT !!
@ -52,7 +52,7 @@ test { t ->
}
task integrationTest (type: Test) { t ->
group "test"
group = "test"
dependsOn { project(":FunctionID").unpackFidDatabases }
testClassesDirs = files sourceSets.integrationTest.output.classesDirs
@ -63,7 +63,7 @@ task integrationTest (type: Test) { t ->
excludes = ['**/*Suite*']
// Enable if you want to force Gradle to launch a new JVM for each test.
forkEvery 1
forkEvery = 1
initTestJVM(t, rootProject.ext.testRootDirName)
@ -76,13 +76,13 @@ task integrationTest (type: Test) { t ->
}
task pcodeTest (type: Test) { t ->
group "pcodeTest"
group = "pcodeTest"
dependsOn { project(":FunctionID").unpackFidDatabases }
testClassesDirs = files sourceSets.pcodeTest.output.classesDirs
classpath = sourceSets.pcodeTest.runtimeClasspath
// Enable if you want to force Gradle to launch a new JVM for each test.
forkEvery 1
forkEvery = 1
initTestJVM(t, rootProject.ext.pcodeTestRootDirName)
@ -130,7 +130,7 @@ def initTestJVM(Task task, String rootDirName) {
mkdir testOutputDir
}
// If false, testing will halt when an error is found.
task.ignoreFailures true
task.ignoreFailures = true
// If false, then tests are re-run every time, even if no code has changed.
task.outputs.upToDateWhen {false}
@ -139,8 +139,8 @@ def initTestJVM(Task task, String rootDirName) {
task.testLogging.showStandardStreams = true
// Min/Max heap size. These are passed in.
task.minHeapSize xms
task.maxHeapSize xmx
task.minHeapSize = xms
task.maxHeapSize = xmx
task.doFirst {
task.jvmArgs '-DupgradeProgramErrorMessage=' + upgradeProgramErrorMessage,

View file

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -123,10 +123,14 @@ clean {
*****************************************************************************************/
task writeSleighDevBuild {
def templateFilePath = project(':BuildFiles').projectDir.toString() + "/sleighDevBuild.template"
def softwareModelingProject = project(':SoftwareModeling')
doLast {
// Generate build.xml with injected classpath for running sleigh compiler
def sleighDevClasspath = project(':SoftwareModeling').sourceSets.main.runtimeClasspath.collect { it.absolutePath }.join(':')
def sleighDevClasspath = softwareModelingProject.sourceSets.main.runtimeClasspath.collect {
it.absolutePath
}.join(':')
copy {
into "data"
from (templateFilePath) {
@ -160,7 +164,7 @@ rootProject.assembleDistribution {
task sleighCompile (type: JavaExec) {
dependsOn saveSleighArgs
group = rootProject.GHIDRA_GROUP
description " Compiles all the sleigh languages. [gradle/processorProject.gradle]\n"
description = " Compiles all the sleigh languages. [gradle/processorProject.gradle]\n"
// define standard parameters for JavaExec
classpath configurations.sleighConfig
@ -195,8 +199,8 @@ rootProject.allSleighCompile.dependsOn sleighCompile
*
*****************************************************************************************/
task cleanSleigh {
group rootProject.GHIDRA_GROUP
description "Removes all the compile sleigh language files (*.sla). [gradle/processorProject.gradle]\n"
group = rootProject.GHIDRA_GROUP
description = "Removes all the compile sleigh language files (*.sla). [gradle/processorProject.gradle]\n"
doLast {
def deleteTree = fileTree(dir: "data/languages", include: "*.sla")
deleteTree.each { File file ->

View file

@ -60,8 +60,6 @@ ext.ghidraPath = files()
* string will be returned.
*/
def getGitRev(repoPath) {
println("getting git commit for $repoPath")
// If the path doesn't exist, the exec command will fail before it can
// even run the 'git' command, so short-circuit the whole thing here.
@ -81,22 +79,19 @@ def getGitRev(repoPath) {
// 'ignoreExitValue' attribute only applies to the return value of the
// command being executed (eg: git); it doesn't apply to the return value of
// the exec command itself.
def stdout = new ByteArrayOutputStream()
try {
exec {
def stdout = providers.exec {
ignoreExitValue = true
workingDir repoPath
commandLine 'git', 'rev-parse', 'HEAD'
standardOutput = stdout
}
}.standardOutput.asText.get().trim()
return stdout
}
catch (Exception e) {
println("ERROR: gradle exec failed to run 'git rev-parse': is git installed on this system?")
return ""
}
// Return the commit hash
println(stdout)
return stdout.toString().trim()
}
/*********************************************************************************
@ -110,9 +105,9 @@ def getGitRev(repoPath) {
*********************************************************************************/
task createJavadocs(type: Javadoc, description: 'Generate javadocs for all projects', group: 'Documentation') {
destinationDir file(rootProject.projectDir.toString() + "/build/tmp/javadoc")
destinationDir = file(rootProject.projectDir.toString() + "/build/tmp/javadoc")
failOnError false
failOnError = false
// the "source" property must be set in individual project's build.gradle files.
// projects that want to be included in the Jsondocs should add the following to
@ -123,7 +118,7 @@ task createJavadocs(type: Javadoc, description: 'Generate javadocs for all proje
// Must add classpath for main and test source sets. Javadoc will fail if it cannot
// find referenced classes.
classpath = rootProject.ext.ghidraPath
classpath = rootProject.ext.ghidraPath
// generate documentation using html5
options.addBooleanOption("html5", true)
@ -158,17 +153,17 @@ dependencies {
task createJsondocs(type: Javadoc, description: 'Generate JSON docs for all projects', group: 'Documentation') {
group 'private'
group = 'private'
String ROOT_PROJECT_DIR = rootProject.projectDir.toString()
destinationDir file(ROOT_PROJECT_DIR + "/build/tmp/jsondoc")
destinationDir = file(ROOT_PROJECT_DIR + "/build/tmp/jsondoc")
failOnError false
failOnError = false
// Must add classpath for main and test source sets. Javadoc will fail if it cannot
// find referenced classes.
classpath = rootProject.ext.ghidraPath
classpath = rootProject.ext.ghidraPath
// the "source" property must be set in individual project's build.gradle files.
// projects that want to be included in the Jsondocs should add the following to
@ -196,18 +191,17 @@ task createJsondocs(type: Javadoc, description: 'Generate JSON docs for all proj
task createPythonTypeStubs(type: Javadoc, description: 'Generate pyi stubs for all projects', group: 'Documentation') {
group 'private'
group = 'private'
String ROOT_PROJECT_DIR = rootProject.projectDir.toString()
destinationDir file(ROOT_PROJECT_DIR + "/build/typestubs/src")
destinationDir = file(ROOT_PROJECT_DIR + "/build/typestubs/src")
failOnError false
failOnError = false
// Must add classpath for main and test source sets. Javadoc will fail if it cannot
// find referenced classes.
classpath = rootProject.ext.ghidraPath
classpath = rootProject.ext.ghidraPath
// Generate at package level because user may try to get help directly on an object they have
// rather than its public interface.
@ -231,8 +225,8 @@ task createPythonTypeStubs(type: Javadoc, description: 'Generate pyi stubs for a
task createGhidraStubsWheel {
group 'private'
description "Creates the ghidra-stubs wheel for the Ghidra api. [gradle/root/distribution.gradle]"
group = 'private'
description = "Creates the ghidra-stubs wheel for the Ghidra api. [gradle/root/distribution.gradle]"
dependsOn("createPythonTypeStubs")
@ -240,6 +234,9 @@ task createGhidraStubsWheel {
def distDir = file("${typestubsDir}/dist").getAbsolutePath()
it.outputs.file("${distDir}/ghidra_stubs-${project.version}-py3-none-any.whl")
def p = project
def debuggerRmiTraceProject = project(":Debugger-rmi-trace")
doFirst {
copy {
@ -258,7 +255,7 @@ task createGhidraStubsWheel {
[project]
name = "ghidra-stubs"
version = "${project.version}"
version = "${p.version}"
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Typing :: Stubs Only",
@ -268,17 +265,21 @@ task createGhidraStubsWheel {
}
doLast {
File setuptools = project(":Debugger-rmi-trace").findPyDep(".")
File setuptools = debuggerRmiTraceProject.findPyDep(".")
if (PYTHON3 == null) {
throw new GradleException("A supported version of Python [${PYTHON_SUPPORTED}] was not found!")
}
exec {
def exec = providers.exec {
workingDir { typestubsDir }
ignoreExitValue = true
commandLine PYTHON3
args "-m", "pip", "wheel", "-w", distDir, "--no-index", "-f", setuptools, "."
}
if (exec.result.get().exitValue != 0) {
throw new GradleException(exec.standardError.asText.get().strip())
}
}
}
@ -292,7 +293,7 @@ task createGhidraStubsWheel {
*
*********************************************************************************/
task zipJavadocs(type: Zip) {
group 'private'
group = 'private'
archiveFileName = 'GhidraAPI_javadoc.zip'
destinationDirectory = file(rootProject.projectDir.toString() + "/build/tmp")
@ -304,7 +305,7 @@ task zipJavadocs(type: Zip) {
into "api"
}
description "Zips javadocs for Ghidra api. [gradle/root/distribution.gradle]"
description = "Zips javadocs for Ghidra api. [gradle/root/distribution.gradle]"
}
@ -321,12 +322,12 @@ task assembleDistribution (type: Copy) {
// every other time it is run even though in both cases the output directory has been removed
outputs.upToDateWhen {false}
group 'private'
description "Copies core files/folders to the distribution location."
destinationDir file(DISTRIBUTION_DIR.getPath() + "/" + ZIP_DIR_PREFIX)
group = 'private'
description = "Copies core files/folders to the distribution location."
destinationDir = file(DISTRIBUTION_DIR.getPath() + "/" + ZIP_DIR_PREFIX)
// Make sure that we don't try to copy the same file with the same path.
duplicatesStrategy 'exclude'
duplicatesStrategy = 'exclude'
exclude "**/certification.manifest"
exclude "**/certification.local.manifest"
@ -485,13 +486,13 @@ project.PLATFORMS.each { platform ->
delete rootProject.file("build/tmp/expandedArchives")
group 'private'
description "Copies the platform-dependent files/folders to the distribution location."
destinationDir file(DISTRIBUTION_DIR.getPath() + "/" + ZIP_DIR_PREFIX)
group = 'private'
description = "Copies the platform-dependent files/folders to the distribution location."
destinationDir = file(DISTRIBUTION_DIR.getPath() + "/" + ZIP_DIR_PREFIX)
// Make sure that we don't try to copy the same file with the same path into the
// zip (this can happen!)
duplicatesStrategy 'exclude'
duplicatesStrategy = 'exclude'
}
}
@ -501,9 +502,9 @@ project.PLATFORMS.each { platform ->
*
**********************************************************************************/
task assembleSource (type: Copy) {
group 'private'
description "Copies source zips for all core projects to the distribution folder"
destinationDir DISTRIBUTION_DIR
group = 'private'
description = "Copies source zips for all core projects to the distribution folder"
destinationDir = DISTRIBUTION_DIR
}
@ -513,23 +514,25 @@ task assembleSource (type: Copy) {
*
************************************************************************************/
task assembleMarkdownToHtml (type: Copy) {
group 'private'
description "Copies a markdown file and a generaterated html file into the distribution folder"
group = 'private'
description = "Copies a markdown file and a generaterated html file into the distribution folder"
dependsOn ':MarkdownSupport:classes'
outputs.upToDateWhen {false}
destinationDir file(DISTRIBUTION_DIR.getPath() + "/" + ZIP_DIR_PREFIX)
destinationDir = file(DISTRIBUTION_DIR.getPath() + "/" + ZIP_DIR_PREFIX)
def markdownSuppportProject = project(':MarkdownSupport')
eachFile { f ->
def htmlName = f.sourceName[0..-3] + "html"
def htmlPath = f.relativePath.replaceLastName(htmlName).pathString
javaexec {
classpath = project(':MarkdownSupport').sourceSets.main.runtimeClasspath
providers.javaexec {
classpath = markdownSuppportProject.sourceSets.main.runtimeClasspath
mainClass = 'ghidra.markdown.MarkdownToHtml'
args f.file
args file("${destinationDir.path}/${htmlPath}")
}
}.result.get()
}
}
@ -540,15 +543,15 @@ task assembleMarkdownToHtml (type: Copy) {
**********************************************************************************/
task createExternalExtensions(type: Copy) {
group 'private'
description "Creates directory of extensions that are external to the installation zip (does not clean up artifacts) [gradle/root/distribution.gradle]"
group = 'private'
description = "Creates directory of extensions that are external to the installation zip (does not clean up artifacts) [gradle/root/distribution.gradle]"
dependsOn assembleSource
destinationDir new File(DISTRIBUTION_DIR.getPath(), "external_extensions")
destinationDir = new File(DISTRIBUTION_DIR.getPath(), "external_extensions")
// Make sure that we don't try to copy the same file with the same path.
duplicatesStrategy 'exclude'
duplicatesStrategy = 'exclude'
}
@ -598,7 +601,7 @@ def updateSlaFilesTimestamp(String distributionDirectoryPath, int timeOffsetMinu
}
}
println "updateSlaFilesTimestamp: Updated timestamps to $numFilesAdded .sla files."
//println "updateSlaFilesTimestamp: Updated timestamps to $numFilesAdded .sla files."
}
/*********************************************************************************
@ -608,8 +611,8 @@ def updateSlaFilesTimestamp(String distributionDirectoryPath, int timeOffsetMinu
**********************************************************************************/
task assembleAll() {
group 'private'
description "Assembles all targets to one installation directory (does not clean up artifacts) [gradle/root/distribution.gradle]"
group = 'private'
description = "Assembles all targets to one installation directory (does not clean up artifacts) [gradle/root/distribution.gradle]"
dependsOn assembleDistribution
dependsOn assembleSource
@ -645,8 +648,8 @@ task assembleAll() {
**********************************************************************************/
task createInstallationZip(type: Zip) { t ->
group 'private'
description "Creates local installation zip (does not clean up artifacts) [gradle/root/distribution.gradle]"
group = 'private'
description = "Creates local installation zip (does not clean up artifacts) [gradle/root/distribution.gradle]"
dependsOn assembleAll
@ -659,7 +662,7 @@ task createInstallationZip(type: Zip) { t ->
destinationDirectory = DISTRIBUTION_DIR
// Make sure that we don't try to copy the same file with the same path.
duplicatesStrategy 'exclude'
duplicatesStrategy = 'exclude'
from (DISTRIBUTION_DIR.getPath() + "/" + ZIP_DIR_PREFIX) {
into ZIP_DIR_PREFIX
@ -677,7 +680,7 @@ task createInstallationZip(type: Zip) { t ->
*
**********************************************************************************/
task buildGhidra() {
description "Builds Ghidra for the current platform. The resulting zip will be in build/dist"
description = "Builds Ghidra for the current platform. The resulting zip will be in build/dist"
if (project.hasProperty("externalExtensions")) {
dependsOn createExternalExtensions

View file

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -20,8 +20,8 @@
*******************************************************************************************/
task prepDev {
group rootProject.GHIDRA_GROUP
description " Prepares a fresh clone of Ghidra for developing in eclipse. [gradle/root/prepDev.gradle]\n"
group = rootProject.GHIDRA_GROUP
description= " Prepares a fresh clone of Ghidra for developing in eclipse. [gradle/root/prepDev.gradle]\n"
// the GhidraLauncher depends on this file to build the classpath in dev mode
dependsOn { generateLibraryDependencyMapping }

View file

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -29,8 +29,8 @@
*
*********************************************************************************/
task rasterizeSvg(type: JavaExec) {
group rootProject.GHIDRA_GROUP
description " Converts .svg files to .png files. [gradle/root/svg.gradle]\n"
group = rootProject.GHIDRA_GROUP
description = " Converts .svg files to .png files. [gradle/root/svg.gradle]\n"
subprojects { p ->

View file

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -368,7 +368,7 @@ def initTestJVM(Task task, String rootDirName) {
*
*********************************************************************************/
task parallelCombinedTestReport(type: TestReport) { t ->
group "test"
group = "test"
destinationDirectory = file("$reportDir")
logger.debug("parallelCombinedTestReport: Using destinationDir = $reportDir")
dependsOn ":deleteTestTempAndReportDirs"
@ -383,8 +383,8 @@ task parallelCombinedTestReport(type: TestReport) { t ->
*
*********************************************************************************/
task unitTestReport(type: TestReport) { t ->
group "test"
description "Run unit tests and save HTML report."
group = "test"
description = "Run unit tests and save HTML report."
destinationDirectory = file("$reportDir/unitTests")
outputs.upToDateWhen {false}
}
@ -396,8 +396,8 @@ task unitTestReport(type: TestReport) { t ->
*
*********************************************************************************/
task integrationTestReport(type: TestReport) { t ->
group "test"
description "Run integration tests and save HTML report."
group = "test"
description = "Run integration tests and save HTML report."
destinationDirectory = file("$reportDir/integrationTests")
outputs.upToDateWhen {false}
}
@ -414,8 +414,8 @@ task integrationTestReport(type: TestReport) { t ->
*
*********************************************************************************/
task targetedTestReport(type: TestReport) { t ->
group "test"
description "Run unit tests against a specific set of projects."
group = "test"
description = "Run unit tests against a specific set of projects."
destinationDirectory = file("$reportDir/unitTests")
outputs.upToDateWhen {false}
dependsOn ":deleteTestTempAndReportDirs"
@ -451,7 +451,7 @@ def createTestTask(Project subproject, String testType, String bucketName, int t
int classesListPosition, int numMaxParallelForks) {
subproject.task(testType+"_$taskNameCounter"+"_$bucketName", type: Test) { t ->
group "test"
group = "test"
testClassesDirs = files subproject.sourceSets["$testType"].output.classesDirs
classpath = subproject.sourceSets["$testType"].runtimeClasspath
@ -559,7 +559,7 @@ configure(subprojects.findAll {parallelMode == true}) { subproject ->
*
*********************************************************************************/
task combinedTestReport(type: TestReport) { t ->
group "test"
group = "test"
destinationDirectory = file("$reportDir")
dependsOn ":deleteTestTempAndReportDirs"
@ -573,7 +573,7 @@ task combinedTestReport(type: TestReport) { t ->
*
*********************************************************************************/
task pcodeTestReport(type: TestReport) { t ->
group "pcodeTest"
group = "pcodeTest"
destinationDirectory = file("$pcodeTestShareDir" + "/reports")
}
@ -585,7 +585,7 @@ task pcodeTestReport(type: TestReport) { t ->
*
*********************************************************************************/
task pcodeConsolidatedTestReport(type: Copy) {
group "pcodeTest"
group = "pcodeTest"
dependsOn ':pcodeTestReport'
into (pcodeTestShareDir + "/reports")
from (testOutputDir + "/test-output") {

View file

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -24,14 +24,14 @@ plugins.withType(JavaPlugin) {
task zipSourceSubproject (type: Zip) { t ->
// Define some metadata about the zip (name, location, version, etc....)
t.group 'private'
t.description "Creates the source zips for java modules"
t.group = 'private'
t.description = "Creates the source zips for java modules"
t.archiveFileName = project.name + "-src.zip"
t.destinationDirectory = file(projectDir.path + "/build/tmp/src")
// Without this we get duplicate files but it's unclear why. It doesn't seem that this
// task is being executed multiple times, and sourceSets.main.java contains the
// correct elements. Whatever the cause, this fixes the problem.
duplicatesStrategy 'exclude'
duplicatesStrategy = 'exclude'
from sourceSets.main.java
}

View file

@ -20,14 +20,14 @@ task zipExtensions (type: Zip) {
def p = this.project
it.group 'private'
it.description "Creates a zip file for an extension module. [gradle/support/extensionCommon.gradle]"
it.group = 'private'
it.description = "Creates a zip file for an extension module. [gradle/support/extensionCommon.gradle]"
it.archiveFileName = "${rootProject.ext.ZIP_NAME_PREFIX}_${p.name}.zip"
it.destinationDirectory = rootProject.ext.DISTRIBUTION_DIR
// Make sure that we don't try to copy the same file with the same path into the
// zip (this can happen!)
duplicatesStrategy 'exclude'
duplicatesStrategy = 'exclude'
// Exclude any files that contain "delete.me" in the path; this is a convention we used
// at one time that should be removed.

View file

@ -31,23 +31,25 @@
/*********************************************************************************
* Defines the main ip task for each subproject
*********************************************************************************/
task ip {
task ip {
def p = project
doLast {
// scans all the files in the module, reads ip from header, verifies ip, and creates mapping
def ipToFileMap = getIpForModule(project)
def ipToFileMap = getIpForModule(p)
// reads the ip info from the Module.manifest file and verifies each ip
def moduleManifestIpMap = getModuleManifestIp(project)
def moduleManifestIpMap = getModuleManifestIp(p)
// gets the external libs from gradle and verifies they are accounted for in the Module.manifest file
checkExternalLibsInMap(moduleManifestIpMap, project)
checkExternalLibsInMap(moduleManifestIpMap, p)
// adds the ip info from the Module.manifest file to the map generated from scanning the module files.
addModuleManifestIp(ipToFileMap, moduleManifestIpMap)
// writes the LICENSE.txt file for the module
writeLicenseInfo(project, ipToFileMap)
writeLicenseInfo(p, ipToFileMap)
}
}
rootProject.assembleDistribution.dependsOn ip
@ -177,6 +179,7 @@ def isCSourceFile(File file) {
return filename.endsWith(".java") ||
filename.endsWith(".c") ||
filename.endsWith(".gradle") ||
filename.endsWith(".gradle.kts") ||
filename.endsWith(".groovy") ||
filename.endsWith(".cpp") ||
filename.endsWith(".cc") ||