HHH-14083 Move the update to version.properties to a release task
This commit is contained in:
parent
fbbba7bff2
commit
b56ea9f140
|
@ -9,18 +9,13 @@ apply plugin: 'base'
|
|||
|
||||
File versionFile = file( "${rootProject.projectDir}/gradle/version.properties" )
|
||||
|
||||
if ( project.hasProperty( 'releaseVersion' ) ) {
|
||||
if ( !project.hasProperty( 'developmentVersion' ) ) {
|
||||
throw new GradleException(
|
||||
"When the releaseVersion parameter is specified, the parameter developmentVersion is required as well."
|
||||
)
|
||||
}
|
||||
versionFile.text = "hibernateVersion=${project.property( 'releaseVersion' )}"
|
||||
}
|
||||
|
||||
ext {
|
||||
ormVersionFile = versionFile
|
||||
ormVersion = HibernateVersion.fromFile( versionFile, project )
|
||||
// Override during releases
|
||||
if ( project.hasProperty( 'releaseVersion' ) ) {
|
||||
ormVersion = new HibernateVersion( project.releaseVersion, project )
|
||||
}
|
||||
baselineJavaVersion = '1.8'
|
||||
jpaVersion = new JpaVersion('2.2')
|
||||
}
|
||||
|
|
|
@ -253,10 +253,19 @@ if ( project.hasProperty( 'gitRemote' ) ) {
|
|||
gitRemote = project.property( 'gitRemote' )
|
||||
}
|
||||
|
||||
task updateChangeLogFile {
|
||||
task addVersionCommit {
|
||||
group = "Release"
|
||||
description = "Updates the changelog.txt file and push the changes to github"
|
||||
description = "Updates the changelog.txt file, adds a commit for the released version and push the changes to github"
|
||||
doFirst{
|
||||
if ( !project.hasProperty( 'releaseVersion' ) ) {
|
||||
throw new GradleException(
|
||||
"The releaseVersion parameter is necessary to create the version commit."
|
||||
)
|
||||
}
|
||||
|
||||
logger.lifecycle( "Updating version to '${project.releaseVersion}'..." )
|
||||
project.ormVersionFile.text = "hibernateVersion=${project.releaseVersion}"
|
||||
|
||||
logger.lifecycle( "Appending version '${project.releaseVersion}' to changelog..." )
|
||||
ChangeLogFile.update( ormVersion.fullName );
|
||||
|
||||
|
@ -295,8 +304,8 @@ task ciRelease() {
|
|||
}
|
||||
}
|
||||
|
||||
ciRelease.dependsOn updateChangeLogFile, release
|
||||
release.mustRunAfter updateChangeLogFile
|
||||
ciRelease.dependsOn addVersionCommit, release
|
||||
release.mustRunAfter addVersionCommit
|
||||
|
||||
static void executeGitCommand(Object ... subcommand){
|
||||
List<Object> command = ['git']
|
||||
|
|
Loading…
Reference in New Issue