Skip to content
Snippets Groups Projects
Commit 15f038be authored by Johannes Mey's avatar Johannes Mey
Browse files

update version management, reset to version 0.1.0

parent 369fa978
No related branches found
No related tags found
No related merge requests found
......@@ -47,15 +47,37 @@ sourceSets {
File genSrc = file("src/gen/java")
idea.module.generatedSourceDirs += genSrc
def versionFile = 'src/main/resources/preprocessor.properties'
def versionProps = new Properties()
def versionFile = 'src/main/resources/RelASTPreprocessorVersion.properties'
def oldProps = new Properties()
try {
file(versionFile).withInputStream { stream -> versionProps.load(stream) }
version = versionProps['version']
} catch (e) {
file(versionFile).withInputStream { stream -> oldProps.load(stream) }
version = oldProps['version']
} catch (ignored) {
// this happens, if either the properties file is not present, or cannot be read from
throw new GradleException("File ${versionFile} not found or unreadable. Aborting.", e)
throw new GradleException("File ${versionFile} not found or unreadable. Aborting.")
}
task newVersion() {
doFirst {
def props = new Properties()
props['version'] = value
props.store(file(versionFile).newWriter(), null)
}
}
task printVersion() {
doLast {
println(version)
}
}
task setDevVersionForCI() {
doFirst {
def props = new Properties()
props['version'] = version + "-$System.env.CI_PIPELINE_IID"
props.store(file(versionFile).newWriter(), null)
}
}
dependencies {
......@@ -70,9 +92,6 @@ dependencies {
implementation group: 'com.github.jknack', name: 'handlebars', version: '4.3.0'
implementation group: 'org.yaml', name: 'snakeyaml', version: '1.27'
// test
// testRuntimeClasspath files(modelJar.archiveFile.get())
// test fixtures
testFixturesApi group: 'org.slf4j', name: 'slf4j-jdk14', version: '1.7.30'
testFixturesApi group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.7.0'
......
version=0.1.0
version=1.0.0-pre-release
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment