From 092fedc148b115602a715d2870de8f4d3477da6e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 21 Nov 2023 00:56:20 +0000 Subject: [PATCH] Added build script to generate artifacts (#166) * Added build script to generate artifacts Signed-off-by: Owais Kazi * Handled code coverage issue Signed-off-by: Owais Kazi * Added missing jar and source jars Signed-off-by: Owais Kazi * Matched maven artifacts name and removed build script Signed-off-by: Owais Kazi --------- Signed-off-by: Owais Kazi (cherry picked from commit f70f4350b834307b9ec9e4803df36343022f2182) Signed-off-by: github-actions[bot] --- build.gradle | 37 +++++++++++++++++++------------------ settings.gradle | 2 +- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/build.gradle b/build.gradle index cf75db3fd..8eb865716 100644 --- a/build.gradle +++ b/build.gradle @@ -78,6 +78,10 @@ buildscript { publishing { publications { pluginZip(MavenPublication) { publication -> + + artifact sourcesJar + artifact javadocJar + pom { name = pluginName description = pluginDescription @@ -224,26 +228,23 @@ task updateVersion { } } -// Get uncommitted files via git diff -// https://github.com/form-com/diff-coverage-gradle/issues/73 -ext.createDiffFile = { -> - def file = Files.createTempFile(URLEncoder.encode(project.name, 'UTF-8'), '.diff').toFile() - def diffBase = 'refs/remotes/origin/main' - // Only run locally - if (!System.getenv('CI')) { - file.withOutputStream { out -> - exec { - commandLine 'git', 'diff', '--no-color', '--minimal', diffBase - standardOutput = out - } - } - } - return file -} - diffCoverageReport { afterEvaluate { - diffSource.file = createDiffFile() + // Get uncommitted files via git diff + // https://github.com/form-com/diff-coverage-gradle/issues/73 + def file = Files.createTempFile(URLEncoder.encode(project.name, 'UTF-8'), '.diff').toFile() + def diffBase = 'refs/remotes/origin/main' + // Only run locally + if (!System.getenv('CI')) { + file.withOutputStream { out -> + exec { + ignoreExitValue true + commandLine 'git', 'diff', '--no-color', '--minimal', diffBase, '|| true' + standardOutput = out + } + } + } + diffSource.file = file } // View report at build/reports/jacoco/diffCoverage/html/index.html diff --git a/settings.gradle b/settings.gradle index d1a06120e..ea45f08b8 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -rootProject.name = 'opensearch-ai-flow-framework' +rootProject.name = 'opensearch-flow-framework'