You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by al...@apache.org on 2022/05/11 14:38:44 UTC

[fineract] branch 1.7.0 updated: Last minute release plugin fixes

This is an automated email from the ASF dual-hosted git repository.

aleks pushed a commit to branch 1.7.0
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/1.7.0 by this push:
     new b42423b94 Last minute release plugin fixes
b42423b94 is described below

commit b42423b941ab2fc28e6996c306ff4bc41a35e28f
Author: Aleks <al...@apache.org>
AuthorDate: Wed May 11 16:38:29 2022 +0200

    Last minute release plugin fixes
---
 .../main/groovy/org.apache.fineract.release.gradle |  9 ++++++--
 .../apache/fineract/gradle/FineractPlugin.groovy   | 12 +++++-----
 .../fineract/gradle/FineractPluginExtension.groovy |  2 +-
 .../fineract/gradle/service/GpgService.groovy      | 26 +++++++++++++++-------
 fineract-war/build.gradle                          | 17 +++++---------
 5 files changed, 37 insertions(+), 29 deletions(-)

diff --git a/buildSrc/src/main/groovy/org.apache.fineract.release.gradle b/buildSrc/src/main/groovy/org.apache.fineract.release.gradle
index 50bd11a9d..3345ff886 100644
--- a/buildSrc/src/main/groovy/org.apache.fineract.release.gradle
+++ b/buildSrc/src/main/groovy/org.apache.fineract.release.gradle
@@ -111,7 +111,9 @@ fineract {
                 templateFile: "${projectDir}/buildSrc/src/main/resources/jira/changelog.txt.ftl"
             ],
             gpg: [
-                file: "${projectDir}/buildSrc/build/libs/buildSrc.jar"
+                files: [
+                    "${projectDir}/buildSrc/build/libs/buildSrc.jar"
+                ]
             ]
         ],
         step1: [
@@ -173,7 +175,10 @@ fineract {
             order: 7,
             description: 'Sign the distribution artifacts',
             gpg: [
-                file: "${rootDir}/fineract-war/build/distributions/apache-fineract-binary-${project.version}.tar.gz"
+                files: [
+                    "${rootDir}/fineract-war/build/distributions/apache-fineract-${project.version}-src.tar.gz",
+                    "${rootDir}/fineract-war/build/distributions/apache-fineract-${project.version}-binary.tar.gz"
+                ]
             ]
         ],
         step8: [
diff --git a/buildSrc/src/main/groovy/org/apache/fineract/gradle/FineractPlugin.groovy b/buildSrc/src/main/groovy/org/apache/fineract/gradle/FineractPlugin.groovy
index fb308c7a2..305952da8 100644
--- a/buildSrc/src/main/groovy/org/apache/fineract/gradle/FineractPlugin.groovy
+++ b/buildSrc/src/main/groovy/org/apache/fineract/gradle/FineractPlugin.groovy
@@ -324,7 +324,7 @@ class FineractPlugin implements Plugin<Project> {
 
         // step 6
         project.tasks.register("fineractReleaseStep6") {
-            dependsOn(":fineract-war:binaryDistTar")
+            dependsOn(":fineract-war:distTar")
         }
 
         // step 7
@@ -334,13 +334,11 @@ class FineractPlugin implements Plugin<Project> {
 
                 gpgService.sign(step.gpg)
 
-                def md5 = gpgService.md5(step.gpg)
-                def md5File = new File("${step.gpg.file}.md5")
-                md5File.write md5
+                step.gpg.files.findAll {
+                    gpgService.md5(step.gpg)
 
-                def sha512 = gpgService.sha512(step.gpg)
-                def sha512File = new File("${step.gpg.file}.sha512")
-                sha512File.write sha512
+                    gpgService.sha512(step.gpg)
+                }
             }
         }
 
diff --git a/buildSrc/src/main/groovy/org/apache/fineract/gradle/FineractPluginExtension.groovy b/buildSrc/src/main/groovy/org/apache/fineract/gradle/FineractPluginExtension.groovy
index fad37e071..b38834f33 100644
--- a/buildSrc/src/main/groovy/org/apache/fineract/gradle/FineractPluginExtension.groovy
+++ b/buildSrc/src/main/groovy/org/apache/fineract/gradle/FineractPluginExtension.groovy
@@ -159,6 +159,6 @@ class FineractPluginExtension {
     }
 
     static class FineractPluginGpgParams {
-        String file
+        List<String> files
     }
 }
diff --git a/buildSrc/src/main/groovy/org/apache/fineract/gradle/service/GpgService.groovy b/buildSrc/src/main/groovy/org/apache/fineract/gradle/service/GpgService.groovy
index 7e8c6470f..9750c128a 100644
--- a/buildSrc/src/main/groovy/org/apache/fineract/gradle/service/GpgService.groovy
+++ b/buildSrc/src/main/groovy/org/apache/fineract/gradle/service/GpgService.groovy
@@ -92,11 +92,13 @@ class GpgService {
     }
 
     void sign(FineractPluginExtension.FineractPluginGpgParams params) {
-        InputStream is = new FileInputStream(params.file)
+        params.files.findAll {
+            InputStream is = new FileInputStream(it)
 
-        BCPGOutputStream os = new BCPGOutputStream(new ArmoredOutputStream(new FileOutputStream(params.file + ".asc")))
-        sign(is).encode(os)
-        os.close();
+            BCPGOutputStream os = new BCPGOutputStream(new ArmoredOutputStream(new FileOutputStream(it + ".asc")))
+            sign(is).encode(os)
+            os.close();
+        }
     }
 
     PGPSignature sign(InputStream is) throws IOException, PGPException, GeneralSecurityException {
@@ -115,12 +117,20 @@ class GpgService {
     }
 
 
-    String md5(FineractPluginExtension.FineractPluginGpgParams params) {
-        return calc(new FileInputStream(params.file), MessageDigest.getInstance("MD5", BouncyCastleProvider.PROVIDER_NAME))
+    void md5(FineractPluginExtension.FineractPluginGpgParams params) {
+        params.files.findAll {
+            def result = calc(new FileInputStream(it), MessageDigest.getInstance("MD5", BouncyCastleProvider.PROVIDER_NAME))
+            def file = new File("${it}.md5")
+            file.write result
+        }
     }
 
-    String sha512(FineractPluginExtension.FineractPluginGpgParams params) {
-        return calc(new FileInputStream(params.file), MessageDigest.getInstance("SHA-512", BouncyCastleProvider.PROVIDER_NAME))
+    void sha512(FineractPluginExtension.FineractPluginGpgParams params) {
+        params.files.findAll {
+            def result = calc(new FileInputStream(it), MessageDigest.getInstance("SHA-512", BouncyCastleProvider.PROVIDER_NAME))
+            def file = new File("${it}.sha512")
+            file.write result
+        }
     }
 
     private static String calc(InputStream is, MessageDigest digest) {
diff --git a/fineract-war/build.gradle b/fineract-war/build.gradle
index aca955e22..1690079ac 100644
--- a/fineract-war/build.gradle
+++ b/fineract-war/build.gradle
@@ -58,11 +58,7 @@ tasks.withType(Tar) {
 
 distributions {
     binary {
-        if(project.hasProperty("distVersion")) {
-            distributionBaseName = "apache-fineract-$distVersion-binary"
-        } else {
-            distributionBaseName = "apache-fineract-binary"
-        }
+        distributionBaseName = 'apache-fineract-binary'
         contents {
             from ("$rootDir/fineract-client/build/libs/") {
                 include 'fineract-client-*.jar'
@@ -88,12 +84,7 @@ distributions {
         }
     }
     src {
-        if(project.hasProperty("distVersion")) {
-            distributionBaseName = "apache-fineract-$distVersion-src"
-        } else {
-            distributionBaseName = "apache-fineract-src"
-        }
-
+        distributionBaseName = 'apache-fineract-src'
         contents {
             from "$rootDir/"
             exclude '**/build' , '.git', '**/.gradle', '.github', '**/.settings', '**/.project', '**/.classpath', '.idea', 'out', '._.DS_Store', '.DS_Store', 'WebContent', '**/.externalToolbuilders', '.theia', '.gitpod.yml', '.travis.yml', 'LICENSE_RELEASE', 'NOTICE_RELEASE', '**/licenses', '*.class', '**/bin', '*.log', '.dockerignore', '**/.gitkeep'
@@ -101,6 +92,10 @@ distributions {
             rename ('NOTICE_SOURCE', 'NOTICE')
         }
     }
+    doLast {
+        file("${buildDir}/distributions/apache-fineract-binary-${version}.tar.gz").renameTo("${buildDir}/distributions/apache-fineract-${version}-binary.tar.gz")
+        file("${buildDir}/distributions/apache-fineract-src-${version}.tar.gz").renameTo("${buildDir}/distributions/apache-fineract-${version}-src.tar.gz")
+    }
 }
 
 binaryDistZip.enabled false