Skip to content

Commit

Permalink
Fixing version file generation. (#828)
Browse files Browse the repository at this point in the history
  • Loading branch information
TSC21 authored and MiguelCompany committed Nov 4, 2019
1 parent 8ff02ee commit 0bb98d0
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions fastrtpsgen/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ apply plugin: 'java'
apply plugin: 'eclipse' // Eclipse integration

description = """"""
def version_str = "0.0.0"

repositories {
mavenCentral()
Expand All @@ -41,11 +42,18 @@ task copyResources {
}

// Create version file
Properties pversion = new Properties()
project.hasProperty('customversion') ? pversion.setProperty('version', project.customversion.toString()) : pversion.setProperty('version', '0.0.0')
File versionFile = new File("${project.buildDir}/resources/main/version")
versionFile.createNewFile();
pversion.store(versionFile.newWriter(), null)
outputs.file versionFile
doLast {
// Create version file
Properties pversion = new Properties()
project.hasProperty('customversion')
? pversion.setProperty('version', project.customversion.toString())
: pversion.setProperty('version', version_str)
versionFile.withWriter {
pversion.store(it, null)
}
}
}

sourceSets {
Expand Down

0 comments on commit 0bb98d0

Please sign in to comment.