2016-06-27 08:07:08 -04:00
/ *
* Hibernate , Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License ( LGPL ) , version 2.1 or later .
* See the lgpl . txt file in the root directory or < http: //www.gnu.org/licenses/lgpl-2.1.html>.
* /
2018-01-10 16:06:58 -05:00
2018-01-20 18:05:40 -05:00
plugins {
2018-02-05 18:10:02 -05:00
id "org.wildfly.build.provision" version '0.0.5'
id "org.wildfly.build.featurepack" version '0.0.5'
2018-01-20 18:05:40 -05:00
}
2018-01-10 22:30:45 -05:00
apply from: rootProject . file ( 'gradle/base-information.gradle' )
2016-06-29 16:48:20 -04:00
apply plugin: 'java'
2018-01-10 22:30:45 -05:00
apply from: rootProject . file ( 'gradle/libraries.gradle' )
2016-06-29 16:48:20 -04:00
apply plugin: 'maven-publish'
apply plugin: 'maven-publish-auth'
2018-01-10 22:30:45 -05:00
apply from: rootProject . file ( 'gradle/publishing-repos.gradle' )
2018-01-17 23:47:31 -05:00
apply from: rootProject . file ( 'gradle/publishing-pom.gradle' )
2018-01-10 22:30:45 -05:00
2016-06-29 16:48:20 -04:00
apply plugin: 'build-dashboard'
apply plugin: 'project-report'
apply plugin: 'idea'
2018-01-10 17:52:28 -05:00
project . tasks . jar . enabled = false
project . tasks . javadoc . enabled = false
2018-01-10 16:06:58 -05:00
2016-06-27 08:07:08 -04:00
ext {
2018-02-05 18:10:02 -05:00
// NOTE : `wildflyVersion` comes from libraries.gradle...
2016-06-29 16:48:20 -04:00
2018-02-05 18:10:02 -05:00
// "10" for WildFly 10.x, "11" for 11.x, etc
wildFlyMajorVersion = project . wildflyVersion . split ( '\\.' ) [ 0 ]
2018-02-22 10:42:31 -05:00
bytebuddyVersion = project . byteBuddyVersion
2018-02-05 18:10:02 -05:00
artifactClassifier = "wildfly-${wildFlyMajorVersion}-dist"
wildFlyInstallDir = "$rootProject.buildDir/wildfly"
fpackStagingDir = file ( "target/featurepack" ) //Target build directory for the Feature Pack
2016-08-05 11:08:35 -04:00
}
2018-02-05 18:10:02 -05:00
description = "Feature Pack of Hibernate ORM modules for WildFly ${project.wildFlyMajorVersion}"
2016-06-27 08:07:08 -04:00
configurations {
2018-02-05 18:10:02 -05:00
featurePack {
description = "Dependencies to be included in the published Feature Pack"
}
provisioning {
description = "Dependencies which should be made available to the provisioning of WildFly"
}
2016-06-27 08:07:08 -04:00
}
2018-02-05 18:10:02 -05:00
repositories {
mavenLocal ( )
mavenCentral ( )
maven {
name 'jboss-nexus'
url "http://repository.jboss.org/nexus/content/groups/public/"
}
2018-01-20 18:05:40 -05:00
}
2018-02-05 18:10:02 -05:00
//This builds the WildFly Feature Packs which define the Hibernate ORM modules
// # Definitions of the modules are in /module-templates
// # Versions of the included libraries are defined in the "featurePack" configuration (below)
// # See the "variables" option to replace tokens in the module definitions
// # This just creates the exploded feature pack: does NOT create a zip nor a publication, which are handled by other tasks below.
featurepack {
moduleTemplates = file ( 'module-templates' ) //where to find the templates for module.xml files to generate
destinationDir = project . fpackStagingDir
configurationName 'featurePack'
// Variables to be replaced in the template. N.B. not all variables need to be replaced!
// Exact ORM version, e.g. "5.3.0.Final"
variables [ 'slot' ] = rootProject . hibernateVersion
// Just the minor ORM version, e.g. "5.3"; Is used as an alias for the exact version
variables [ 'minorSlot' ] = rootProject . hibernateMajorMinorVersion
2018-02-22 10:42:31 -05:00
variables [ 'bytebuddySlot' ] = bytebuddyVersion
2018-02-05 18:10:02 -05:00
//Dependency on another Feature Pack:
dependency "org.wildfly:wildfly-feature-pack:${project.wildflyVersion}" // It will assume it is "zip" by default
2016-06-27 08:07:08 -04:00
}
2018-02-22 13:56:59 -05:00
task createCoreFeaturePackZip ( type: Zip , dependsOn: [ featurepack ] ) {
baseName 'hibernate-core-jbossmodules'
2018-02-05 18:10:02 -05:00
from project . fpackStagingDir
2016-06-27 08:07:08 -04:00
}
2018-02-05 18:10:02 -05:00
provision {
2018-02-22 13:56:59 -05:00
dependsOn ( createCoreFeaturePackZip )
2018-02-05 18:10:02 -05:00
dependsOn ( ":hibernate-envers:jar" )
dependsOn ( ":hibernate-core:jar" )
configuration = file ( 'wildfly-server-provisioning.xml' )
destinationDir = file ( "$project.wildFlyInstallDir" )
//Replace the JPA API with version 2.2 in the provisioned WildFly server:
override ( 'org.hibernate.javax.persistence:hibernate-jpa-2.1-api' ) {
groupId = 'javax.persistence'
artifactId = 'javax.persistence-api'
version = '2.2'
}
2018-03-06 18:32:39 -05:00
/ * * TODO: explore overriding any other library we might need ?
Example: ( not currently necessary )
2018-02-05 18:10:02 -05:00
override ( 'org.hibernate.common:hibernate-commons-annotations' ) {
version = '5.0.2.Final'
2018-03-06 18:32:39 -05:00
} * /
2018-02-05 18:10:02 -05:00
variables [ 'wildfly.version' ] = project . wildflyVersion
variables [ 'hibernate-orm.version' ] = rootProject . hibernateVersion
}
2016-06-27 08:07:08 -04:00
2018-02-05 18:10:02 -05:00
dependencies {
testCompile project ( ":hibernate-core" )
testCompile project ( ":hibernate-envers" )
testCompile libraries . junit
testCompile libraries . arquillian_junit_container
testCompile libraries . arquillian_protocol_servlet
testCompile libraries . shrinkwrap_descriptors_api_javaee
testCompile libraries . shrinkwrap_descriptors_impl_javaee
testCompile libraries . wildfly_arquillian_container_managed
featurePack libraries . byteBuddy
featurePack project ( ":hibernate-core" )
featurePack project ( ":hibernate-envers" )
featurePack "org.wildfly:jipijapa-hibernate5:${wildflyVersion}"
2016-06-27 08:07:08 -04:00
}
2016-06-29 16:48:20 -04:00
publishing {
2018-02-05 18:10:02 -05:00
publications {
publishedArtifacts {
2018-02-22 13:56:59 -05:00
artifact ( createCoreFeaturePackZip ) {
artifactId 'hibernate-core-jbossmodules'
description 'Main feature pack of Hibernate ORM: hibernate-core and hibernate-envers'
2018-02-05 18:10:02 -05:00
}
}
}
2016-06-29 16:48:20 -04:00
}
2018-02-01 12:43:45 -05:00
task ciBuild ( dependsOn: [ clean , test , publish ] )
2018-02-01 15:00:37 -05:00
task release ( dependsOn: [ clean , test , bintrayUpload ] )
2016-06-29 16:48:20 -04:00
2016-08-05 11:08:35 -04:00
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// tasks related to in-container (Arquillian + WF) testing
2016-06-27 08:07:08 -04:00
2018-02-05 18:10:02 -05:00
task prepareWildFlyForTests ( dependsOn: [ provision ] ) {
description = 'Downloads the WildFly distribution, installs it into a local directory, includes present version of Hibernate ORM, JPA 2.2 : ready for integration tests'
2017-12-15 08:06:32 -05:00
}
2016-08-05 11:08:35 -04:00
test . dependsOn prepareWildFlyForTests
2016-06-27 08:07:08 -04:00
2016-06-29 16:48:20 -04:00
processTestResources {
2018-02-05 18:10:02 -05:00
expand (
[
wildFlyInstallDir : project . wildFlyInstallDir ,
arquillianDeploymentExportDir: "${rootProject.buildDir.absolutePath}/arquillian-deployments"
]
)
2016-06-27 08:07:08 -04:00
}
2016-08-05 11:08:35 -04:00