34 lines
922 B
Groovy
34 lines
922 B
Groovy
pipeline {
|
|
agent any
|
|
stages {
|
|
stage('Compile'){
|
|
steps {
|
|
sh "mkdir -p bin"
|
|
sh "/tool/jdk1.6.0_45/bin/javac -target 1.5 -d bin \$(find ./src/* | grep .java)"
|
|
}
|
|
}
|
|
stage('Test'){
|
|
steps {
|
|
sh '''
|
|
find bin/test -name "*.class" | sed \'s/bin\\///\' | sed \'s/\\.class//\' | tr \'/\' \'.\' | xargs -I {} java -cp ./bin:/tool/junit4/* org.junit.runner.JUnitCore {}
|
|
'''
|
|
}
|
|
}
|
|
stage('Package'){
|
|
steps {
|
|
dir("bin")
|
|
{
|
|
sh "/tool/jdk1.6.0_45/bin/jar cvfm ../CrossJeeves.jar ../manifest.txt ."
|
|
}
|
|
}
|
|
}
|
|
stage('Archive Artifacts')
|
|
{
|
|
when {triggeredBy 'UserIdCause'}
|
|
steps{
|
|
archiveArtifacts artifacts: 'CrossJeeves.jar'
|
|
}
|
|
}
|
|
}
|
|
}
|