File tree Expand file tree Collapse file tree
src/main/java/io/github/git/commit/id/gradle/plugin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,16 +71,6 @@ public abstract class GitCommitIdPluginExtension {
7171 */
7272 public abstract Property <Boolean > getSkip ();
7373
74- /**
75- * When set to {@code true} this plugin will try to use the branch name from build environment.
76- * Set to {@code false} to use JGit/GIT to get current branch name which can be useful
77- * when using the JGitflow maven plugin. I'm not sure if there are similar plugins for gradle
78- * where this needs to set to {@code false}.
79- *
80- * <p>By default this is set to {@code true}.
81- */
82- public abstract Property <Boolean > getUseBranchNameFromBuildEnvironment ();
83-
8474 /**
8575 * Setup the default values / conventions for the GitCommitIdPluginExtension.
8676 */
@@ -92,7 +82,6 @@ public GitCommitIdPluginExtension() {
9282 getSkip ().convention (false );
9383 // commitIdGenerationMode
9484 // replacementProperties
95- getUseBranchNameFromBuildEnvironment ().convention (true );
9685 // injectIntoSysProperties
9786 // projectBuildOutputTimestamp
9887 }
Original file line number Diff line number Diff line change @@ -245,7 +245,8 @@ public CommitIdGenerationMode getCommitIdGenerationMode() {
245245
246246 @ Override
247247 public boolean getUseBranchNameFromBuildEnvironment () {
248- return extension .getUseBranchNameFromBuildEnvironment ().get ();
248+ return getGitCommitIdPluginGitSettingsExtension ()
249+ .getUseBranchNameFromBuildEnvironment ().get ();
249250 }
250251
251252 @ Override
Original file line number Diff line number Diff line change @@ -193,6 +193,16 @@ public abstract class GitCommitIdPluginGitSettingsExtension {
193193 */
194194 public abstract Property <Boolean > getShouldStayOffline ();
195195
196+ /**
197+ * When set to {@code true} this plugin will try to use the branch name from build environment.
198+ * Set to {@code false} to use JGit/GIT to get current branch name which can be useful
199+ * when using the JGitflow maven plugin. I'm not sure if there are similar plugins for gradle
200+ * where this needs to set to {@code false}.
201+ *
202+ * <p>By default this is set to {@code true}.
203+ */
204+ public abstract Property <Boolean > getUseBranchNameFromBuildEnvironment ();
205+
196206 @ Inject
197207 public ProjectLayout getProjectLayout () {
198208 throw new IllegalStateException ("Should have been injected!" );
@@ -213,5 +223,6 @@ public GitCommitIdPluginGitSettingsExtension() {
213223 getEvaluateOnCommit ().convention ("HEAD" );
214224 getNativeGitTimeoutInMs ().convention (30000L );
215225 getShouldStayOffline ().convention (true );
226+ getUseBranchNameFromBuildEnvironment ().convention (true );
216227 }
217228}
You can’t perform that action at this time.
0 commit comments