Skip to content

Commit

Permalink
HHH-12190 - General tidying of Gradle scripts
Browse files Browse the repository at this point in the history
- adding `ciBuild` task, standardizing `release` task
  • Loading branch information
sebersole committed Jan 22, 2018
1 parent 3e55562 commit 9e20eec
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 19 deletions.
25 changes: 13 additions & 12 deletions build.gradle
Expand Up @@ -48,25 +48,26 @@ allprojects {


// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Link together all release tasks
// Release Task

// relies on the fact that subprojects will appropriately define a release task
// themselves if they have any release-related activities to perform
task release {
doFirst {
println "Starting version $project.hibernateVersion release"
}
description = "The task performed when we are performing a release build. Relies on " +
"the fact that subprojects will appropriately define a release task " +
"themselves if they have any release-related activities to perform"
}


task ciBuild
if ( project.isSnapshot ) {
// only run the ci build tasks for SNAPSHOT versions
tasks.ciBuild.dependsOn clean
tasks.ciBuild.dependsOn test
tasks.ciBuild.dependsOn publish
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CI Build Task

task ciBuild {
description = "The task performed when one of the 'main' jobs are triggered on the " +
"CI server. Just as above, relies on the fact that subprojects will " +
"appropriately define a release task themselves if they have any tasks " +
"which should be performed from these CI jobs"
}


task wrapper(type: Wrapper) {
gradleVersion = '4.4'
distributionType = 'ALL'
Expand Down
8 changes: 8 additions & 0 deletions documentation/documentation.gradle
Expand Up @@ -63,6 +63,14 @@ dependencies {
}


if ( project.isSnapshot ) {
// only run the ci build tasks for SNAPSHOT versions
task ciBuild( dependsOn: [clean, test] )
}
else {
task release( dependsOn: [clean, test] )
}

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// grouping tasks - declaration, see below for task dependency definitions
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
14 changes: 7 additions & 7 deletions gradle/published-java-module.gradle
Expand Up @@ -8,8 +8,13 @@
apply from: rootProject.file( 'gradle/java-module.gradle' )
apply plugin: 'maven-publish'
apply plugin: 'maven-publish-auth'
apply from: rootProject.file( 'gradle/publishing-repos.gradle' )
apply from: rootProject.file( 'gradle/publishing-pom.gradle' )
apply from: rootProject.file( 'gradle/publishing-repos.gradle' )


task ciBuild( dependsOn: [clean, test, publish] )

task release( dependsOn: [clean, test, publish] )


// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -63,6 +68,7 @@ jar {
}
}


task sourcesJar(type: Jar) {
from project.sourceSets.main.allSource
manifest = project.tasks.jar.manifest
Expand Down Expand Up @@ -143,9 +149,3 @@ model {

task generatePomFile( dependsOn: 'generatePomFileForPublishedArtifactsPublication' )


task release( dependsOn: publish ) {
doFirst {
println "Starting release for $project.name:$project.version"
}
}
8 changes: 8 additions & 0 deletions hibernate-orm-modules/hibernate-orm-modules.gradle
Expand Up @@ -210,3 +210,11 @@ processTestResources {
}


if ( project.isSnapshot ) {
// only run the ci build tasks for SNAPSHOT versions
task ciBuild( dependsOn: [clean, test] )
}
else {
task release( dependsOn: [clean, test] )
}

0 comments on commit 9e20eec

Please sign in to comment.