Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ buildscript {
plugins {
id "local.module"

id "org.hibernate.build.version-injection" version "2.0.0" apply false
id "org.hibernate.build.version-injection" version "2.1.0" apply false
id 'org.hibernate.orm.database-service' apply false
id 'biz.aQute.bnd' version '7.1.0' apply false

Expand Down
5 changes: 5 additions & 0 deletions hibernate-core/hibernate-core.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ plugins {
id "local.publishing-java-module"
id "local.publishing-group-relocation"

id "org.hibernate.build.version-injection"
id "org.hibernate.orm.antlr"
id "local-xjc-plugin"
}
Expand Down Expand Up @@ -132,6 +133,10 @@ xjc {
}
}

versionInjection {
into( 'org.hibernate.Version', 'initVersion' )
}

task copyBundleResourcesXml (type: Copy) {
inputs.property( "db", db )
inputs.property( "dbHost", dbHost )
Expand Down
6 changes: 5 additions & 1 deletion tooling/metamodel-generator/hibernate-processor.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
plugins {
id "local.publishing-java-module"
id "local.publishing-group-relocation"
id "org.hibernate.build.version-injection"
id "org.hibernate.build.version-injection"
}

description = 'Hibernate compile-time tooling'
Expand Down Expand Up @@ -77,6 +77,10 @@ configurations {
jakartaDataCompileOnly.extendsFrom(testCompileOnly)
}

versionInjection {
into( 'org.hibernate.processor.Version', 'initVersion' )
}

def quarkusOrmPanacheTestTask = tasks.register( 'quarkusOrmPanacheTest', Test ) {
description = 'Runs the Quarkus ORM Panache tests.'
group = 'verification'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,23 @@

import org.hibernate.processor.util.NullnessUtil;

import org.checkerframework.checker.nullness.qual.Nullable;

/**
* Information about the Meta Model Generator version.
*
* @author Hardy Ferentschik
*/
public final class Version {
private static @Nullable String version;
private static final String VERSION = initVersion();

private static String initVersion() {
final String version = NullnessUtil.castNonNull( Version.class.getPackage() ).getImplementationVersion();
return version != null ? version : "[WORKING]";
}

private Version() {
}

public static String getVersionString() {
if ( version == null ) {
version = NullnessUtil.castNonNull( Version.class.getPackage() ).getImplementationVersion();
if ( version == null ) {
version = "[WORKING]";
}
}
return version;
return VERSION;
}
}