| import org.apache.tools.ant.taskdefs.condition.Os | |
| plugins { | |
| id "com.jetbrains.python.envs" version "0.0.30" | |
| } | |
| ext { | |
| pydevDir = new File(projectDir, '/../../../helpers/pydev/') | |
| } | |
| envs { | |
| String python27version = "2.7.16" | |
| String python35version = "3.5.7" | |
| String python36version = "3.6.8" | |
| String python37version = "3.7.6" | |
| String python38version = "3.8.1" | |
| def customBuildDir = System.getenv().get("PYCHARM_BUILD_DIR") | |
| project.buildDir = customBuildDir? new File(customBuildDir): buildDir | |
| bootstrapDirectory = new File(buildDir, 'pythons') | |
| envsDirectory = new File(buildDir, 'envs') | |
| zipRepository = new URL("https://repo.labs.intellij.net/pycharm/python-archives-windows/") | |
| shouldUseZipsFromRepository = Os.isFamily(Os.FAMILY_WINDOWS) | |
| python "python27_64", python27version, "64" | |
| virtualenv "py27_64", "python27_64", ["cython"] | |
| python "python35_64", python35version, "64" | |
| virtualenv "py35_64", "python35_64", ["cython"] | |
| python "python36_64", python36version, "64" | |
| virtualenv "py36_64", "python36_64", ["cython"] | |
| python "python37_64", python37version, "64" | |
| virtualenv "py37_64", "python37_64", ["cython"] | |
| python "python38_64", python38version, "64" | |
| virtualenv "py38_64", "python38_64", ["cython"] | |
| if (Os.isFamily(Os.FAMILY_WINDOWS)) { | |
| python "python27_32", python27version, "32" | |
| virtualenv "py27_32", "python27_32", ["cython"] | |
| python "python35_32", python35version, "32" | |
| virtualenv "py35_32", "python35_32", ["cython"] | |
| python "python36_32", python36version, "32" | |
| virtualenv "py36_32", "python36_32", ["cython"] | |
| python "python37_32", python37version, "32" | |
| virtualenv "py37_32", "python37_32", ["cython"] | |
| python "python38_32", python38version, "32" | |
| virtualenv "py38_32", "python38_32", ["cython"] | |
| } | |
| } | |
| task buildBinariesOnWindows(dependsOn: 'build_envs') << { | |
| exec { | |
| workingDir pydevDir | |
| environment PYTHONPATH: pydevDir, | |
| MINICONDA32_ENVS: envs.envsDirectory, | |
| MINICONDA64_ENVS: envs.envsDirectory | |
| commandLine "${envs.envsDirectory}/py27_32/Scripts/python.exe", "build_tools/build_binaries_windows.py" | |
| } | |
| } | |
| task buildBinariesOnMac(dependsOn: 'build_envs') << { | |
| exec { | |
| workingDir pydevDir | |
| environment PYTHONPATH: pydevDir, | |
| MINICONDA64_ENVS: envs.envsDirectory | |
| commandLine "${envs.envsDirectory}/py37_64/bin/python", "build_tools/build_binaries_osx.py" | |
| } | |
| } | |
| task buildBinaries() { | |
| if (Os.isFamily(Os.FAMILY_WINDOWS)) { | |
| dependsOn buildBinariesOnWindows | |
| } | |
| else if (Os.isFamily(Os.FAMILY_MAC)) { | |
| dependsOn buildBinariesOnMac | |
| } | |
| } | |
| task wrapper(type: Wrapper) << { | |
| gradleVersion = '4.2' | |
| } |