Skip to content

Gradle plugin used by Hibernate to inject project version into compiled classes

Notifications You must be signed in to change notification settings

hibernate/version-injection-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

version-injection-plugin

Gradle plugin used by Hibernate to inject project version into compiled classes

To use you'd simply apply the plugin (after making sure it is added to your buildscript classpath):

buildscript {
    ...
    dependencies {
        classpath 'org.hibernate.build.gradle:version-injection-plugin:${theVersionToUse}'
    }
}

apply plugin: 'version-injection'

Then, you'd configure it. Configuration mainly involves naming the Class member to inject the project version into:

versionInjection {
    into( 'com.acme.Version', 'getVersionString' )
}

The above would instruct the plugin to over-write the body of com.acme.Version.getVersionString() method with the project's current version. The plugin does this through bytecode manipulation. The injection is performed every time the compileJava task is performed (as a doLast action).

About

Gradle plugin used by Hibernate to inject project version into compiled classes

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages