Package io.github.cdklabs.projen
Class TextFile.Builder
- java.lang.Object
-
- io.github.cdklabs.projen.TextFile.Builder
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TextFilebuild()TextFile.Buildercommitted(Boolean committed)(experimental) Indicates whether this file should be committed to git or ignored.static TextFile.Buildercreate(software.constructs.IConstruct scope, String filePath)TextFile.BuildereditGitignore(Boolean editGitignore)(experimental) Update the project's .gitignore file.TextFile.Builderexecutable(Boolean executable)(experimental) Whether the generated file should be marked as executable.TextFile.Builderlines(List<String> lines)(experimental) The contents of the text file.TextFile.Buildermarker(Boolean marker)(experimental) Adds the projen marker to the file.TextFile.Builderreadonly(Boolean readonly)(experimental) Whether the generated file should be readonly.
-
-
-
Method Detail
-
create
@Stability(Experimental) public static TextFile.Builder create(software.constructs.IConstruct scope, String filePath)
- Parameters:
scope- This parameter is required.filePath- File path. This parameter is required.- Returns:
- a new instance of
TextFile.Builder.
-
committed
@Stability(Experimental) public TextFile.Builder committed(Boolean committed)
(experimental) Indicates whether this file should be committed to git or ignored.By default, all generated files are committed and anti-tamper is used to protect against manual modifications.
Default: true
- Parameters:
committed- Indicates whether this file should be committed to git or ignored. This parameter is required.- Returns:
this
-
editGitignore
@Stability(Experimental) public TextFile.Builder editGitignore(Boolean editGitignore)
(experimental) Update the project's .gitignore file.Default: true
- Parameters:
editGitignore- Update the project's .gitignore file. This parameter is required.- Returns:
this
-
executable
@Stability(Experimental) public TextFile.Builder executable(Boolean executable)
(experimental) Whether the generated file should be marked as executable.Default: false
- Parameters:
executable- Whether the generated file should be marked as executable. This parameter is required.- Returns:
this
-
marker
@Stability(Experimental) public TextFile.Builder marker(Boolean marker)
(experimental) Adds the projen marker to the file.Default: - marker will be included as long as the project is not ejected
- Parameters:
marker- Adds the projen marker to the file. This parameter is required.- Returns:
this
-
readonly
@Stability(Experimental) public TextFile.Builder readonly(Boolean readonly)
(experimental) Whether the generated file should be readonly.Default: true
- Parameters:
readonly- Whether the generated file should be readonly. This parameter is required.- Returns:
this
-
lines
@Stability(Experimental) public TextFile.Builder lines(List<String> lines)
(experimental) The contents of the text file.You can use
addLine()to append lines.Default: [] empty file
- Parameters:
lines- The contents of the text file. This parameter is required.- Returns:
this
-
-