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 @@ -157,3 +157,35 @@ tasks.register( "testAll", Test ) {
157
157
description = " Run tests for ${ dbs} "
158
158
dependsOn = dbs. collect( [] as HashSet ) { db -> " testDb${ db} " }
159
159
}
160
+
161
+ // Task to print the resolved versions of Hibernate ORM and Vert.x
162
+ tasks. register( " printResolvedVersions" ) {
163
+ description = " Print the resolved hibernate-orm-core and vert.x versions"
164
+ doLast {
165
+ def hibernateCoreVersion = " n/a"
166
+ def vertxVersion = " n/a"
167
+
168
+ // Resolve Hibernate Core and Vert.x versions from compile classpath
169
+ configurations. compileClasspath. resolvedConfiguration. resolvedArtifacts. each { artifact ->
170
+ if (artifact. moduleVersion. id. name == ' hibernate-core' ) {
171
+ hibernateCoreVersion = artifact. moduleVersion. id. version
172
+ }
173
+ if (artifact. moduleVersion. id. group == ' io.vertx' && artifact. moduleVersion. id. name == ' vertx-sql-client' ) {
174
+ vertxVersion = artifact. moduleVersion. id. version
175
+ }
176
+ }
177
+
178
+ // Print the resolved versions
179
+ println " Resolved Hibernate ORM Core Version: ${ hibernateCoreVersion} "
180
+ println " Resolved Vert.x SQL client Version: ${ vertxVersion} "
181
+ }
182
+ }
183
+
184
+ // Make the version printing task run before tests and JavaExec tasks
185
+ tasks. withType( Test ). configureEach {
186
+ dependsOn printResolvedVersions
187
+ }
188
+
189
+ tasks. withType( JavaExec ). configureEach {
190
+ dependsOn printResolvedVersions
191
+ }
You can’t perform that action at this time.
0 commit comments