4545public abstract class GitCommitIdPluginOutputSettingsExtension {
4646
4747 /**
48- * Configuration option to enable or disable the generation of a properties file.
48+ * Configuration option to enable or disable the generation of an output file.
4949 * To enable such generation, set this to {@code true}.
5050 * By default, this setting is disabled (set to {@code false}).
5151 *
52- * <p>To configure the location of the properties file refer to
53- * {@link #getGenerateGitPropertiesFilename ()}, to configure the format (json, properties, ...)
54- * of this file refer to {@link #getGenerateGitPropertiesFormat ()}.
52+ * <p>To configure the location of the output file refer to
53+ * {@link #getOutputFile ()}, to configure the format (json, properties, ...)
54+ * of this file refer to {@link #getOutputFormat ()}.
5555 */
56- public abstract Property <Boolean > getGenerateGitPropertiesFile ();
56+ public abstract Property <Boolean > getShouldGenerateOutputFile ();
5757
5858 /**
59- * Configuration location of a properties file that can be generated by the plugin.
60- * Defaults to {@code ${project.getBuildDir()}/git.properties}.
59+ * Configuration location of an output file that can be generated by the plugin.
60+ * Defaults to {@code ${project.getBuildDir()}/git.properties}, formatted as "properties" file .
6161 *
62- * <p>To enable or disable the generation of such properties file refer to
63- * {@link #getGenerateGitPropertiesFile ()}, to configure the format (json, properties, ...)
64- * of this file refer to {@link #getGenerateGitPropertiesFormat ()}.
62+ * <p>To enable or disable the generation of such output file refer to
63+ * {@link #getShouldGenerateOutputFile ()}, to configure the format (json, properties, ...)
64+ * of this file refer to {@link #getOutputFormat ()}.
6565 */
6666 // @OutputFile
67- public abstract RegularFileProperty getGenerateGitPropertiesFilename ();
67+ public abstract RegularFileProperty getOutputFile ();
6868
6969 /**
7070 * Configuration option to enable or disable unicode escaping in the generated properties file.
@@ -84,19 +84,21 @@ public abstract class GitCommitIdPluginOutputSettingsExtension {
8484 * <p>Hence by default this setting is set to {@code false}.
8585 * If you so desire and wish for unicode escaping (e.g. \\u6E2C\\u8A66\\u4E2D\\u6587) you
8686 * can set this to {@code true}.
87+ *
88+ * <p>Only applies if the {@link #getOutputFormat()} is instructed to generate a "properties" file</p>
8789 */
88- public abstract Property <Boolean > getGenerateGitPropertiesFileWithEscapedUnicode ();
90+ public abstract Property <Boolean > getShouldEscapedUnicodeForPropertiesOutput ();
8991
9092 /**
91- * Allows to configure the format (json, properties, ...) in which the properties
93+ * Allows to configure the format (json, properties, ...) in which the output file
9294 * should be saved in.
9395 * To enable or disable the generation of such properties file refer to
94- * {@link #getGenerateGitPropertiesFile ()} and to configure the location
95- * of the properties file refer to {@link #getGenerateGitPropertiesFilename ()}.
96+ * {@link #getShouldGenerateOutputFile ()} and to configure the location
97+ * of the properties file refer to {@link #getOutputFile ()}.
9698 *
9799 * <p>By default will assume that the desired format is "properties".
98100 */
99- public abstract Property <CommitIdPropertiesOutputFormat > getGenerateGitPropertiesFormat ();
101+ public abstract Property <CommitIdPropertiesOutputFormat > getOutputFormat ();
100102
101103 @ Inject
102104 public ProjectLayout getProjectLayout () {
@@ -108,12 +110,12 @@ public ProjectLayout getProjectLayout() {
108110 */
109111 @ Inject
110112 public GitCommitIdPluginOutputSettingsExtension () {
111- getGenerateGitPropertiesFile ()
113+ getShouldGenerateOutputFile ()
112114 .convention (false );
113- getGenerateGitPropertiesFilename ().convention (
115+ getOutputFile ().convention (
114116 getProjectLayout ().getBuildDirectory ().file ("git.properties" ));
115- getGenerateGitPropertiesFileWithEscapedUnicode ().convention (false );
116- getGenerateGitPropertiesFormat ()
117+ getShouldEscapedUnicodeForPropertiesOutput ().convention (false );
118+ getOutputFormat ()
117119 .convention (CommitIdPropertiesOutputFormat .PROPERTIES );
118120 }
119121}
0 commit comments