2016-12-02 06:07:22 -05:00
|
|
|
// This script is used as input to the Jenkins Job DSL plugin to create all the build-jobs that
|
2017-05-04 05:25:40 -04:00
|
|
|
// Apache POI uses on the public Jenkins instance at https://builds.apache.org/view/P/view/POI/
|
2016-12-02 06:07:22 -05:00
|
|
|
//
|
|
|
|
// See https://github.com/jenkinsci/job-dsl-plugin/wiki for information about the DSL, you can
|
|
|
|
// use http://job-dsl.herokuapp.com/ to validate the code before checkin
|
2016-11-27 06:06:48 -05:00
|
|
|
//
|
2016-12-01 14:09:26 -05:00
|
|
|
|
2016-12-01 15:49:29 -05:00
|
|
|
def triggerSundays = '''
|
|
|
|
# only run this once per week on Sundays
|
|
|
|
H H * * 0
|
|
|
|
'''
|
2016-12-01 14:09:31 -05:00
|
|
|
|
2017-08-01 15:44:17 -04:00
|
|
|
def findbugs2Url = 'http://downloads.sourceforge.net/project/findbugs/findbugs/2.0.3/findbugs-noUpdateChecks-2.0.3.zip?download='
|
|
|
|
def findbugs2Lib = 'lib/findbugs-noUpdateChecks-2.0.3.zip'
|
|
|
|
def findbugs3Url = 'http://downloads.sourceforge.net/project/findbugs/findbugs/3.0.1/findbugs-noUpdateChecks-3.0.1.zip?download='
|
|
|
|
def findbugs3Lib = 'lib/findbugs-noUpdateChecks-3.0.1.zip'
|
2017-07-31 18:56:08 -04:00
|
|
|
def xercesUrl = 'http://repo1.maven.org/maven2/xerces/xercesImpl/2.6.1/xercesImpl-2.6.1.jar'
|
|
|
|
def xercesLib = 'compile-lib/xercesImpl-2.6.1.jar'
|
|
|
|
|
2016-12-01 14:09:26 -05:00
|
|
|
def poijobs = [
|
2016-12-11 05:54:44 -05:00
|
|
|
[ name: 'POI-DSL-1.6',
|
2016-12-08 04:36:57 -05:00
|
|
|
// workaround as Sourceforge does not accept any of the SSL ciphers in JDK 6 any more and thus we cannot download this jar
|
|
|
|
// as part of the Ant build
|
2017-09-15 14:39:47 -04:00
|
|
|
addShell: "wget -O ${findbugs2Lib} ${findbugs2Url}",
|
|
|
|
disabled: true
|
2016-12-01 14:09:31 -05:00
|
|
|
],
|
2017-02-12 20:09:40 -05:00
|
|
|
[ name: 'POI-DSL-1.8', jdk: '1.8', trigger: 'H */12 * * *'
|
2016-12-01 14:09:26 -05:00
|
|
|
],
|
2016-12-30 17:12:14 -05:00
|
|
|
[ name: 'POI-DSL-OpenJDK', jdk: 'OpenJDK', trigger: 'H */12 * * *',
|
2016-12-16 07:40:17 -05:00
|
|
|
// H13-H20 (Ubuntu 16.04) do not have OpenJDK 6 installed, see https://issues.apache.org/jira/browse/INFRA-12880
|
2017-07-19 15:02:53 -04:00
|
|
|
slaveAdd: '&&!beam1&&!beam2&&!beam3&&!beam4&&!beam5&&!beam6&&!beam7&&!beam8&&!H12&&!H13&&!H14&&!H15&&!H16&&!H17&&!H18&&!H19&&!H20&&!H21&&!H22&&!H23&&!H24&&!H25&&!H26&&!H27&&!qnode1&&!qnode2&&!qnode3&&!ubuntu-eu2&&!ubuntu-eu3&&!ubuntu-us1',
|
2016-12-06 16:10:29 -05:00
|
|
|
// the JDK is missing on some slaves so builds are unstable
|
|
|
|
skipcigame: true
|
2016-12-01 14:09:31 -05:00
|
|
|
],
|
2016-12-30 17:12:14 -05:00
|
|
|
[ name: 'POI-DSL-1.9', jdk: '1.9', trigger: triggerSundays,
|
2016-12-30 12:00:13 -05:00
|
|
|
properties: ['-Dmaxpermsize=-Dthis.is.a.dummy=true',
|
|
|
|
'-Djava9addmods=--add-modules=java.xml.bind',
|
2016-12-31 11:53:20 -05:00
|
|
|
'-Djavadoc9addmods=--add-modules=java.xml.bind',
|
2016-12-30 12:00:13 -05:00
|
|
|
'-Djava9addmodsvalue=-Dsun.reflect.debugModuleAccessChecks=true',
|
2017-02-05 17:34:46 -05:00
|
|
|
'-Djava9addopens1=--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED',
|
2016-12-30 12:00:13 -05:00
|
|
|
'-Djava9addopens2=--add-opens=java.base/java.io=ALL-UNNAMED',
|
|
|
|
'-Djava9addopens3=--add-opens=java.base/java.nio=ALL-UNNAMED',
|
|
|
|
'-Djava9addopens4=--add-opens=java.base/java.lang=ALL-UNNAMED',
|
2017-01-26 14:59:10 -05:00
|
|
|
'-Djava9addopens5=--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED',
|
2016-12-30 12:00:13 -05:00
|
|
|
'-Djava.locale.providers=JRE,CLDR'],
|
2016-12-30 17:12:10 -05:00
|
|
|
skipcigame: true
|
2016-12-02 06:07:22 -05:00
|
|
|
],
|
2016-12-30 17:19:12 -05:00
|
|
|
[ name: 'POI-DSL-IBM-JDK', jdk: 'IBMJDK', trigger: triggerSundays,
|
2016-12-09 02:56:47 -05:00
|
|
|
// some OOXML tests fail with strange XML parsing errors and missing JCE unlimited strength requirements
|
|
|
|
disabled: true, skipcigame: true
|
2016-12-01 15:49:29 -05:00
|
|
|
],
|
2016-12-11 05:54:44 -05:00
|
|
|
[ name: 'POI-DSL-old-Xerces', trigger: triggerSundays,
|
2017-07-31 18:56:08 -04:00
|
|
|
shell: "mkdir -p compile-lib && test -f ${xercesLib} || wget -O ${xercesLib} ${xercesUrl}\n",
|
2016-12-01 15:49:29 -05:00
|
|
|
// the property triggers using Xerces as XML Parser and previously showed some exception that can occur
|
2017-07-31 18:56:08 -04:00
|
|
|
properties: ["-Dadditionaljar=${xercesLib}"],
|
2016-12-11 05:54:44 -05:00
|
|
|
// workaround as Sourceforge does not accept any of the SSL ciphers in JDK 6 any more and thus we cannot download this jar
|
|
|
|
// as part of the Ant build
|
2017-08-01 15:44:17 -04:00
|
|
|
addShell: "wget -O ${findbugs2Lib} ${findbugs2Url}"
|
2016-12-01 15:49:29 -05:00
|
|
|
],
|
2016-12-04 13:29:47 -05:00
|
|
|
[ name: 'POI-DSL-Maven', trigger: 'H */4 * * *', maven: true
|
2016-12-01 15:49:29 -05:00
|
|
|
],
|
2016-12-04 13:29:47 -05:00
|
|
|
[ name: 'POI-DSL-regenerate-javadoc', trigger: triggerSundays, javadoc: true
|
2016-12-01 15:49:29 -05:00
|
|
|
],
|
2017-09-15 14:39:47 -04:00
|
|
|
[ name: 'POI-DSL-API-Check', jdk: '1.8', trigger: '@daily', apicheck: true
|
2016-12-01 16:08:22 -05:00
|
|
|
],
|
2017-09-15 14:39:47 -04:00
|
|
|
[ name: 'POI-DSL-Gradle', jdk: '1.8', trigger: triggerSundays, email: 'centic@apache.org', gradle: true,
|
2016-12-09 02:56:47 -05:00
|
|
|
// Gradle will not run any tests if the code is up-to-date, therefore manually mark the files as updated
|
2017-04-02 15:38:37 -04:00
|
|
|
addShell: 'touch --no-create build/*/build/test-results/TEST-*.xml build/*/build/test-results/test/TEST-*.xml'
|
2016-12-01 16:08:22 -05:00
|
|
|
],
|
2016-12-04 13:29:47 -05:00
|
|
|
[ name: 'POI-DSL-no-scratchpad', trigger: triggerSundays, noScratchpad: true
|
2016-12-01 15:49:29 -05:00
|
|
|
],
|
2017-08-13 07:42:35 -04:00
|
|
|
[ name: 'POI-DSL-SonarQube', jdk: '1.8', trigger: 'H 9 * * *', maven: true, sonar: true, skipcigame: true
|
2016-12-17 18:52:48 -05:00
|
|
|
],
|
2017-03-10 15:13:46 -05:00
|
|
|
[ name: 'POI-DSL-SonarQube-Gradle', jdk: '1.8', trigger: 'H 9 * * *', gradle: true, sonar: true, skipcigame: true
|
|
|
|
],
|
2017-08-01 15:44:17 -04:00
|
|
|
[ name: 'POI-DSL-Windows-1.6', jdk: '1.6', trigger: 'H */12 * * *', windows: true, slaves: 'Windows',
|
2017-09-15 14:39:47 -04:00
|
|
|
addShell: "@if not exist ${findbugs2Lib} powershell -Command wget -Uri \"${findbugs2Url}\" -OutFile ${findbugs2Lib} -UserAgent [Microsoft.PowerShell.Commands.PSUsergAgent]::Chrome",
|
|
|
|
disabled: true
|
2017-07-31 11:29:28 -04:00
|
|
|
],
|
2017-08-05 15:47:32 -04:00
|
|
|
[ name: 'POI-DSL-Windows-1.7', jdk: '1.7', trigger: 'H */12 * * *', windows: true, slaves: 'Windows',
|
2017-09-15 14:39:47 -04:00
|
|
|
addShell: "@if not exist ${findbugs3Lib} powershell -Command wget -Uri \"${findbugs3Url}\" -OutFile ${findbugs3Lib} -UserAgent [Microsoft.PowerShell.Commands.PSUsergAgent]::Chrome",
|
|
|
|
disabled: true
|
2017-07-31 11:29:28 -04:00
|
|
|
],
|
2017-08-01 15:44:17 -04:00
|
|
|
[ name: 'POI-DSL-Windows-1.8', jdk: '1.8', trigger: 'H */12 * * *', windows: true, slaves: 'Windows'
|
2017-07-31 11:29:28 -04:00
|
|
|
],
|
2016-12-01 14:09:26 -05:00
|
|
|
]
|
|
|
|
|
2016-12-08 04:36:48 -05:00
|
|
|
def svnBase = 'https://svn.apache.org/repos/asf/poi/trunk'
|
2016-12-30 17:12:14 -05:00
|
|
|
def defaultJdk = '1.6'
|
2016-12-31 04:43:13 -05:00
|
|
|
def defaultTrigger = 'H/15 * * * *' // check SCM every 60/15 = 4 minutes
|
2016-12-01 14:09:31 -05:00
|
|
|
def defaultEmail = 'dev@poi.apache.org'
|
2017-02-14 11:18:55 -05:00
|
|
|
def defaultAnt = 'Ant 1.9.9'
|
2017-08-13 07:42:35 -04:00
|
|
|
// currently a lot of H?? slaves don't have Ant installed ... H21 seems to have a SVN problem
|
|
|
|
def defaultSlaves = 'ubuntu&&!cloud-slave&&!H15&&!H17&&!H18&&!H24&&!ubuntu-4&&!H21'
|
2016-12-01 14:09:26 -05:00
|
|
|
|
|
|
|
def jdkMapping = [
|
2016-12-08 04:36:48 -05:00
|
|
|
'1.6': 'JDK 1.6 (latest)',
|
|
|
|
'1.7': 'JDK 1.7 (latest)',
|
|
|
|
'1.8': 'JDK 1.8 (latest)',
|
2017-08-01 02:26:39 -04:00
|
|
|
'1.9': 'JDK 9 b179 (early access build)',
|
2016-12-08 04:36:48 -05:00
|
|
|
'OpenJDK': 'OpenJDK 6 (on Ubuntu only) ', // blank is required here until the name in the Jenkins instance is fixed!
|
|
|
|
'IBMJDK': 'IBM 1.8 64-bit (on Ubuntu only)',
|
2016-12-01 14:09:26 -05:00
|
|
|
]
|
|
|
|
|
2017-07-31 14:21:48 -04:00
|
|
|
def shellEx(def context, String cmd, def poijob) {
|
|
|
|
if (poijob.windows) {
|
|
|
|
context.batchFile(cmd)
|
|
|
|
} else {
|
|
|
|
context.shell(cmd)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-31 18:56:08 -04:00
|
|
|
def defaultDesc = '''
|
2017-01-30 17:05:29 -05:00
|
|
|
<img src="https://poi.apache.org/resources/images/project-logo.jpg" />
|
2016-12-01 15:49:29 -05:00
|
|
|
<p>
|
|
|
|
Apache POI - the Java API for Microsoft Documents
|
|
|
|
</p>
|
|
|
|
<p>
|
2016-12-30 17:12:14 -05:00
|
|
|
<b>This is an automatically generated Job Config, do not edit it here!
|
2017-01-30 17:05:29 -05:00
|
|
|
Instead change the Jenkins Job DSL at <a href="https://svn.apache.org/repos/asf/poi/trunk/jenkins">https://svn.apache.org/repos/asf/poi/trunk/jenkins</a>,
|
2016-12-30 17:12:14 -05:00
|
|
|
see <a href="https://github.com/jenkinsci/job-dsl-plugin/wiki">https://github.com/jenkinsci/job-dsl-plugin/wiki</a>
|
|
|
|
for more details about the DSL.</b>
|
2016-12-03 14:50:28 -05:00
|
|
|
</p>'''
|
|
|
|
|
2017-07-31 18:56:08 -04:00
|
|
|
def apicheckDesc = '''
|
2016-12-03 14:50:28 -05:00
|
|
|
<p>
|
2016-12-30 17:12:14 -05:00
|
|
|
<b><a href="https://builds.apache.org/analysis/dashboard?id=org.apache.poi%3Apoi-parent&did=1" target="_blank">Sonar reports</a></b> -
|
|
|
|
<p>
|
|
|
|
<b><a href="lastSuccessfulBuild/artifact/build/main/build/reports/japi.html">API Check POI</a></b>
|
|
|
|
<b><a href="lastSuccessfulBuild/artifact/build/ooxml/build/reports/japi.html">API Check POI-OOXML</a></b>
|
|
|
|
<b><a href="lastSuccessfulBuild/artifact/build/excelant/build/reports/japi.html">API Check POI-Excelant</a></b>
|
|
|
|
<b><a href="lastSuccessfulBuild/artifact/build/scratchpad/build/reports/japi.html">API Check POI-Scratchpad</a></b>
|
|
|
|
|
2016-12-01 15:49:29 -05:00
|
|
|
</p>
|
2016-12-03 14:50:28 -05:00
|
|
|
'''
|
2017-07-31 18:56:08 -04:00
|
|
|
|
|
|
|
def sonarDesc = '''
|
2016-12-01 15:49:29 -05:00
|
|
|
<p>
|
2016-12-30 17:12:14 -05:00
|
|
|
<b><a href="lastSuccessfulBuild/findbugsResult/" target="_blank">Findbugs report of latest build</a></b> -
|
|
|
|
<b><a href="https://builds.apache.org/analysis/dashboard?id=org.apache.poi%3Apoi-parent&did=1" target="_blank">Sonar reports</a></b> -
|
|
|
|
<b><a href="lastSuccessfulBuild/artifact/build/coverage/index.html" target="_blank">Coverage of latest build</a></b>
|
2016-12-01 15:49:29 -05:00
|
|
|
</p>
|
2017-07-31 18:56:08 -04:00
|
|
|
'''
|
|
|
|
|
|
|
|
def shellCmdsUnix =
|
|
|
|
'''# show which files are currently modified in the working copy
|
|
|
|
svn status
|
|
|
|
|
|
|
|
# print out information about which exact version of java we are using
|
|
|
|
echo Java-Home: $JAVA_HOME
|
|
|
|
ls -al $JAVA_HOME/
|
|
|
|
$JAVA_HOME/bin/java -version
|
|
|
|
|
|
|
|
POIJOBSHELL
|
|
|
|
|
|
|
|
# ignore any error message
|
|
|
|
exit 0'''
|
|
|
|
|
|
|
|
def shellCmdsWin =
|
|
|
|
'''@echo off
|
|
|
|
:: show which files are currently modified in the working copy
|
|
|
|
svn status
|
|
|
|
|
|
|
|
:: print out information about which exact version of java we are using
|
|
|
|
echo Java-Home: %JAVA_HOME%
|
|
|
|
dir "%JAVA_HOME:\\\\=\\%"
|
|
|
|
"%JAVA_HOME%/bin/java" -version
|
|
|
|
|
|
|
|
POIJOBSHELL
|
|
|
|
|
|
|
|
:: ignore any error message
|
|
|
|
exit /b 0'''
|
|
|
|
|
|
|
|
poijobs.each { poijob ->
|
|
|
|
def jdkKey = poijob.jdk ?: defaultJdk
|
|
|
|
def trigger = poijob.trigger ?: defaultTrigger
|
|
|
|
def email = poijob.email ?: defaultEmail
|
|
|
|
def slaves = poijob.slaves ?: defaultSlaves + (poijob.slaveAdd ?: '')
|
|
|
|
def antRT = defaultAnt + (poijob.windows ? ' (Windows)' : '')
|
|
|
|
|
|
|
|
job(poijob.name) {
|
|
|
|
if (poijob.disabled) {
|
|
|
|
disabled()
|
|
|
|
}
|
|
|
|
|
|
|
|
description( defaultDesc + (poijob.apicheck ? apicheckDesc : sonarDesc) )
|
2016-12-30 17:12:14 -05:00
|
|
|
logRotator {
|
|
|
|
numToKeep(5)
|
|
|
|
artifactNumToKeep(1)
|
|
|
|
}
|
|
|
|
label(slaves)
|
|
|
|
environmentVariables {
|
|
|
|
env('LANG', 'en_US.UTF-8')
|
|
|
|
if(jdkKey == '1.9') {
|
2016-12-31 04:43:13 -05:00
|
|
|
// when using JDK 9 for running Ant, we need to provide more packages for the forbidden-api-checks task
|
2017-08-19 12:31:33 -04:00
|
|
|
env('ANT_OPTS', '--add-modules=java.xml.bind --add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED')
|
2016-12-01 15:49:29 -05:00
|
|
|
}
|
2016-12-30 17:12:14 -05:00
|
|
|
}
|
|
|
|
wrappers {
|
|
|
|
timeout {
|
|
|
|
absolute(180)
|
|
|
|
abortBuild()
|
|
|
|
writeDescription('Build was aborted due to timeout')
|
|
|
|
}
|
|
|
|
if(poijob.sonar) {
|
|
|
|
configure { project ->
|
|
|
|
project / buildWrappers << 'hudson.plugins.sonar.SonarBuildWrapper' {}
|
2016-12-30 15:35:13 -05:00
|
|
|
}
|
2016-12-01 15:49:29 -05:00
|
|
|
}
|
2016-12-30 17:12:14 -05:00
|
|
|
}
|
|
|
|
jdk(jdkMapping.get(jdkKey))
|
|
|
|
scm {
|
|
|
|
svn(svnBase) { svnNode ->
|
|
|
|
svnNode / browser(class: 'hudson.scm.browsers.ViewSVN') /
|
|
|
|
url << 'http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
triggers {
|
|
|
|
scm(trigger)
|
|
|
|
}
|
|
|
|
|
2017-07-31 18:56:08 -04:00
|
|
|
def shellcmds = (poijob.windows ? shellCmdsWin : shellCmdsUnix).replace('POIJOBSHELL', poijob.shell ?: '')
|
2016-12-30 17:12:14 -05:00
|
|
|
|
|
|
|
// Create steps and publishers depending on the type of Job that is selected
|
|
|
|
if(poijob.maven) {
|
|
|
|
steps {
|
2017-07-31 14:21:48 -04:00
|
|
|
shellEx(delegate, shellcmds, poijob)
|
2016-12-30 17:12:14 -05:00
|
|
|
maven {
|
|
|
|
goals('clean')
|
|
|
|
rootPOM('sonar/pom.xml')
|
|
|
|
localRepository(LocalRepositoryLocation.LOCAL_TO_WORKSPACE)
|
|
|
|
mavenInstallation('maven-3.2.1')
|
2016-12-01 15:49:29 -05:00
|
|
|
}
|
2016-12-30 17:12:14 -05:00
|
|
|
/* Currently not done, let's see if it is still necessary:
|
|
|
|
# Maven-Download fails for strange reasons, try to workaround...
|
|
|
|
mkdir -p sonar/ooxml-schema-security/target/schemas && wget -O sonar/ooxml-schema-security/target/schemas/xmldsig-core-schema.xsd http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd
|
|
|
|
*/
|
|
|
|
maven {
|
|
|
|
if(poijob.sonar) {
|
|
|
|
goals('compile $SONAR_MAVEN_GOAL -Dsonar.host.url=$SONAR_HOST_URL')
|
|
|
|
} else {
|
|
|
|
goals('package')
|
2016-12-17 18:52:48 -05:00
|
|
|
}
|
2016-12-30 17:12:14 -05:00
|
|
|
rootPOM('sonar/pom.xml')
|
|
|
|
mavenOpts('-Xmx2g')
|
|
|
|
mavenOpts('-Xms256m')
|
|
|
|
mavenOpts('-XX:MaxPermSize=512m')
|
|
|
|
mavenOpts('-XX:-OmitStackTraceInFastThrow')
|
|
|
|
localRepository(LocalRepositoryLocation.LOCAL_TO_WORKSPACE)
|
|
|
|
mavenInstallation('maven-3.2.1')
|
2016-12-17 18:52:48 -05:00
|
|
|
}
|
2016-12-01 15:49:29 -05:00
|
|
|
}
|
2016-12-30 17:12:14 -05:00
|
|
|
publishers {
|
|
|
|
if (!poijob.skipcigame) {
|
|
|
|
configure { project ->
|
|
|
|
project / publishers << 'hudson.plugins.cigame.GamePublisher' {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
mailer(email, false, false)
|
2016-12-01 15:49:29 -05:00
|
|
|
}
|
2016-12-30 17:12:14 -05:00
|
|
|
} else if (poijob.javadoc) {
|
|
|
|
steps {
|
2017-07-31 14:21:48 -04:00
|
|
|
shellEx(delegate, shellcmds, poijob)
|
2016-12-30 17:12:14 -05:00
|
|
|
ant {
|
|
|
|
targets(['clean', 'javadocs'] + (poijob.properties ?: []))
|
|
|
|
prop('coverage.enabled', true)
|
|
|
|
// Properties did not work, so I had to use targets instead
|
|
|
|
//properties(poijob.properties ?: '')
|
2017-07-31 11:29:28 -04:00
|
|
|
antInstallation(antRT)
|
2016-12-30 17:12:14 -05:00
|
|
|
}
|
2017-07-31 14:21:48 -04:00
|
|
|
shellEx(delegate, 'zip -r build/javadocs.zip build/tmp/site/build/site/apidocs', poijob)
|
2016-12-01 15:49:29 -05:00
|
|
|
}
|
2016-12-30 17:12:14 -05:00
|
|
|
publishers {
|
|
|
|
if (!poijob.skipcigame) {
|
|
|
|
configure { project ->
|
|
|
|
project / publishers << 'hudson.plugins.cigame.GamePublisher' {}
|
2016-12-01 15:49:29 -05:00
|
|
|
}
|
|
|
|
}
|
2016-12-30 17:12:14 -05:00
|
|
|
mailer(email, false, false)
|
|
|
|
}
|
|
|
|
} else if (poijob.apicheck) {
|
|
|
|
steps {
|
2017-07-31 14:21:48 -04:00
|
|
|
shellEx(delegate, shellcmds, poijob)
|
2016-12-30 17:12:14 -05:00
|
|
|
gradle {
|
|
|
|
tasks('japicmp')
|
|
|
|
useWrapper(false)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
publishers {
|
|
|
|
archiveArtifacts('build/*/build/reports/japi.html')
|
|
|
|
if (!poijob.skipcigame) {
|
|
|
|
configure { project ->
|
2017-03-10 15:13:46 -05:00
|
|
|
project / publishers << 'hudson.plugins.cigame.GamePublisher' {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
mailer(email, false, false)
|
|
|
|
}
|
|
|
|
} else if(poijob.sonar) {
|
|
|
|
steps {
|
2017-07-31 14:21:48 -04:00
|
|
|
shellEx(delegate, shellcmds, poijob)
|
2017-03-10 15:13:46 -05:00
|
|
|
gradle {
|
|
|
|
switches('-PenableSonar')
|
2017-03-13 08:18:21 -04:00
|
|
|
switches('-Dsonar.host.url=$SONAR_HOST_URL')
|
2017-03-10 15:13:46 -05:00
|
|
|
tasks('sonarqube')
|
|
|
|
useWrapper(false)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
publishers {
|
|
|
|
if (!poijob.skipcigame) {
|
|
|
|
configure { project ->
|
2016-12-30 17:12:14 -05:00
|
|
|
project / publishers << 'hudson.plugins.cigame.GamePublisher' {}
|
2016-12-01 15:49:29 -05:00
|
|
|
}
|
|
|
|
}
|
2016-12-30 17:12:14 -05:00
|
|
|
mailer(email, false, false)
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
steps {
|
2017-07-31 14:21:48 -04:00
|
|
|
shellEx(delegate, shellcmds, poijob)
|
2016-12-30 17:12:14 -05:00
|
|
|
if(poijob.addShell) {
|
2017-07-31 14:21:48 -04:00
|
|
|
shellEx(delegate, poijob.addShell, poijob)
|
2016-12-30 17:12:14 -05:00
|
|
|
}
|
|
|
|
// For Jobs that should still have the default set of publishers we can configure different steps here
|
|
|
|
if(poijob.gradle) {
|
|
|
|
gradle {
|
|
|
|
tasks('check')
|
|
|
|
useWrapper(false)
|
|
|
|
}
|
|
|
|
} else if (poijob.noScratchpad) {
|
2016-12-01 15:49:29 -05:00
|
|
|
ant {
|
2016-12-30 17:12:14 -05:00
|
|
|
targets(['clean', 'compile-all'] + (poijob.properties ?: []))
|
|
|
|
prop('coverage.enabled', true)
|
2017-07-31 11:29:28 -04:00
|
|
|
antInstallation(antRT)
|
2016-12-30 17:12:14 -05:00
|
|
|
}
|
|
|
|
ant {
|
2017-01-26 14:58:29 -05:00
|
|
|
targets(['-Dscratchpad.ignore=true', 'jacocotask', 'test-all', 'testcoveragereport'] + (poijob.properties ?: []))
|
2016-12-30 17:19:12 -05:00
|
|
|
prop('coverage.enabled', true)
|
2017-07-31 11:29:28 -04:00
|
|
|
antInstallation(antRT)
|
2016-12-30 17:12:14 -05:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
ant {
|
|
|
|
targets(['clean', 'jenkins'] + (poijob.properties ?: []))
|
2016-12-01 15:49:29 -05:00
|
|
|
prop('coverage.enabled', true)
|
|
|
|
// Properties did not work, so I had to use targets instead
|
|
|
|
//properties(poijob.properties ?: '')
|
2017-07-31 11:29:28 -04:00
|
|
|
antInstallation(antRT)
|
2016-12-01 15:49:29 -05:00
|
|
|
}
|
2016-12-30 17:12:14 -05:00
|
|
|
ant {
|
|
|
|
targets(['run'] + (poijob.properties ?: []))
|
|
|
|
buildFile('src/integrationtest/build.xml')
|
|
|
|
// Properties did not work, so I had to use targets instead
|
|
|
|
//properties(poijob.properties ?: '')
|
2017-07-31 11:29:28 -04:00
|
|
|
antInstallation(antRT)
|
2016-12-01 15:49:29 -05:00
|
|
|
}
|
|
|
|
}
|
2016-12-30 17:12:14 -05:00
|
|
|
}
|
|
|
|
publishers {
|
|
|
|
findbugs('build/findbugs.xml', false) {
|
|
|
|
healthLimits(3, 20)
|
|
|
|
thresholdLimit('low')
|
|
|
|
defaultEncoding('UTF-8')
|
2016-12-01 16:08:22 -05:00
|
|
|
}
|
2016-12-30 17:12:14 -05:00
|
|
|
// in archive, junit and jacoco publishers, matches beneath build/*/build/... are for Gradle-build results
|
|
|
|
archiveArtifacts('build/dist/*.tar.gz,build/findbugs.html,build/coverage/**,build/integration-test-results/**,ooxml-lib/**,build/*/build/libs/*.jar')
|
|
|
|
warnings(['Java Compiler (javac)', 'JavaDoc Tool'], null) {
|
|
|
|
resolveRelativePaths()
|
2016-12-01 15:49:29 -05:00
|
|
|
}
|
2017-02-21 01:28:12 -05:00
|
|
|
archiveJunit('build/ooxml-test-results/*.xml,build/scratchpad-test-results/*.xml,build/test-results/*.xml,build/excelant-test-results/*.xml,build/integration-test-results/*.xml,build/*/build/test-results/test/TEST-*.xml,build/*/build/test-results/TEST-*.xml') {
|
2016-12-30 17:12:14 -05:00
|
|
|
testDataPublishers {
|
|
|
|
publishTestStabilityData()
|
2016-12-01 16:08:22 -05:00
|
|
|
}
|
2016-12-01 15:49:29 -05:00
|
|
|
}
|
2016-12-30 17:12:14 -05:00
|
|
|
jacocoCodeCoverage {
|
2016-12-31 04:43:13 -05:00
|
|
|
classPattern('build/classes,build/excelant-classes,build/ooxml-classes,build/scratchpad-classes,build/*/build/classes')
|
2016-12-30 17:12:14 -05:00
|
|
|
execPattern('build/*.exec,build/*/build/jacoco/*.exec')
|
|
|
|
sourcePattern('src/java,src/excelant/java,src/ooxml/java,src/scratchpad/src')
|
|
|
|
exclusionPattern('com/microsoft/**,org/openxmlformats/**,org/etsi/**,org/w3/**,schemaorg*/**,schemasMicrosoft*/**,org/apache/poi/hdf/model/hdftypes/definitions/*.class,org/apache/poi/hwpf/model/types/*.class,org/apache/poi/hssf/usermodel/DummyGraphics2d.class,org/apache/poi/sl/draw/binding/*.class')
|
|
|
|
}
|
2016-12-02 07:52:05 -05:00
|
|
|
|
2016-12-30 17:12:14 -05:00
|
|
|
if (!poijob.skipcigame) {
|
|
|
|
configure { project ->
|
|
|
|
project / publishers << 'hudson.plugins.cigame.GamePublisher' {}
|
2016-12-01 15:49:29 -05:00
|
|
|
}
|
|
|
|
}
|
2016-12-30 17:12:14 -05:00
|
|
|
mailer(email, false, false)
|
2016-12-01 15:49:29 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-11-27 06:06:48 -05:00
|
|
|
}
|
2017-05-04 04:40:12 -04:00
|
|
|
|
2017-05-04 04:52:44 -04:00
|
|
|
/* I tried to put the view into a sub-folder/sub-view, but failed, there are multiple related
|
|
|
|
plugins so this is all a bit confusing :(, see also https://issues.apache.org/jira/browse/INFRA-14002
|
2017-05-04 04:40:12 -04:00
|
|
|
dashboardView("P/POI-new") {
|
|
|
|
columns {
|
|
|
|
status()
|
|
|
|
weather()
|
|
|
|
configureProject()
|
|
|
|
buildButton()
|
|
|
|
cronTrigger()
|
|
|
|
lastBuildConsole()
|
|
|
|
name()
|
|
|
|
lastSuccess()
|
|
|
|
lastFailure()
|
|
|
|
lastDuration()
|
|
|
|
//lastSuccessDescription()
|
|
|
|
jacoco()
|
|
|
|
}
|
|
|
|
description("Jobs related to building/testing Apache POI")
|
2017-05-04 04:52:44 -04:00
|
|
|
filterBuildQueue(false)
|
2017-05-04 04:40:12 -04:00
|
|
|
filterExecutors(false)
|
|
|
|
|
|
|
|
// Job selection
|
2017-05-04 04:52:44 -04:00
|
|
|
jobs {*/
|
|
|
|
//regex(/.*POI.*/)
|
|
|
|
/*}
|
2017-05-04 04:40:12 -04:00
|
|
|
|
|
|
|
// Layout
|
|
|
|
topPortlets {
|
|
|
|
jenkinsJobsList {
|
|
|
|
displayName('POI jobs')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
leftPortlets {
|
|
|
|
testStatisticsChart()
|
|
|
|
}
|
|
|
|
rightPortlets {
|
|
|
|
testTrendChart()
|
|
|
|
}
|
|
|
|
bottomPortlets {
|
|
|
|
testStatisticsGrid()
|
|
|
|
buildStatistics()
|
|
|
|
}
|
2017-05-04 04:52:44 -04:00
|
|
|
}*/
|