-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
project.version set when updateProjectVersionAfterRelease flag is ena…
…bled | fixes #806
- Loading branch information
Showing
12 changed files
with
203 additions
and
13 deletions.
There are no files selected for viewing
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
13 changes: 13 additions & 0 deletions
13
src/main/groovy/pl/allegro/tech/build/axion/release/ConfigurationCacheConfiguration.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,13 @@ | ||
package pl.allegro.tech.build.axion.release | ||
|
||
class ConfigurationCacheConfiguration { | ||
boolean updateProjectVersionAfterRelease | ||
boolean configurationCacheEnabled | ||
public Closure<String> updateProjectVersion | ||
|
||
ConfigurationCacheConfiguration(boolean updateProjectVersionAfterRelease, boolean configurationCacheEnabled, Closure<String> updateProjectVersion) { | ||
this.updateProjectVersionAfterRelease = updateProjectVersionAfterRelease | ||
this.configurationCacheEnabled = configurationCacheEnabled | ||
this.updateProjectVersion = updateProjectVersion | ||
} | ||
} |
17 changes: 14 additions & 3 deletions
17
src/main/groovy/pl/allegro/tech/build/axion/release/CreateReleaseTask.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 |
---|---|---|
@@ -1,20 +1,31 @@ | ||
package pl.allegro.tech.build.axion.release | ||
|
||
import org.gradle.api.tasks.Input | ||
import org.gradle.api.tasks.TaskAction | ||
import pl.allegro.tech.build.axion.release.domain.Releaser | ||
import pl.allegro.tech.build.axion.release.domain.scm.ScmService | ||
import pl.allegro.tech.build.axion.release.infrastructure.di.VersionResolutionContext | ||
|
||
abstract class CreateReleaseTask extends BaseAxionTask { | ||
|
||
@Input | ||
boolean configurationCacheEnabled | ||
|
||
@TaskAction | ||
void release() { | ||
VersionResolutionContext context = resolutionContext() | ||
Releaser releaser = context.releaser() | ||
ScmService scmService = context.scmService() | ||
ReleaseBranchesConfiguration releaseBranchesConfiguration = new ReleaseBranchesConfiguration( | ||
context.scmService().isReleaseOnlyOnReleaseBranches(), | ||
scmService.isReleaseOnlyOnReleaseBranches(), | ||
context.repository().currentPosition().getBranch(), | ||
context.scmService().getReleaseBranchNames() | ||
scmService.getReleaseBranchNames() | ||
) | ||
ConfigurationCacheConfiguration configurationCacheConfiguration = new ConfigurationCacheConfiguration( | ||
scmService.isUpdateProjectVersionAfterRelease(), | ||
configurationCacheEnabled, | ||
(version) -> project.setVersion(version) | ||
) | ||
releaser.release(context.rules(), releaseBranchesConfiguration) | ||
releaser.release(context.rules(), releaseBranchesConfiguration, configurationCacheConfiguration) | ||
} | ||
} |
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
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
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
Oops, something went wrong.