This repository has been archived by the owner on Oct 5, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Default version strategies are undeprecated
This fixes #182. The change for #180 was short-sighted and ignored the reason default strategies existed in the first place. This new fix puts the old behavior back while still preserving the slightly better error messages introduced in 1.5.0. This solution is not pretty, and I'd like to use something else but this will do for now (probably until 2.0.0).
- Loading branch information
1 parent
56ee905
commit f3b4c19
Showing
4 changed files
with
90 additions
and
7 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
src/main/groovy/org/ajoberstar/gradle/git/release/base/DefaultVersionStrategy.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright 2012-2015 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.ajoberstar.gradle.git.release.base | ||
|
||
import org.ajoberstar.grgit.Grgit | ||
|
||
import org.gradle.api.Project | ||
|
||
/** | ||
* Strategy to infer a version from the project's and Git repository's state. This | ||
* also supports being selected as a default strategy. This is a temporary interface | ||
* and should be replaced in some other way in gradle-git 2.0.0. | ||
* @see org.ajoberstar.gradle.git.release.semver.SemVerStrategy | ||
* @see org.ajoberstar.gradle.git.release.opinion.Strategies | ||
*/ | ||
interface DefaultVersionStrategy extends VersionStrategy { | ||
/** | ||
* Determines if the strategy can be used as a default strategy for inferring | ||
* the project's version. A return of {@code false} does not mean that the | ||
* strategy cannot be used as the default. | ||
* @param project the project the version should be inferred for | ||
* @param grgit the repository the version should be inferred from | ||
* @return {@code true} if the strategy can be used to infer the version | ||
*/ | ||
boolean defaultSelector(Project project, Grgit grgit) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters