diff options
Diffstat (limited to 'app/build.gradle')
-rw-r--r-- | app/build.gradle | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/app/build.gradle b/app/build.gradle index 54f80b2..934edf7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,8 +1,5 @@ -/* - * This file was generated by the Gradle 'init' task. - */ plugins { - id 'org.onap.portal.history.java-application-conventions' + id 'org.onap.portalng.history.java-application-conventions' id 'io.spring.dependency-management' id 'org.springframework.boot' id 'jacoco' @@ -11,6 +8,21 @@ plugins { } apply from: "${rootDir}/gradle/verify-licenses.gradle" +def appVersion = getAppVersion() +sourceCompatibility = '17' +targetCompatibility = '17' + +springBoot { + buildInfo { + properties { + artifact = "org-onap-portalng-history" + version = appVersion + group = "org.onap.portalng" + name = "History service that saves user actions" + } + } +} + configurations { compileOnly { extendsFrom annotationProcessor @@ -78,7 +90,7 @@ jacocoTestReport { application { // Define the main class for the application. - mainClass = 'org.onap.portal.history.HistoryApplication' + mainClass = 'org.onap.portalng.history.HistoryApplication' } sourceCompatibility = '17' @@ -97,13 +109,17 @@ license { } configurations.implementation.setCanBeResolved(true) -springBoot { - buildInfo { - properties { - artifact = "org-onap-portalng-history" - version = rootProject.file('version').text.trim() - group = rootProject.group - name = "History service that saves user actions" - } - } +def String getAppVersion() { + Properties versionProperties = getVersionProperties() + String major = versionProperties.getProperty('major') + String minor = versionProperties.getProperty('minor') + String patch = versionProperties.getProperty('patch') + return major + '.' + minor + '.' + patch +} +def Properties getVersionProperties() { + def versionProperties = new Properties() + rootProject.file('version.properties').withInputStream { + versionProperties.load(it) + } + return versionProperties }
\ No newline at end of file |