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 {
2019-06-07 17:53:29 -04:00
id "org.wildfly.build.provision" version '0.0.11'
id "org.wildfly.build.featurepack" version '0.0.11'
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'
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
2018-06-13 05:45:41 -04:00
evaluationDependsOn ( ':hibernate-core' )
evaluationDependsOn ( ':hibernate-envers' )
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 {
2018-10-31 07:04:45 -04:00
name 'jboss-public'
2019-04-17 09:17:03 -04:00
url 'https://repository.jboss.org/nexus/content/groups/public/'
2018-02-05 18:10:02 -05:00
}
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"
2018-04-30 11:38:09 -04:00
variables [ 'slot' ] = rootProject . ormVersion . fullName
2018-02-05 18:10:02 -05:00
// Just the minor ORM version, e.g. "5.3"; Is used as an alias for the exact version
2018-04-30 11:38:09 -04:00
variables [ 'minorSlot' ] = rootProject . ormVersion . family
2018-02-22 10:42:31 -05:00
variables [ 'bytebuddySlot' ] = bytebuddyVersion
2018-04-30 11:38:09 -04:00
variables [ 'infinispan2lcSlot' ] = 'for-orm-' + rootProject . ormVersion . family
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
2018-04-03 13:38:56 -04:00
//Ensure we declare all source repositories explicitly
autoAddRepositories = false
2016-06-27 08:07:08 -04:00
}
2018-02-22 13:56:59 -05:00
task createCoreFeaturePackZip ( type: Zip , dependsOn: [ featurepack ] ) {
2018-04-26 07:06:22 -04:00
baseName 'hibernate-orm-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" )
2018-06-19 10:41:25 -04:00
//Override HCANN:
2018-02-05 18:10:02 -05:00
override ( 'org.hibernate.common:hibernate-commons-annotations' ) {
2018-06-19 10:41:25 -04:00
version = project . hibernateCommonsVersion
}
2018-02-05 18:10:02 -05:00
variables [ 'wildfly.version' ] = project . wildflyVersion
2018-04-30 11:38:09 -04:00
variables [ 'hibernate-orm.version' ] = rootProject . ormVersion . fullName
2018-04-03 13:38:56 -04:00
//Ensure we declare all source repositories explicitly
autoAddRepositories = false
2018-02-05 18:10:02 -05:00
}
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 ) {
2018-04-26 07:06:22 -04:00
artifactId 'hibernate-orm-jbossmodules'
description 'Main feature pack of Hibernate ORM: hibernate-core and hibernate-envers, including essential dependencies such as Byte Buddy'
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
}
2019-09-10 10:51:11 -04:00
test {
exclude 'org/hibernate/wildfly/model/**'
}
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
}