ghidra/gradle/root/venv.gradle

17 lines
796 B
Groovy
Raw Normal View History

2024-09-09 13:56:46 +00:00
/******************************************************************************************
* TASK createPythonVirtualEnvironment
*
* Summary: Creates a Python virtual environment directory at "build/venv"
******************************************************************************************/
task createPythonVirtualEnvironment(type: Exec) {
def venvDir = "build/venv"
def binDir = isCurrentWindows() ? "Scripts" : "bin"
def suffix = isCurrentWindows() ? ".exe" : "3"
project.ext.PYTHON3_VENV = "${rootProject.projectDir}/${venvDir}/${binDir}/python${suffix}"
project.ext.PIP3_VENV = "${rootProject.projectDir}/${venvDir}/${binDir}/pip${suffix}"
commandLine rootProject.PYTHON3, "-m", "venv", venvDir, "--copies"
}
rootProject.prepDev.dependsOn createPythonVirtualEnvironment