@@ -190,67 +190,53 @@ else {
190
190
191
191
192
192
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
193
- // aggregated JavaDoc
193
+ // aggregated Javadoc
194
194
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
195
195
196
- def aggregateJavadocsTask = tasks. register( " aggregateJavadocs " , Javadoc ) {
196
+ def aggregateJavadocsTask = tasks. register( " javadoc " , Javadoc ) {
197
197
group = " documentation"
198
- description = ' Builds an aggregated JavaDoc across all ORM sub-projects'
199
-
200
- inputs. property " ormVersion" , project. ormVersion
198
+ description = ' Builds JavaDoc aggregated across all ORM sub-projects'
201
199
202
200
destinationDir = mkdir( layout. buildDirectory. file( ' javadocs' ) )
201
+ source = configurations. javadocSources
202
+ classpath = configurations. javadocClasspath
203
203
204
- source configurations. javadocSources
205
- classpath + = configurations. javadocClasspath
206
-
207
- // exclude any generated sources and internal packages
208
- exclude ' **/generated-src/**'
209
- exclude ' **/internal/**'
210
- include ' **/*.java'
211
-
212
-
213
- final int currentYear = new GregorianCalendar (). get( Calendar . YEAR )
214
-
215
- // apply standard config
216
- maxMemory = ' 512m'
217
204
configure( options ) {
218
- overview = ' src/javadoc/overview.html'
219
- stylesheetFile = project. file( ' src/javadoc/stylesheet.css' )
220
- windowTitle = ' Hibernate JavaDocs'
221
- docTitle = " Hibernate JavaDoc ($project . version )"
222
- bottom = " Copyright © 2001-$currentYear <a href=\" https://redhat.com\" >Red Hat, Inc.</a> All Rights Reserved."
223
- use = true
224
- options. encoding = ' UTF-8'
225
-
226
- links = [
227
- ' https://docs.oracle.com/en/java/javase/11/docs/api/' ,
228
- ' https://jakarta.ee/specifications/bean-validation/3.0/apidocs/' ,
229
- ' https://jakarta.ee/specifications/cdi/4.0/apidocs/' ,
230
- ' https://jakarta.ee/specifications/platform/9/apidocs/' ,
231
- ' https://www.javadoc.io/doc/javax.cache/cache-api/1.0.0/'
232
- ]
233
-
234
- options. addStringOption( ' Xdoclint:none' , ' -quiet' )
235
-
236
- if ( jdkVersions. explicit ) {
237
- options. setJFlags(
238
- getProperty( ' toolchain.javadoc.jvmargs' ). toString().
239
- split( ' ' ). toList(). findAll( { ! it. isEmpty() } )
240
- )
241
- }
205
+ overview = rootProject. file( " shared/javadoc/overview.html" )
206
+ windowTitle = ' Hibernate Javadocs'
207
+ docTitle = " Hibernate Javadoc ($project . version )"
242
208
}
243
209
244
210
if ( jdkVersions. explicit ) {
211
+ // setJFlags(
212
+ // getProperty( 'toolchain.javadoc.jvmargs' ).toString().
213
+ // split( ' ' ).toList().findAll( { !it.isEmpty() } )
214
+ // )
215
+
245
216
// Display version of Java tools
246
217
doFirst {
247
218
if ( javadocTool. present ) {
248
- logger. lifecycle " Aggregating javadoc with '${ javadocTool.get().metadata.installationPath} '"
219
+ logger. lifecycle " Building aggregated javadoc with '${ javadocTool.get().metadata.installationPath} '"
249
220
}
250
221
}
251
222
}
223
+
224
+ doFirst {
225
+ def javaLanguageVersion = javadocTool. present
226
+ ? javadocTool. get(). metadata. languageVersion
227
+ : JavaLanguageVersion . of( JavaVersion . current(). name )
228
+
229
+ if ( javaLanguageVersion. asInt() > 11 ) {
230
+ println " Aggregated Javadocs are bing built` using a JDK newer than version 11: \n " +
231
+ " \t * `stylesheet.css` will not be compatible\n " +
232
+ " \t * generating the User Guide settings fragment will not succeed"
233
+ }
234
+ }
252
235
}
253
236
237
+ apply from : rootProject. file( ' gradle/javadoc.gradle' )
238
+
239
+
254
240
asciidoctorj {
255
241
requires ' rouge'
256
242
modules {
@@ -477,139 +463,122 @@ def renderQueryLanguageGuidesTask = tasks.register( 'renderQueryLanguageGuides'
477
463
}
478
464
479
465
480
- // Introduction ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
481
-
482
- tasks. register(' renderIntroductionPdf' , AsciidoctorPdfTask ) {task ->
483
- group = " Documentation"
484
- description = ' Renders the Introduction in PDF format using Asciidoctor.'
485
- tasks. buildDocs. dependsOn task
486
- tasks. buildDocsForPublishing. dependsOn task
487
- inputs. property " hibernate-version" , project. ormVersion
488
-
489
- sourceDir = file( ' src/main/asciidoc/introduction' )
490
- baseDir = file( ' src/main/asciidoc/introduction' )
491
- sources {
492
- include ' Hibernate_Introduction.adoc'
493
- }
494
- outputDir = " $buildDir /asciidoc/introduction/pdf"
495
-
496
- attributes jpaJavadocUrlPrefix : " https://javaee.github.io/javaee-spec/javadocs/javax/persistence/"
497
- }
498
-
499
- tasks. register(' renderIntroduction' , AsciidoctorTask ) {task ->
500
- group = " Documentation"
501
- description = ' Renders the Introduction in HTML format using Asciidoctor.'
502
- tasks. buildDocs. dependsOn task
503
- tasks. buildDocsForPublishing. dependsOn task
504
- inputs. property " hibernate-version" , project. ormVersion
505
-
506
- sourceDir = file( ' src/main/asciidoc/introduction' )
507
- sources {
508
- include ' Hibernate_Introduction.adoc'
509
- }
510
- outputDir = " $buildDir /asciidoc/introduction/html_single"
511
-
512
- attributes linkcss : true ,
513
- stylesheet : " css/hibernate.css" ,
514
- docinfo : ' private' ,
515
- jpaJavadocUrlPrefix : " https://javaee.github.io/javaee-spec/javadocs/javax/persistence/"
516
-
517
- resources {
518
- from(' src/main/asciidoc/introduction/' ) {
519
- include ' images/**'
520
- }
521
- from(' src/main/style/asciidoctor' ) {
522
- include ' images/**'
523
- }
524
- from(' src/main/style/asciidoctor' ) {
525
- include ' css/**'
526
- }
527
- from(' src/main/style/asciidoctor' ) {
528
- include ' js/**'
529
- }
530
- }
531
- }
532
-
533
- // HQL Guide ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
534
-
535
- tasks. register(' renderQLPdf' , AsciidoctorPdfTask ) {task ->
536
- group = " Documentation"
537
- description = ' Renders the Query Language document in PDF format using Asciidoctor.'
538
- tasks. buildDocs. dependsOn task
539
- tasks. buildDocsForPublishing. dependsOn task
540
- inputs. property " hibernate-version" , project. ormVersion
541
-
542
- sourceDir = file( ' src/main/asciidoc/querylanguage' )
543
- baseDir = file( ' src/main/asciidoc/querylanguage' )
544
- sources {
545
- include ' Hibernate_Query_Language.adoc'
546
- }
547
- outputDir = " $buildDir /asciidoc/querylanguage/pdf"
548
-
549
- attributes jpaJavadocUrlPrefix : " https://javaee.github.io/javaee-spec/javadocs/javax/persistence/"
550
- }
551
-
552
- tasks. register(' renderQL' , AsciidoctorTask ) {task ->
553
- group = " Documentation"
554
- description = ' Renders the Query Language document in HTML format using Asciidoctor.'
555
- tasks. buildDocs. dependsOn task
556
- tasks. buildDocsForPublishing. dependsOn task
557
- inputs. property " hibernate-version" , project. ormVersion
558
-
559
- sourceDir = file( ' src/main/asciidoc/querylanguage' )
560
- sources {
561
- include ' Hibernate_Query_Language.adoc'
562
- }
563
- outputDir = " $buildDir /asciidoc/querylanguage/html_single"
564
-
565
- attributes linkcss : true ,
566
- stylesheet : " css/hibernate.css" ,
567
- docinfo : ' private' ,
568
- jpaJavadocUrlPrefix : " https://javaee.github.io/javaee-spec/javadocs/javax/persistence/"
569
-
570
- resources {
571
- from(' src/main/asciidoc/querylanguage/' ) {
572
- include ' images/**'
573
- }
574
- from(' src/main/style/asciidoctor' ) {
575
- include ' images/**'
576
- }
577
- from(' src/main/style/asciidoctor' ) {
578
- include ' css/**'
579
- }
580
- from(' src/main/style/asciidoctor' ) {
581
- include ' js/**'
582
- }
583
- }
584
- }
585
-
586
466
// User Guide ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
587
467
588
468
settingsDocumentation {
469
+ anchorNameBase = " settings"
589
470
sections {
590
- core {
591
- settingsClassName = " org.hibernate.cfg.AvailableSettings"
592
- projectPath = " :hibernate-core"
471
+ compliance {
472
+ explicitPosition = 1
473
+ summary = " Jakarta Persistence Compliance Settings"
474
+ description = " Settings which control various aspects of compliance with the Jakarta Persistence specification "
475
+ settingsClassName " org.hibernate.cfg.JpaComplianceSettings"
476
+ }
477
+ persistence {
478
+ explicitPosition = 2
479
+ summary = " Persistence Unit Settings"
480
+ description = " Settings related to the creation and configuration of a persistence-unit - SessionFactory and EntityManagerFactory"
481
+ settingsClassName " org.hibernate.cfg.PersistenceSettings"
482
+ }
483
+ jdbc {
484
+ explicitPosition = 3
485
+ summary = " JDBC Settings"
486
+ description = " Settings which control various aspects of how Hibernate interacts with JDBC"
487
+ settingsClassName " org.hibernate.cfg.JdbcSettings"
488
+ }
489
+ c3p0 {
490
+ explicitPosition = 4
491
+ summary = " C3P0 Connection Pool Settings"
492
+ description = " Settings related to integrating with the C3P0 Connection pool"
493
+ settingsClassName " org.hibernate.cfg.C3p0Settings"
494
+ }
495
+ proxool {
496
+ explicitPosition = 5
497
+ summary = " Proxool Connection Pool Settings"
498
+ description = " Settings related to integrating with the Proxool Connection pool"
499
+ settingsClassName " org.hibernate.cfg.ProxoolSettings"
500
+ }
501
+ mapping {
502
+ explicitPosition = 6
503
+ summary = " Domain Mapping Settings"
504
+ description = " Settings which control how domain mappings are handled"
505
+ settingsClassName " org.hibernate.cfg.MappingSettings"
506
+ }
507
+ environment {
508
+ summary = " Runtime Environment Settings"
509
+ description = " Settings related to JNDI and ClassLoaders"
510
+ settingsClassName " org.hibernate.cfg.EnvironmentSettings"
511
+ }
512
+ schema {
513
+ summary = " Schema Tooling Settings"
514
+ description = " Settings which control the creation, dropping, update and validation of database schemas"
515
+ settingsClassName " org.hibernate.cfg.SchemaToolingSettings"
516
+ }
517
+ bytecode {
518
+ summary = " Bytecode Manipulation Settings"
519
+ description = " Settings which control Hibernate's BytecodeProvider used for bytecode manipulation"
520
+ settingsClassName " org.hibernate.cfg.BytecodeSettings"
521
+ }
522
+ cache {
523
+ summary = " Second-level Cache Settings"
524
+ description = " Settings which control Hibernate's second-level caching"
525
+ settingsClassName " org.hibernate.cfg.CacheSettings"
526
+ settingsClassName " org.hibernate.cache.jcache.ConfigSettings"
527
+ }
528
+ query {
529
+ summary = " Query Settings"
530
+ description = " Settings which control various parts of Hibernate's Query handling"
531
+ settingsClassName " org.hibernate.cfg.QuerySettings"
532
+ }
533
+ stats {
534
+ summary = " Statistics Settings"
535
+ description = " Settings which control the collection of statistics"
536
+ settingsClassName " org.hibernate.cfg.StatisticsSettings"
537
+ }
538
+ validation {
539
+ summary = " Jakarta Validation Integeration Settings"
540
+ description = " Settings used in the integration of Jakarta Validation"
541
+ settingsClassName " org.hibernate.cfg.ValidationSettings"
593
542
}
594
543
envers {
595
- settingsClassName = " org.hibernate.envers.configuration.EnversSettings"
596
- projectPath = " :hibernate-envers"
544
+ summary = " Audit/History Settings"
545
+ description = " Settings which control Hibernate's audit/history support (hibernate-envers)"
546
+ settingsClassName " org.hibernate.envers.configuration.EnversSettings"
547
+ }
548
+ spatial {
549
+ summary = " Hibernate Spatial Settings"
550
+ description = " Settings which control Hibernate's support for spatial data (hibernate-spatial)"
551
+ settingsClassName " org.hibernate.spatial.HibernateSpatialConfigurationSettings"
552
+ settingsClassName " org.hibernate.spatial.integration.SpatialService"
597
553
}
598
- jcache {
599
- settingsClassName = " org.hibernate.cache.jcache.ConfigSettings"
600
- projectPath = " :hibernate-jcache"
554
+ misc {
555
+ summary = " Miscellaneous Settings"
556
+ description = " Miscellaneous Settings"
557
+ settingsClassName " org.hibernate.cfg.AvailableSettings"
601
558
}
602
559
}
603
560
}
604
561
605
562
def generateSettingsDocTask = tasks. named( " generateSettingsDoc" ) {
606
563
dependsOn aggregateJavadocsTask
564
+
565
+ doFirst {
566
+ def javadoc = aggregateJavadocsTask. get()
567
+ def javaLanguageVersion = javadoc. javadocTool. present
568
+ ? javadoc. javadocTool. get(). metadata. languageVersion
569
+ : JavaLanguageVersion . of( JavaVersion . current(). name )
570
+
571
+ if ( javaLanguageVersion. asInt() > 11 ) {
572
+ println " Aggregated Javadocs was built using a JDK newer than version 11; generating the settings User Guide fragment will not succeed"
573
+ }
574
+ }
607
575
}
608
576
609
577
def renderUserGuideHtmlTask = tasks. register( ' renderUserGuideHtml' , AsciidoctorTask ) { task ->
610
578
group = " Documentation"
611
579
description = ' Renders the User Guides in HTML format using Asciidoctor.'
612
580
inputs. property " hibernate-version" , project. ormVersion
581
+ inputs. file( generateSettingsDocTask. get(). outputFile )
613
582
614
583
dependsOn generateSettingsDocTask
615
584
0 commit comments