2015-05-19 00:23:35 -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
|
|
|
apply from: rootProject.file( 'gradle/base-information.gradle' )
|
2015-08-20 14:13:38 -04:00
|
|
|
|
2010-10-12 16:39:33 -04:00
|
|
|
apply plugin: 'idea'
|
2013-04-05 16:15:11 -04:00
|
|
|
apply plugin: 'distribution'
|
2010-10-12 16:39:33 -04:00
|
|
|
|
2012-02-15 17:31:29 -05:00
|
|
|
idea.module {
|
2010-10-12 16:39:33 -04:00
|
|
|
}
|
|
|
|
|
2016-02-11 14:40:10 -05:00
|
|
|
final File documentationDir = mkdir( "${project.buildDir}/documentation" );
|
2013-05-17 15:29:33 -04:00
|
|
|
|
2013-05-16 19:34:36 -04:00
|
|
|
/**
|
2013-11-22 15:51:56 -05:00
|
|
|
* Assembles all documentation into the {buildDir}/documentation directory.
|
2013-05-16 19:34:36 -04:00
|
|
|
*
|
2013-11-22 15:51:56 -05:00
|
|
|
* Depends on building the docs
|
2013-05-16 19:34:36 -04:00
|
|
|
*/
|
2016-02-11 16:59:13 -05:00
|
|
|
task assembleDocumentation(type: Task, dependsOn: [rootProject.project( 'documentation' ).tasks.buildDocsForPublishing]) {
|
2013-11-22 15:51:56 -05:00
|
|
|
description = 'Assembles all documentation into the {buildDir}/documentation directory'
|
2013-05-16 19:34:36 -04:00
|
|
|
|
|
|
|
doLast {
|
2014-01-10 14:43:19 -05:00
|
|
|
// copy documentation outputs into target/documentation.
|
|
|
|
// * this is used in building the dist bundles
|
|
|
|
// * it is also used as a base to build a staged directory for documentation upload
|
2016-02-11 16:59:13 -05:00
|
|
|
|
|
|
|
// Integrations Guide
|
2013-05-16 19:34:36 -04:00
|
|
|
copy {
|
2016-08-02 09:45:36 -04:00
|
|
|
from "${rootProject.project( 'documentation' ).buildDir}/asciidoc/integrationguide"
|
|
|
|
into "${documentationDir}/integrationguide"
|
2013-05-17 15:29:33 -04:00
|
|
|
}
|
2016-02-11 16:59:13 -05:00
|
|
|
|
|
|
|
// Getting-started Guide
|
|
|
|
copy {
|
|
|
|
from "${rootProject.project( 'documentation' ).buildDir}/asciidoc/quickstart"
|
|
|
|
into "${documentationDir}/quickstart"
|
|
|
|
}
|
|
|
|
|
|
|
|
// Topical Guide
|
2013-11-18 15:48:10 -05:00
|
|
|
copy {
|
2016-02-11 16:59:13 -05:00
|
|
|
from "${rootProject.project( 'documentation' ).buildDir}/asciidoc/topical"
|
|
|
|
into "${documentationDir}/topical"
|
2013-11-18 15:48:10 -05:00
|
|
|
}
|
2016-02-11 16:59:13 -05:00
|
|
|
|
|
|
|
// User Guide
|
|
|
|
copy {
|
|
|
|
from "${rootProject.project( 'documentation' ).buildDir}/asciidoc/userguide"
|
|
|
|
into "${documentationDir}/userguide"
|
|
|
|
}
|
|
|
|
|
|
|
|
// Aggregated JavaDoc
|
2013-05-17 15:29:33 -04:00
|
|
|
copy {
|
2014-01-10 14:43:19 -05:00
|
|
|
from "${rootProject.project( 'documentation' ).buildDir}/javadocs"
|
2016-02-11 16:59:13 -05:00
|
|
|
into "${documentationDir}/javadocs"
|
2013-05-16 19:34:36 -04:00
|
|
|
}
|
2010-10-12 16:39:33 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-16 19:34:36 -04:00
|
|
|
/**
|
|
|
|
* Upload the documentation to the JBoss doc server
|
|
|
|
*/
|
2016-02-11 14:40:10 -05:00
|
|
|
task uploadDocumentation(type:Exec, dependsOn: assembleDocumentation) {
|
2013-05-16 19:34:36 -04:00
|
|
|
description = "Uploads documentation to the JBoss doc server"
|
|
|
|
|
2018-04-30 11:38:09 -04:00
|
|
|
final String url = "filemgmt.jboss.org:/docs_htdocs/hibernate/orm/${rootProject.ormVersion.family}";
|
2010-10-12 16:39:33 -04:00
|
|
|
|
2013-05-16 19:34:36 -04:00
|
|
|
executable 'rsync'
|
2016-02-11 16:59:13 -05:00
|
|
|
args '-avz', '--links', '--protocol=28', "${documentationDir.absolutePath}/", url
|
2010-10-12 16:39:33 -04:00
|
|
|
|
2013-05-16 19:34:36 -04:00
|
|
|
doFirst {
|
2018-04-30 11:38:09 -04:00
|
|
|
if ( rootProject.ormVersion.isSnapshot ) {
|
2013-05-16 19:34:36 -04:00
|
|
|
logger.error( "Cannot perform upload of SNAPSHOT documentation" );
|
|
|
|
throw new RuntimeException( "Cannot perform upload of SNAPSHOT documentation" );
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
logger.lifecycle( "Uploading documentation [{$url}]..." )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
doLast {
|
|
|
|
logger.lifecycle( 'Done uploading documentation' )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Configuration of the distribution plugin, used to build release bundle as both ZIP and TGZ
|
|
|
|
*/
|
2013-04-05 16:15:11 -04:00
|
|
|
distributions {
|
|
|
|
main {
|
|
|
|
baseName = 'hibernate-release'
|
|
|
|
contents {
|
2013-05-16 19:34:36 -04:00
|
|
|
from rootProject.file( 'lgpl.txt' )
|
|
|
|
from rootProject.file( 'changelog.txt' )
|
|
|
|
from rootProject.file( 'hibernate_logo.gif' )
|
2013-04-05 16:15:11 -04:00
|
|
|
|
|
|
|
into('lib/required') {
|
|
|
|
from parent.project( 'hibernate-core' ).configurations.provided.files { dep -> dep.name == 'jta' }
|
|
|
|
from parent.project( 'hibernate-core' ).configurations.runtime
|
|
|
|
from parent.project( 'hibernate-core' ).configurations.archives.allArtifacts.files.filter{ file -> !file.name.endsWith('-sources.jar') }
|
|
|
|
// for now,
|
|
|
|
from parent.project( 'hibernate-core' ).configurations.provided.files { dep -> dep.name == 'javassist' }
|
|
|
|
}
|
2010-10-12 16:39:33 -04:00
|
|
|
|
2016-05-06 13:28:31 -04:00
|
|
|
// into( 'lib/jpa' ) {
|
|
|
|
// from parent.project( 'hibernate-entitymanager' ).configurations.archives.allArtifacts.files.filter{ file -> !file.name.endsWith('-sources.jar') }
|
|
|
|
// }
|
2010-10-12 16:39:33 -04:00
|
|
|
|
2019-07-25 12:39:32 -04:00
|
|
|
// todo (6.0) - add back spatial
|
|
|
|
// into( 'lib/spatial' ) {
|
|
|
|
// from(
|
|
|
|
// ( parent.project( 'hibernate-spatial' ).configurations.archives.allArtifacts.files.filter{ file -> !file.name.endsWith('-sources.jar') }
|
|
|
|
// + parent.project( 'hibernate-spatial' ).configurations.runtime )
|
|
|
|
// - parent.project( 'hibernate-core' ).configurations.runtime
|
|
|
|
// - parent.project( 'hibernate-core' ).configurations.archives.allArtifacts.files
|
|
|
|
// )
|
|
|
|
// }
|
2016-08-09 21:49:20 -04:00
|
|
|
|
2013-10-28 10:16:47 -04:00
|
|
|
into( 'lib/jpa-metamodel-generator' ) {
|
2013-11-12 10:07:00 -05:00
|
|
|
from parent.project( 'hibernate-jpamodelgen' ).configurations.archives.allArtifacts.files.filter{ file -> !file.name.endsWith('-sources.jar') }
|
2013-10-28 10:16:47 -04:00
|
|
|
}
|
|
|
|
|
2013-04-05 16:15:11 -04:00
|
|
|
into( 'lib/envers' ) {
|
|
|
|
from(
|
|
|
|
( parent.project( 'hibernate-envers' ).configurations.archives.allArtifacts.files.filter{ file -> !file.name.endsWith('-sources.jar') }
|
|
|
|
+ parent.project( 'hibernate-envers' ).configurations.runtime )
|
2011-03-18 10:49:00 -04:00
|
|
|
- parent.project( 'hibernate-core' ).configurations.runtime
|
2012-03-26 03:12:10 -04:00
|
|
|
- parent.project( 'hibernate-core' ).configurations.archives.allArtifacts.files
|
2011-03-18 10:49:00 -04:00
|
|
|
)
|
|
|
|
}
|
2010-10-12 16:39:33 -04:00
|
|
|
|
2013-06-29 12:46:40 -04:00
|
|
|
into( 'lib/osgi' ) {
|
|
|
|
from(
|
|
|
|
( parent.project( 'hibernate-osgi' ).configurations.archives.allArtifacts.files.filter{ file -> !file.name.endsWith('-sources.jar') }
|
|
|
|
+ parent.project( 'hibernate-osgi' ).configurations.runtime )
|
|
|
|
- parent.project( 'hibernate-core' ).configurations.runtime
|
|
|
|
- parent.project( 'hibernate-core' ).configurations.archives.allArtifacts.files
|
|
|
|
)
|
2015-08-20 02:12:46 -04:00
|
|
|
from(
|
2018-06-26 14:05:24 -04:00
|
|
|
parent.project( 'hibernate-osgi' ).extensions.karaf.features.outputFile
|
2015-08-20 02:12:46 -04:00
|
|
|
)
|
2013-06-29 12:46:40 -04:00
|
|
|
}
|
|
|
|
|
2013-04-05 16:15:11 -04:00
|
|
|
// todo : this closure is problematic as it does not write into the hibernate-release-$project.version directory
|
|
|
|
// due to http://issues.gradle.org/browse/GRADLE-1450
|
2018-07-11 04:15:03 -04:00
|
|
|
[ 'hibernate-agroal', 'hibernate-c3p0', 'hibernate-ehcache', 'hibernate-hikaricp', 'hibernate-jcache', 'hibernate-proxool', 'hibernate-vibur' ].each { feature ->
|
2018-01-10 16:06:58 -05:00
|
|
|
final String shortName = feature.substring( 'hibernate-'.length() )
|
2013-04-05 16:15:11 -04:00
|
|
|
// WORKAROUND http://issues.gradle.org/browse/GRADLE-1450
|
|
|
|
// into('lib/optional/' + shortName) {
|
|
|
|
owner.into('lib/optional/' + shortName) {
|
|
|
|
from (
|
|
|
|
( parent.project( feature ).configurations.archives.allArtifacts.files.filter{ file -> !file.name.endsWith('-sources.jar') }
|
|
|
|
+ parent.project( feature ).configurations.runtime )
|
|
|
|
- parent.project( 'hibernate-core' ).configurations.runtime
|
|
|
|
- parent.project( 'hibernate-core' ).configurations.archives.allArtifacts.files
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2011-03-18 10:49:00 -04:00
|
|
|
|
2013-04-05 16:15:11 -04:00
|
|
|
into('documentation') {
|
2013-05-17 15:29:33 -04:00
|
|
|
from documentationDir
|
2013-04-05 16:15:11 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
into( 'project' ) {
|
|
|
|
from ( rootProject.projectDir ) {
|
|
|
|
exclude( '.git' )
|
|
|
|
exclude( '.gitignore' )
|
|
|
|
exclude( 'changelog.txt' )
|
|
|
|
exclude( 'lgpl.txt' )
|
|
|
|
exclude( 'hibernate_logo.gif' )
|
|
|
|
exclude( 'tagRelease.sh' )
|
|
|
|
exclude( 'gradlew' )
|
|
|
|
exclude( 'gradlew.bat' )
|
|
|
|
exclude( 'wrapper/*' )
|
|
|
|
exclude( '**/.gradle/**' )
|
|
|
|
exclude( '**/target/**' )
|
|
|
|
exclude( '.idea' )
|
|
|
|
exclude( '**/*.ipr' )
|
|
|
|
exclude( '**/*.iml' )
|
|
|
|
exclude( '**/*.iws' )
|
|
|
|
exclude( '**/atlassian-ide-plugin.xml' )
|
|
|
|
exclude( '**/.classpath' )
|
|
|
|
exclude( '**/.project' )
|
|
|
|
exclude( '**/.settings' )
|
|
|
|
exclude( '**/.nbattrs' )
|
2017-10-20 06:48:07 -04:00
|
|
|
exclude( '**/out/**' )
|
2018-07-05 09:27:24 -04:00
|
|
|
exclude( '**/bin/**' )
|
2018-07-05 09:46:05 -04:00
|
|
|
exclude( 'build/**' )
|
|
|
|
exclude( '*/build/**' )
|
2013-04-05 16:15:11 -04:00
|
|
|
}
|
2011-03-18 10:49:00 -04:00
|
|
|
}
|
2010-10-12 16:39:33 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-22 15:51:56 -05:00
|
|
|
distZip.dependsOn assembleDocumentation
|
|
|
|
distTar.dependsOn assembleDocumentation
|
2013-04-05 17:53:29 -04:00
|
|
|
distTar {
|
|
|
|
compression = Compression.GZIP
|
|
|
|
}
|
2010-10-12 16:39:33 -04:00
|
|
|
|
2013-05-16 19:34:36 -04:00
|
|
|
/**
|
|
|
|
* "virtual" task for building both types of dist bundles
|
|
|
|
*/
|
|
|
|
task buildBundles(type: Task, dependsOn: [distZip,distTar]) {
|
|
|
|
description = "Builds all release bundles"
|
|
|
|
}
|
|
|
|
|
2015-08-20 14:13:38 -04:00
|
|
|
task uploadBundlesSourceForge(type: Exec, dependsOn: buildBundles) {
|
2013-05-16 19:34:36 -04:00
|
|
|
description = "Uploads release bundles to SourceForge"
|
|
|
|
|
2015-05-27 22:02:27 -04:00
|
|
|
final String url = "frs.sourceforge.net:/home/frs/project/hibernate/hibernate-orm/${version}";
|
2013-05-16 19:34:36 -04:00
|
|
|
|
|
|
|
executable 'rsync'
|
|
|
|
args '-vr', '-e ssh', "${project.buildDir}/distributions/", url
|
|
|
|
|
|
|
|
doFirst {
|
2018-04-30 11:38:09 -04:00
|
|
|
if ( rootProject.ormVersion.isSnapshot ) {
|
2016-06-27 16:29:16 -04:00
|
|
|
logger.error( "Cannot perform upload of SNAPSHOT bundles to SourceForge" );
|
|
|
|
throw new RuntimeException( "Cannot perform upload of SNAPSHOT bundles to SourceForge" )
|
2013-05-16 19:34:36 -04:00
|
|
|
}
|
|
|
|
else {
|
2016-06-27 16:29:16 -04:00
|
|
|
logger.lifecycle( "Uploading release bundles to SourceForge..." )
|
2013-05-16 19:34:36 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
doLast {
|
2016-06-27 16:29:16 -04:00
|
|
|
logger.lifecycle( 'Done uploading release bundles to SourceForge' )
|
2013-05-16 19:34:36 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-06-27 16:29:16 -04:00
|
|
|
configurations {
|
|
|
|
bundles {
|
|
|
|
description = 'Configuration used to group the archives output from the distribution plugin.'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
artifacts {
|
|
|
|
bundles distTar
|
|
|
|
bundles distZip
|
|
|
|
}
|
|
|
|
|
2018-01-31 09:33:39 -05:00
|
|
|
task release( dependsOn: [uploadDocumentation, uploadBundlesSourceForge] )
|
2013-05-16 19:34:36 -04:00
|
|
|
|