Skip to content

Commit

Permalink
Reorganize Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
ref-humbold committed Feb 18, 2024
1 parent 2490d00 commit 489414b
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pipeline {
JDK_NAME = "Open JDK"
ANT_NAME = "Ant"
ANT_OUTPUT_DIR = "antBuild"
GRADLE_OUTPUT_DIR = "build"
}

options {
Expand All @@ -34,20 +35,31 @@ pipeline {
stage("Build") {
steps {
echo "#INFO: Building project"
sh "gradle jar"
// withAnt(installation: "${env.ANT_NAME}", jdk: "${env.JDK_NAME}") {
// sh "ant main"
// }
withGradle {
sh "gradle jar"
}
}
}

stage("Unit tests") {
steps {
echo "#INFO: Running unit tests"
sh "gradle test"
// withAnt(installation: "${env.ANT_NAME}", jdk: "${env.JDK_NAME}") {
// sh "ant test"
// }
withGradle {
sh "gradle test"
}
}

post {
always {
junit(
testResults: "build/test-results/test/TEST-*.xml",
// testResults: "${env.ANT_OUTPUT_DIR}/junit/result/TEST-*.xml",
testResults: "${env.GRADLE_OUTPUT_DIR}/test-results/test/TEST-*.xml",
healthScaleFactor: 1.0,
skipPublishingChecks: true
)
Expand All @@ -64,7 +76,8 @@ pipeline {
}

steps {
archiveArtifacts(artifacts: "build/libs/*.jar", onlyIfSuccessful: true)
// archiveArtifacts(artifacts: "${env.ANT_OUTPUT_DIR}/dist/*.jar", onlyIfSuccessful: true)
archiveArtifacts(artifacts: "${env.GRADLE_OUTPUT_DIR}/libs/*.jar", onlyIfSuccessful: true)
}
}

Expand All @@ -77,14 +90,19 @@ pipeline {
}

steps {
echo "#INFO: Publish Javadoc"
echo "#INFO: Publish Javadoc"
// withAnt(installation: "${env.ANT_NAME}", jdk: "${env.JDK_NAME}") {
// sh "ant docs"
// }
withGradle {
sh "gradle javadoc"
}
}

post {
always {
javadoc(javadocDir: "build/docs/javadoc", keepAll: false)
// javadoc(javadocDir: "${env.ANT_OUTPUT_DIR}/docs", keepAll: false)
javadoc(javadocDir: "${env.GRADLE_OUTPUT_DIR}/docs/javadoc", keepAll: false)
}
}
}
Expand Down

0 comments on commit 489414b

Please sign in to comment.