Commit 9e3021d1 authored by Jens Bendisposto's avatar Jens Bendisposto
Browse files

auto generate version class from gradle version number

parent 6cf20b30
......@@ -15,4 +15,6 @@ tmp/
PROB_LOGFILE_IS_UNDEFINED
.settings/org.eclipse.jdt.ui.prefs
src/main/resources/build.properties
config.groovy
\ No newline at end of file
config.groovy
local.*
Version.java
......@@ -37,10 +37,31 @@ artifacts {
archives javadocJar, sourcesJar
}
task writeVersion() {
doFirst {
def buildconstants_class = """
package org.sablecc.sablecc;
public class Version
{
public static final String VERSION = "${project.version}";
}
"""
File f = file("src/main/java/org/sablecc/sablecc/Version.java")
f.delete()
f << buildconstants_class
}
}
compileJava {
dependsOn = ['writeVersion']
}
task deploy(dependsOn: [jar,test,javadoc], group: 'Build')
if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) {
apply plugin: 'signing'
signing {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment