Now using reader and writer to access the properties file.
This commit is contained in:
parent
5b8a298a2b
commit
e378d47946
1 changed files with 5 additions and 5 deletions
|
@ -59,8 +59,8 @@ class SemverPlugin : Plugin<Project> {
|
|||
put(config.preReleasePrefixKey, version.preReleasePrefix)
|
||||
if (version.separator != Version.DEFAULT_SEPARATOR)
|
||||
put(config.separatorKey, version.separator)
|
||||
FileOutputStream(config.properties).use { output ->
|
||||
store(output, "Generated by the Semver Plugin for Gradle")
|
||||
FileOutputStream(config.properties).writer().use { writer ->
|
||||
store(writer, "Generated by the Semver Plugin for Gradle")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -88,11 +88,11 @@ class SemverPlugin : Plugin<Project> {
|
|||
}
|
||||
propsFile.apply {
|
||||
project.logger.info(
|
||||
if (canRead()) {
|
||||
FileInputStream(this).use { fis ->
|
||||
"[$simpleName] Attempting to read properties from: `$absoluteFile`. [exists: ${exists()}, isFile: $isFile, canRead: ${canRead()}]")
|
||||
if (canRead() && isFile) {
|
||||
FileInputStream(this).reader().use { reader ->
|
||||
Properties().apply {
|
||||
load(fis)
|
||||
load(reader)
|
||||
version.major = getProperty(config.majorKey, Version.DEFAULT_MAJOR)
|
||||
version.minor = getProperty(config.minorKey, Version.DEFAULT_MINOR)
|
||||
version.patch = getProperty(config.patchKey, Version.DEFAULT_PATCH)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue