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

@ -35,8 +35,8 @@ def srcVersion24 = "src/demangler_gnu_v2_24"
*/
task zipBuildableSource(type:Zip) {
group 'private'
description "Collects the source files needed to build this module."
group = 'private'
description = "Collects the source files needed to build this module."
archiveBaseName = project.name + "-src-for-build"
archiveExtension = 'zip'

View file

@ -76,8 +76,8 @@ gradle.taskGraph.whenReady {
* Task to unpack the standard binutils zip file
*******************************************************************************************/
task binutilsUnpack {
description "Unpack binutils (for building gdis)"
group "Native Build Dependencies"
description = "Unpack binutils (for building gdis)"
group = "Native Build Dependencies"
outputs.file { binutilsUnpackDir }
onlyIf { !binutilsUnpackDir.exists() }
@ -104,8 +104,8 @@ supportedPlatforms.each { platform ->
def artifactsDir = file("build/binutils/${platform}")
task(buildName) {
description "Configure and make binutils for $platform (for building gdis)"
group "Native Prebuild Dependencies"
description ="Configure and make binutils for $platform (for building gdis)"
group = "Native Prebuild Dependencies"
onlyIf { !configDir.exists() }
@ -122,21 +122,21 @@ supportedPlatforms.each { platform ->
println "Configuring binutils - config directory: $configDir"
println "${binutilsDir}/configure --prefix=\"${configDir}\" --enable-targets=all --with-zlib=no --disable-nls --disable-werror"
configDir.mkdirs();
exec {
providers.exec {
workingDir configDir
commandLine "${binutilsDir}/configure", "--prefix=${configDir}", "--enable-targets=all", "--with-zlib=no", "--disable-nls", "--disable-werror"
}
}.result.get()
println "Building binutils - config directory: $configDir"
exec {
providers.exec {
commandLine "make", "-C", "${configDir}", "all"
}
}.result.get()
}
}
task(postBuildName, type: Copy) {
description "Copy binutil artifcacts for $platform (for building gdis)"
group "Native Prebuild Dependencies"
description = "Copy binutil artifcacts for $platform (for building gdis)"
group = "Native Prebuild Dependencies"
dependsOn buildName

View file

@ -66,7 +66,7 @@ model {
// specify installDir because Gradle doesn't find VS Build Tools.
// See https://github.com/gradle/gradle-native/issues/617#issuecomment-575735288
visualCpp(VisualCpp) {
installDir VISUAL_STUDIO_INSTALL_DIR
installDir = VISUAL_STUDIO_INSTALL_DIR
}
}
}

View file

@ -19,7 +19,6 @@ apply from: "$rootProject.projectDir/gradle/javaTestProject.gradle"
apply from: "$rootProject.projectDir/gradle/nativeProject.gradle"
apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle"
apply from: "$rootProject.projectDir/gradle/hasPythonPackage.gradle"
apply from: "$rootProject.projectDir/gradle/debugger/hasNodepJar.gradle"
apply plugin: 'eclipse'
eclipse.project.name = 'Debug Debugger-agent-dbgeng'

View file

@ -19,7 +19,6 @@ apply from: "$rootProject.projectDir/gradle/javaTestProject.gradle"
apply from: "$rootProject.projectDir/gradle/nativeProject.gradle"
apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle"
apply from: "$rootProject.projectDir/gradle/hasPythonPackage.gradle"
apply from: "$rootProject.projectDir/gradle/debugger/hasExecutableJar.gradle"
apply plugin: 'eclipse'
eclipse.project.name = 'Debug Debugger-agent-gdb'

View file

@ -1,22 +0,0 @@
#!/usr/bin/bash
## ###
# 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.
##
# This clever bit can be prepended to a JAR to make it self-executable
set -e
java -jar "$0" ${@:1}
exit

View file

@ -19,7 +19,6 @@ apply from: "$rootProject.projectDir/gradle/javaTestProject.gradle"
apply from: "$rootProject.projectDir/gradle/nativeProject.gradle"
apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle"
apply from: "$rootProject.projectDir/gradle/hasPythonPackage.gradle"
apply from: "$rootProject.projectDir/gradle/debugger/hasExecutableJar.gradle"
apply plugin: 'eclipse'
eclipse.project.name = 'Debug Debugger-agent-lldb'

View file

@ -50,10 +50,10 @@ task generateProtoPy {
if (!isCurrentWindows()) {
exe.setExecutable(true)
}
exec {
providers.exec {
commandLine exe, "--python_out=$outdir", "-I$srcdir"
args src
}
}.result.get()
}
}

View file

@ -89,7 +89,7 @@ task elasticPluginJar(type: Jar) {
task elasticPluginZip(type: Zip) {
from 'build/ziplayout'
archiveBaseName = 'lsh'
destinationDirectory = file("build/data")
destinationDirectory = file("build/data")
}
// Currently targeting elasticsearch-8.8.1 which by default runs with java 20

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.
@ -112,7 +112,7 @@ task zipExtensions(type: Zip, dependsOn:jarTasks) {
archiveFileName = "${rootProject.ext.ZIP_NAME_PREFIX}_${p.name}.zip"
destinationDirectory = rootProject.ext.DISTRIBUTION_DIR
duplicatesStrategy 'exclude'
duplicatesStrategy = 'exclude'
from '.'

View file

@ -107,7 +107,7 @@ task buildBSimHelpPdf(type: Exec) {
"""
// Allows doLast block regardless of exit value.
ignoreExitValue true
ignoreExitValue = true
// Store the output instead of printing to the console.
standardOutput = new ByteArrayOutputStream()
@ -168,7 +168,7 @@ task buildBSimHelpHtml(type: Exec) {
"""
// Allows doLast block regardless of exit value.
ignoreExitValue true
ignoreExitValue = true
// Store the output instead of printing to the console.
standardOutput = new ByteArrayOutputStream()

View file

@ -76,8 +76,8 @@ sourceSets {
}
task buildCParser(type: JavaExec) {
group 'private'
description " Compiles the JavaCC files for the C parser\n"
group = 'private'
description = " Compiles the JavaCC files for the C parser\n"
def inputFile = "C.jj"
def packagePath = 'ghidra/app/util/cparser/C'
@ -96,8 +96,8 @@ task buildCParser(type: JavaExec) {
}
task buildCPPParser(type: JavaExec) {
group 'private'
description " Compiles the JavaCC files for the CPP parser\n"
group = 'private'
description = " Compiles the JavaCC files for the CPP parser\n"
def inputFile = "CPP.jj"
def packagePath = 'ghidra/app/util/cparser/CPP'
@ -119,15 +119,15 @@ task buildCPPParser(type: JavaExec) {
// A public task to tie together private sub-tasks
task buildJavacc {
dependsOn buildCParser, buildCPPParser
group rootProject.GHIDRA_GROUP
description " Compiles the JavaCC files\n"
group = rootProject.GHIDRA_GROUP
description = " Compiles the JavaCC files\n"
}
// Note: this must happen before the standard buildHelp for Base
tasks.register('generateExtraHelpFiles') {
group = 'private'
description " Creates any extra help files for Base not covered by the standard build help system"
description = " Creates any extra help files for Base not covered by the standard build help system"
def rawTipsFile = file('src/main/resources/ghidra/app/plugin/core/totd/tips.txt')
inputs.file(rawTipsFile)

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.
@ -140,7 +140,7 @@ task buildDecompilerHelpHtml(type: Exec) {
"""
// Allows doLast block regardless of exit value.
ignoreExitValue true
ignoreExitValue = true
// Store the output instead of printing to the console.
standardOutput = new ByteArrayOutputStream()
@ -213,7 +213,7 @@ task buildDecompilerHelpPdf(type: Exec) {
"""
// Allows doLast block regardless of exit value. Task does not fail if bash command fails.
ignoreExitValue true
ignoreExitValue = true
// Store the output instead of printing to the console.
standardOutput = new ByteArrayOutputStream()
@ -283,7 +283,7 @@ task buildDecompilerDocumentationPdfs(type: Exec) {
"""
// Allows doLast block regardless of exit value. Task does not fail if bash command fails.
ignoreExitValue true
ignoreExitValue = true
// Store the output instead of printing to the console.
standardOutput = new ByteArrayOutputStream()
@ -357,7 +357,7 @@ task buildDecompilerDocumentationHtml(type: Exec) {
"""
// Allows doLast block regardless of exit value.
ignoreExitValue true
ignoreExitValue = true
// Store the output instead of printing to the console.
standardOutput = new ByteArrayOutputStream()

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.
@ -15,7 +15,7 @@
*/
apply plugin: 'eclipse'
eclipse.project {
name '_Decompiler'
name = '_Decompiler'
buildCommand 'org.eclipse.cdt.managedbuilder.core.genmakebuilder'
buildCommand 'org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder'
natures 'org.eclipse.cdt.core.cnature'

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.
@ -38,12 +38,13 @@ def fidDbFiles = fileTree(depsDir.exists() ? depsDir : binRepoDir) {
}
task unpackFidDatabases {
def p = project.file('build/data')
doLast {
fidDbFiles.each { file ->
// TODO: Preserve subdir path
def destName = file.name.replaceAll(/\.fidb$/, ".fidbf")
def destFile = new File(project.file('build/data'), destName)
def destFile = new File(p, destName)
if (!destFile.exists() || destFile.length() == 0 || destFile.lastModified() < file.lastModified()) {
logger.info("FIDB: ${file} -> ${destFile}");
@ -102,7 +103,7 @@ task buildFidHelpPdf(type: Exec) {
"""
// Allows doLast block regardless of exit value.
ignoreExitValue true
ignoreExitValue = true
// Store the output instead of printing to the console.
standardOutput = new ByteArrayOutputStream()
@ -167,7 +168,7 @@ task buildFidHelpHtml(type: Exec) {
"""
// Allows doLast block regardless of exit value.
ignoreExitValue true
ignoreExitValue = true
// Store the output instead of printing to the console.
standardOutput = new ByteArrayOutputStream()

View file

@ -54,11 +54,11 @@ CopySpec yajswCopySpec = copySpec {
}
// Unpack YAJSW archive into build/data for development use
task yajswDevUnpack(type:Copy) {
description "Unpack YAJSW archive for development use"
group "Development Preparation"
description = "Unpack YAJSW archive for development use"
group = "Development Preparation"
with yajswCopySpec
destinationDir file("build/data")
destinationDir = file("build/data")
}
/*********************************************************************************
* CLASSPATH FRAGMENT FILE: Production
@ -76,7 +76,7 @@ task yajswDevUnpack(type:Copy) {
* 3. Put the path in the output file.
*********************************************************************************/
task generateGhidraServerClasspath {
description "Generate a configuration fragment for the Ghidra Server's classpath (release)"
description = "Generate a configuration fragment for the Ghidra Server's classpath (release)"
File outfile = file("${buildDir}/classpath.frag")
outputs.file outfile
@ -84,6 +84,8 @@ task generateGhidraServerClasspath {
// Force the task to be executed every time by setting to false.
outputs.upToDateWhen { false }
def p = project
doLast {
outfile.parentFile.mkdirs()
outfile.withPrintWriter { out ->
@ -91,8 +93,8 @@ task generateGhidraServerClasspath {
configurations.runGhidraServer.each { jarFile ->
File distPath = file("/")
String resPath
for (Configuration conf : project.getConfigurations()) {
resPath = findJarInDistribution(project, conf, jarFile)
for (Configuration conf : p.getConfigurations()) {
resPath = findJarInDistribution(p, conf, jarFile)
if (resPath != null) {
out.println("wrapper.java.classpath.${++idx}=\${ghidra_home}/${resPath}")
break
@ -136,7 +138,7 @@ rootProject.assembleDistribution {
*
*********************************************************************************/
task generateDevGhidraServerClasspath {
description "Generate a configuration fragment for the Ghidra Server's classpath (development)"
description = "Generate a configuration fragment for the Ghidra Server's classpath (development)"
File outfile = file("${buildDir}/dev-meta/classpath.frag")
outputs.file outfile
@ -260,8 +262,7 @@ def String searchFilesForJar (proj, conf, jar) {
String resolution = null
if (conf.isCanBeResolved()) {
ResolvedConfiguration rc = conf.getResolvedConfiguration()
rc.getFiles().each { f ->
conf.getFiles().each { f ->
if (jar.equals(f)) {
resolution = rootProject.relativePath(proj.projectDir) + "/lib/" + f.name
}
@ -287,7 +288,9 @@ def String searchDependenciesForJar (proj, conf, jarFile) {
Set<ProjectDependency> projectDependencies = conf.getAllDependencies().withType(ProjectDependency)
for (ProjectDependency dependency : projectDependencies) {
Project dependencyProject = dependency.getDependencyProject()
Project dependencyProject = dependency.metaClass.respondsTo(dependency, "getPath")
? proj.project(dependency.path)
: dependency.getDependencyProject() // Remove this case after upgrading to 8.11 or later
Configuration depProjectConf = dependencyProject.getConfigurations().getByName(conf.getName())
relPath = findJarInDistribution(dependencyProject, depProjectConf, jarFile);
if (relPath != null) {

View file

@ -38,7 +38,7 @@ dependencies {
}
task jythonUnpack(type: Copy) {
description "Unpack Jython Lib"
description = "Unpack Jython Lib"
// Without this, the copyTask will unzip the file to check for "up to date"
onlyIf {
@ -48,15 +48,15 @@ task jythonUnpack(type: Copy) {
from zipTree(configurations.jython.singleFile)
include "Lib/**"
destinationDir file("build/data/${JYTHON_DIR}")
destinationDir = file("build/data/${JYTHON_DIR}")
}
task jythonSrcCopy(type: Copy) {
description "Copy jython-src directory (for Feature Jython)"
description = "Copy jython-src directory (for Feature Jython)"
from(file("jython-src"))
destinationDir file("build/data/jython-src")
destinationDir = file("build/data/jython-src")
}
// Ensure that Jython is usable in development xx

View file

@ -43,7 +43,7 @@ file(ghidraDir + "/application.properties").withReader { reader ->
checkGradleVersion()
task copyDependencies(type: Copy) {
group "Ghidra Private"
group = "Ghidra Private"
from configurations.runtimeClasspath
into "lib"
exclude { fileTreeElement ->
@ -77,7 +77,7 @@ def DISTRIBUTION_DIR = file("dist")
def pathInZip = "${project.name}"
task zipSource (type: Zip) {
group "Ghidra Private"
group = "Ghidra Private"
// Define some metadata about the zip (name, location, version, etc....)
it.archiveBaseName = project.name + "-src"
@ -91,7 +91,7 @@ task zipSource (type: Zip) {
}
task buildExtension (type: Zip) {
group "Ghidra Private"
group = "Ghidra Private"
archiveBaseName = "${ZIP_NAME_PREFIX}_${project.name}"
archiveExtension = 'zip'
@ -100,7 +100,7 @@ task buildExtension (type: Zip) {
// 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'
// This filtered property file copy must appear before the general
// copy to ensure that it is prefered over the unmodified file
@ -302,7 +302,7 @@ def hasJarHelp(File file) {
}
tasks.register('cleanHelp') {
group "Ghidra Private"
group = "Ghidra Private"
File helpOutput = file('build/help/main/help')
doFirst {
@ -312,7 +312,7 @@ tasks.register('cleanHelp') {
// Task for calling the java help indexer, which creates a searchable index of the help contents
tasks.register('indexHelp', JavaExec) {
group "Ghidra Private"
group = "Ghidra Private"
File helpRootDir = file('src/main/help/help')
File outputFile = file("build/help/main/help/${project.name}_JavaHelpSearch")
@ -362,7 +362,7 @@ tasks.register('indexHelp', JavaExec) {
// - the files generated will be placed in a diretory usable during development mode and will
// eventually be placed in the <Module>.jar file
tasks.register('buildHelp', JavaExec) {
group "Ghidra Private"
group = "Ghidra Private"
dependsOn 'indexHelp'
@ -436,7 +436,7 @@ tasks.register('buildHelp', JavaExec) {
// include the help into the module's jar
jar {
duplicatesStrategy 'exclude'
duplicatesStrategy = 'exclude'
from "build/help/main" // include the generated help index files
from "src/main/help" // include the help source files
archiveVersion = ""

View file

@ -104,10 +104,10 @@ task testSpecimenLinux_x86_64 {
dependsOn 'expTraceableSleepExecutable'//Linux_x86_64Executable'
doLast {
exec {
providers.exec {
workingDir "build/os/linux_x86_64"
commandLine "strip", "-o", "expSpin.stripped", "expSpin"
}
}.result.get()
}
}

View file

@ -59,20 +59,24 @@ compileJava.enabled = false
jar.enabled = false
task utilityJar(type:Copy) {
destinationDir file("build/data")
destinationDir = file("build/data")
from { project(':Utility').jar } // using closure to delay until all projects evaluated
def utilityProject = project(':Utility')
from { utilityProject.jar } // using closure to delay until all projects evaluated
}
task launchSupportJar(type:Copy) {
destinationDir file("build/data")
destinationDir = file("build/data")
from { project(':LaunchSupport').jar } // using closure to delay until all projects evaluated
def launchSupportProject = project(':LaunchSupport')
from { launchSupportProject.jar } // using closure to delay until all projects evaluated
}
task pyDevUnpack(type:Copy) {
description "Unpack PyDev plugin archive for development use"
group "Development Preparation"
description = "Unpack PyDev plugin archive for development use"
group = "Development Preparation"
File pyDevDestDir = file("build/data/buildDependencies/pydev")
@ -90,12 +94,12 @@ task pyDevUnpack(type:Copy) {
from pyDevZipTree
exclude "**/.project", "**/.pydevproject"
destinationDir pyDevDestDir
destinationDir = pyDevDestDir
}
task cdtUnpack(type:Copy) {
description "Unpack CDT plugin archive for development use"
group "Development Preparation"
description = "Unpack CDT plugin archive for development use"
group = "Development Preparation"
File cdtDestDir = file("build/data/buildDependencies/cdt")
@ -112,7 +116,7 @@ task cdtUnpack(type:Copy) {
from cdtZipTree
destinationDir cdtDestDir
destinationDir = cdtDestDir
}
task prepGhidraDev {

View file

@ -43,7 +43,7 @@ else {
}
task distributeExtension {
group "Ghidra"
group = "Ghidra"
apply from: new File(ghidraInstallDir).getCanonicalPath() + "/support/buildExtension.gradle"
dependsOn ':buildExtension'

View file

@ -160,14 +160,10 @@ def checkGradleVersion() {
*********************************************************************************/
def checkPythonVersion(List<String> pyCmd) {
try {
def stdout = new ByteArrayOutputStream()
exec {
return providers.exec {
commandLine pyCmd
args "-c", "import sys; print('{0}.{1}'.format(*sys.version_info))"
standardOutput = stdout
errorOutput = OutputStream.nullOutputStream()
}
return "$stdout".strip()
}.standardOutput.asText.get().strip()
}
catch (Exception e) {
return "ABSENT"
@ -176,14 +172,10 @@ def checkPythonVersion(List<String> pyCmd) {
def getPythonExecutable(List<String> pyCmd) {
try {
def stdout = new ByteArrayOutputStream()
exec {
return providers.exec {
commandLine pyCmd
args "-c", "import sys; print(sys.executable)"
standardOutput = stdout
errorOutput = OutputStream.nullOutputStream()
}
return "$stdout".strip()
}.standardOutput.asText.get().strip()
}
catch (Exception e) {
return "ABSENT"
@ -192,14 +184,10 @@ def getPythonExecutable(List<String> pyCmd) {
def checkPip(List<String> pyCmd, boolean shouldPrint) {
try {
def stdout = new ByteArrayOutputStream()
exec {
def version = providers.exec {
commandLine pyCmd
args "-c", "import pip; print(pip.__version__)"
standardOutput = stdout
errorOutput = OutputStream.nullOutputStream()
}
def version = "$stdout".strip();
}.standardOutput.asText.get().strip()
if (shouldPrint) {
if (version.length() == 0) {
println("Warning: Python3 pip not installed (required for build)")

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") ||