diff --git a/python/tools/src/com/jetbrains/python/tools/BuildZippedSkeletons.kt b/python/tools/src/com/jetbrains/python/tools/BuildZippedSkeletons.kt index dc7891b9425d..8158fcdcd242 100644 --- a/python/tools/src/com/jetbrains/python/tools/BuildZippedSkeletons.kt +++ b/python/tools/src/com/jetbrains/python/tools/BuildZippedSkeletons.kt @@ -41,6 +41,10 @@ fun main(args: Array) { try { val root = System.getenv(PYCHARM_PYTHONS) + val workingDir = System.getProperty("user.dir") + + val cacheDir = File(workingDir, "cache") + println("Skeletons will share common cache at $cacheDir") for (python in File(root).listFiles()) { @@ -50,8 +54,7 @@ fun main(args: Array) { val sdk = PySdkTools.createTempSdk(VfsUtil.findFileByIoFile(File(executable), true)!!, SdkCreationType.SDK_PACKAGES_ONLY, null) - val skeletonsDir = File(System.getProperty("user.dir"), - "skeletons-${sdk.versionString!!.replace(" ", "_")}_" + Math.abs(sdk.homePath!!.hashCode())) + val skeletonsDir = File(workingDir, "skeletons-${sdk.versionString!!.replace(" ", "_")}_" + Math.abs(sdk.homePath!!.hashCode())) println("Generating skeletons in ${skeletonsDir.absolutePath}") @@ -61,7 +64,9 @@ fun main(args: Array) { refresher.regenerateSkeletons(SkeletonVersionChecker(SkeletonVersionChecker.PREGENERATED_VERSION)) - val dirPacked = File(skeletonsDir.parent, DefaultPregeneratedSkeletonsProvider.getPregeneratedSkeletonsName(sdk, refresher.generatorVersion, true, true)) + val artifactName = DefaultPregeneratedSkeletonsProvider.getPregeneratedSkeletonsName(sdk, refresher.generatorVersion, true, true) + val dirPacked = File(skeletonsDir.parent, artifactName!!) + println("Creating artifact $dirPacked") ZipOutputStream(FileOutputStream(dirPacked)).use { ZipUtil.addDirToZipRecursively(it, dirPacked, skeletonsDir, "", null, null) }