io.github.cdklabs.projen.python.Projenrc Maven / Gradle / Ivy
Show all versions of projen Show documentation
package io.github.cdklabs.projen.python;
/**
* (experimental) Allows writing projenrc files in python.
*
* This will install projen
as a Python dependency and will add a
* synth
task which will run .projenrc.py
.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.105.0 (build 0a2adcb)", date = "2024-11-15T17:03:55.385Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = io.github.cdklabs.projen.$Module.class, fqn = "projen.python.Projenrc")
public class Projenrc extends io.github.cdklabs.projen.ProjenrcFile {
protected Projenrc(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected Projenrc(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param project This parameter is required.
* @param options
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Projenrc(final @org.jetbrains.annotations.NotNull io.github.cdklabs.projen.Project project, final @org.jetbrains.annotations.Nullable io.github.cdklabs.projen.python.ProjenrcOptions options) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(project, "project is required"), options });
}
/**
* @param project This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Projenrc(final @org.jetbrains.annotations.NotNull io.github.cdklabs.projen.Project project) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(project, "project is required") });
}
/**
* (experimental) The name of the projenrc file.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.lang.String getFilePath() {
return software.amazon.jsii.Kernel.get(this, "filePath", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* (experimental) Path to the python executable to use.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.lang.String getPythonExec() {
return software.amazon.jsii.Kernel.get(this, "pythonExec", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* (experimental) A fluent builder for {@link io.github.cdklabs.projen.python.Projenrc}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
* @param project This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static Builder create(final io.github.cdklabs.projen.Project project) {
return new Builder(project);
}
private final io.github.cdklabs.projen.Project project;
private io.github.cdklabs.projen.python.ProjenrcOptions.Builder options;
private Builder(final io.github.cdklabs.projen.Project project) {
this.project = project;
}
/**
* (experimental) The name of the projenrc file.
*
* Default: ".projenrc.py"
*
* @return {@code this}
* @param filename The name of the projenrc file. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder filename(final java.lang.String filename) {
this.options().filename(filename);
return this;
}
/**
* (experimental) The projen version to use.
*
* Default: - current version
*
* @return {@code this}
* @param projenVersion The projen version to use. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder projenVersion(final java.lang.String projenVersion) {
this.options().projenVersion(projenVersion);
return this;
}
/**
* (experimental) Path to the python executable to use.
*
* Default: "python"
*
* @return {@code this}
* @param pythonExec Path to the python executable to use. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder pythonExec(final java.lang.String pythonExec) {
this.options().pythonExec(pythonExec);
return this;
}
/**
* @return a newly built instance of {@link io.github.cdklabs.projen.python.Projenrc}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public io.github.cdklabs.projen.python.Projenrc build() {
return new io.github.cdklabs.projen.python.Projenrc(
this.project,
this.options != null ? this.options.build() : null
);
}
private io.github.cdklabs.projen.python.ProjenrcOptions.Builder options() {
if (this.options == null) {
this.options = new io.github.cdklabs.projen.python.ProjenrcOptions.Builder();
}
return this.options;
}
}
}