From 9661ddb358fc69acdc8b824011e760e5db0f6edf Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 27 Nov 2023 15:38:00 -0800 Subject: [PATCH] [Backport feature/agent_framework] Added build script to generate artifacts (#202) Added build script to generate artifacts (#166) * Added build script to generate artifacts * Handled code coverage issue * Added missing jar and source jars * Matched maven artifacts name and removed build script --------- (cherry picked from commit f70f4350b834307b9ec9e4803df36343022f2182) Signed-off-by: Owais Kazi Signed-off-by: github-actions[bot] Co-authored-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 34aa2ca6f..dd108d988 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 @@ -223,26 +227,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'