Class PythonEmbedPlugin
java.lang.Object
io.github.howtis.pythonembed.gradle.PythonEmbedPlugin
- All Implemented Interfaces:
org.gradle.api.Plugin<org.gradle.api.Project>
public class PythonEmbedPlugin
extends Object
implements org.gradle.api.Plugin<org.gradle.api.Project>
Gradle plugin that creates a Python environment and installs specified packages
at build time.
If system Python is available, a standard venv is used. If not, a portable CPython is auto-downloaded from python-build-standalone.
The venv can be embedded in the JAR as a classpath resource (default) or kept external and referenced via a generated properties file.
Usage:
plugins {
id 'io.github.howtis.python-embed' version '1.0.0'
}
pythonEmbed {
packages = ['numpy==1.26.4']
venvOutputDir = layout.buildDirectory.dir('my-venv')
}
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classGeneratesMETA-INF/python-embed.propertieswith the venv path and embedded flag for runtime discovery. -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
PythonEmbedPlugin
public PythonEmbedPlugin()
-
-
Method Details
-
apply
public void apply(org.gradle.api.Project project) - Specified by:
applyin interfaceorg.gradle.api.Plugin<org.gradle.api.Project>
-