Skip to content

Commit

Permalink
Added build script to generate artifacts (#166)
Browse files Browse the repository at this point in the history
* Added build script to generate artifacts

Signed-off-by: Owais Kazi <[email protected]>

* Handled code coverage issue

Signed-off-by: Owais Kazi <[email protected]>

* Added missing jar and source jars

Signed-off-by: Owais Kazi <[email protected]>

* Matched maven artifacts name and removed build script

Signed-off-by: Owais Kazi <[email protected]>

---------

Signed-off-by: Owais Kazi <[email protected]>
(cherry picked from commit f70f435)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Nov 21, 2023
1 parent 46c549f commit 092fedc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
37 changes: 19 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ buildscript {
publishing {
publications {
pluginZip(MavenPublication) { publication ->

artifact sourcesJar
artifact javadocJar

pom {
name = pluginName
description = pluginDescription
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name = 'opensearch-ai-flow-framework'
rootProject.name = 'opensearch-flow-framework'

0 comments on commit 092fedc

Please sign in to comment.