GP-5179: Improvements to pyghidra_launcher.py

* Specifying supported Python versions in application.properties
so other things can get access to it (similar to how we do it for Java
and Gradle supported versions)

* Only try to launch PyGhidra with a supported version of Python
This commit is contained in:
Ryan Kurtz
2024-12-09 14:22:54 -05:00
parent 18aa9a48f8
commit 6443e97b64
9 changed files with 128 additions and 55 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ task buildPyPackage {
doLast {
if (rootProject.PYTHON3 == null) {
throw new GradleException("A supported version of Python ${SUPPORTED_PY_VERSIONS} was not found!")
throw new GradleException("A supported version of Python [${PYTHON_SUPPORTED}] was not found!")
}
File setuptools = project(":Debugger-rmi-trace").findPyDep(".")
+1 -1
View File
@@ -271,7 +271,7 @@ task createGhidraStubsWheel {
File setuptools = project(":Debugger-rmi-trace").findPyDep(".")
if (PYTHON3 == null) {
throw new GradleException("A supported version of Python ${SUPPORTED_PY_VERSIONS} was not found!")
throw new GradleException("A supported version of Python [${PYTHON_SUPPORTED}] was not found!")
}
exec {
+1 -1
View File
@@ -27,7 +27,7 @@ task createPythonVirtualEnvironment(type: Exec) {
doFirst {
if (rootProject.PYTHON3 == null) {
throw new GradleException("A supported version of Python ${SUPPORTED_PY_VERSIONS} was not found!")
throw new GradleException("A supported version of Python [${PYTHON_SUPPORTED}] was not found!")
}
commandLine rootProject.PYTHON3
@@ -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.
@@ -28,6 +28,7 @@ file("Ghidra/application.properties").withReader { reader ->
project.ext.JAVA_COMPILER = ghidraProps.getProperty('application.java.compiler')
project.ext.GRADLE_MIN = ghidraProps.getProperty('application.gradle.min')
project.ext.GRADLE_MAX = ghidraProps.getProperty('application.gradle.max')
project.ext.PYTHON_SUPPORTED = ghidraProps.getProperty('application.python.supported')
project.ext.DISTRO_PREFIX = "ghidra_${version}_${RELEASE_NAME}"
// Build dates may or may not be already present in the application.properties file.