File tree Expand file tree Collapse file tree 3 files changed +97
-0
lines changed Expand file tree Collapse file tree 3 files changed +97
-0
lines changed Original file line number Diff line number Diff line change @@ -75,3 +75,36 @@ tasks.register( "runAllExamples" ) {
75
75
dependsOn = [" runAllExamplesOnPostgreSQL" ]
76
76
description = " Run all examples on ${ dbs} "
77
77
}
78
+
79
+ // Optional: Task to print the resolved versions of Hibernate ORM and Vert.x
80
+ tasks. register( " printResolvedVersions" ) {
81
+ description = " Print the resolved hibernate-orm-core and vert.x versions"
82
+ doLast {
83
+ def hibernateCoreVersion = " n/a"
84
+ def vertxVersion = " n/a"
85
+
86
+ // Resolve Hibernate Core and Vert.x versions from compile classpath
87
+ configurations. compileClasspath. resolvedConfiguration. resolvedArtifacts. each { artifact ->
88
+ if (artifact. moduleVersion. id. name == ' hibernate-core' ) {
89
+ hibernateCoreVersion = artifact. moduleVersion. id. version
90
+ }
91
+ if (artifact. moduleVersion. id. group == ' io.vertx' && artifact. moduleVersion. id. name == ' vertx-sql-client' ) {
92
+ vertxVersion = artifact. moduleVersion. id. version
93
+ }
94
+ }
95
+
96
+ // Print the resolved versions
97
+ println " Resolved Hibernate ORM Core Version: ${ hibernateCoreVersion} "
98
+ println " Resolved Vert.x SQL client Version: ${ vertxVersion} "
99
+ }
100
+ }
101
+
102
+ // Make the version printing task run before tests and JavaExec tasks
103
+ tasks. withType( Test ). configureEach {
104
+ dependsOn printResolvedVersions
105
+ }
106
+
107
+ tasks. withType( JavaExec ). configureEach {
108
+ dependsOn printResolvedVersions
109
+ }
110
+
Original file line number Diff line number Diff line change @@ -81,3 +81,35 @@ tasks.register( "runAllExamples" ) {
81
81
dependsOn = [" runAllExamplesOnPostgreSQL" , " runAllExamplesOnMySQL" ]
82
82
description = " Run all examples on ${ dbs} "
83
83
}
84
+
85
+ // Optional: Task to print the resolved versions of Hibernate ORM and Vert.x
86
+ tasks. register( " printResolvedVersions" ) {
87
+ description = " Print the resolved hibernate-orm-core and vert.x versions"
88
+ doLast {
89
+ def hibernateCoreVersion = " n/a"
90
+ def vertxVersion = " n/a"
91
+
92
+ // Resolve Hibernate Core and Vert.x versions from compile classpath
93
+ configurations. compileClasspath. resolvedConfiguration. resolvedArtifacts. each { artifact ->
94
+ if (artifact. moduleVersion. id. name == ' hibernate-core' ) {
95
+ hibernateCoreVersion = artifact. moduleVersion. id. version
96
+ }
97
+ if (artifact. moduleVersion. id. group == ' io.vertx' && artifact. moduleVersion. id. name == ' vertx-sql-client' ) {
98
+ vertxVersion = artifact. moduleVersion. id. version
99
+ }
100
+ }
101
+
102
+ // Print the resolved versions
103
+ println " Resolved Hibernate ORM Core Version: ${ hibernateCoreVersion} "
104
+ println " Resolved Vert.x SQL client Version: ${ vertxVersion} "
105
+ }
106
+ }
107
+
108
+ // Make the version printing task run before tests and JavaExec tasks
109
+ tasks. withType( Test ). configureEach {
110
+ dependsOn printResolvedVersions
111
+ }
112
+
113
+ tasks. withType( JavaExec ). configureEach {
114
+ dependsOn printResolvedVersions
115
+ }
Original file line number Diff line number Diff line change @@ -167,3 +167,35 @@ tasks.register( "testAll", Test ) {
167
167
description = " Run tests for ${ dbs} "
168
168
dependsOn = dbs. collect( [] as HashSet ) { db -> " testDb${ db} " }
169
169
}
170
+
171
+ // Task to print the resolved versions of Hibernate ORM and Vert.x
172
+ tasks. register( " printResolvedVersions" ) {
173
+ description = " Print the resolved hibernate-orm-core and vert.x versions"
174
+ doLast {
175
+ def hibernateCoreVersion = " n/a"
176
+ def vertxVersion = " n/a"
177
+
178
+ // Resolve Hibernate Core and Vert.x versions from compile classpath
179
+ configurations. compileClasspath. resolvedConfiguration. resolvedArtifacts. each { artifact ->
180
+ if (artifact. moduleVersion. id. name == ' hibernate-core' ) {
181
+ hibernateCoreVersion = artifact. moduleVersion. id. version
182
+ }
183
+ if (artifact. moduleVersion. id. group == ' io.vertx' && artifact. moduleVersion. id. name == ' vertx-sql-client' ) {
184
+ vertxVersion = artifact. moduleVersion. id. version
185
+ }
186
+ }
187
+
188
+ // Print the resolved versions
189
+ println " Resolved Hibernate ORM Core Version: ${ hibernateCoreVersion} "
190
+ println " Resolved Vert.x SQL client Version: ${ vertxVersion} "
191
+ }
192
+ }
193
+
194
+ // Make the version printing task run before tests and JavaExec tasks
195
+ tasks. withType( Test ). configureEach {
196
+ dependsOn printResolvedVersions
197
+ }
198
+
199
+ tasks. withType( JavaExec ). configureEach {
200
+ dependsOn printResolvedVersions
201
+ }
You can’t perform that action at this time.
0 commit comments