Skip to content
Permalink
Browse files

[JENKINS-50692] [INFRA-1571] #3394: JEP-305 Incrementals in core

  • Loading branch information
jglick committed May 3, 2018
1 parent 3465da4 commit 3fb17fb0bbb824a6c929af3809022c280cb6270a
Showing with 33 additions and 30 deletions.
  1. +1 −0 .gitignore
  2. +7 −0 .mvn/extensions.xml
  3. +1 −0 .mvn/maven.config
  4. +13 −18 Jenkinsfile
  5. +1 −1 cli/pom.xml
  6. +1 −1 core/pom.xml
  7. +7 −8 pom.xml
  8. +1 −1 test/pom.xml
  9. +1 −1 war/pom.xml
@@ -1,4 +1,5 @@
target
.flattened-pom.xml
work

# IntelliJ project files
@@ -0,0 +1,7 @@
<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
<extension>
<groupId>io.jenkins.tools</groupId>
<artifactId>git-changelist-maven-extension</artifactId>
<version>1.0-alpha-3</version>
</extension>
</extensions>
@@ -0,0 +1 @@
-Pmight-produce-incrementals
@@ -30,6 +30,9 @@ for(i = 0; i < buildTypes.size(); i++) {
checkout scm
}

def changelistF = "${pwd tmp: true}/changelist"
def m2repo = "${pwd tmp: true}/m2repo"

// Now run the actual build.
stage("${buildType} Build / Test") {
timeout(time: 180, unit: 'MINUTES') {
@@ -39,7 +42,7 @@ for(i = 0; i < buildTypes.size(); i++) {
"MAVEN_OPTS=-Xmx1536m -Xms512m"]) {
// Actually run Maven!
// -Dmaven.repo.local=… tells Maven to create a subdir in the temporary directory for the local Maven repository
def mvnCmd = "mvn -Pdebug -U javadoc:javadoc clean install ${runTests ? '-Dmaven.test.failure.ignore' : '-DskipTests'} -V -B -Dmaven.repo.local=${pwd tmp: true}/m2repo -s settings-azure.xml -e"
def mvnCmd = "mvn -Pdebug -U -Dset.changelist help:evaluate -Dexpression=changelist -Doutput=$changelistF clean install ${runTests ? '-Dmaven.test.failure.ignore' : '-DskipTests'} -V -B -Dmaven.repo.local=$m2repo -s settings-azure.xml -e"
if(isUnix()) {
sh mvnCmd
sh 'test `git status --short | tee /dev/stderr | wc --bytes` -eq 0'
@@ -52,14 +55,17 @@ for(i = 0; i < buildTypes.size(); i++) {

// Once we've built, archive the artifacts and the test results.
stage("${buildType} Publishing") {
def files = findFiles(glob: '**/target/*.jar, **/target/*.war, **/target/*.hpi')
renameFiles(files, buildType.toLowerCase())

archiveArtifacts artifacts: '**/target/*.jar, **/target/*.war, **/target/*.hpi',
fingerprint: true
if (runTests) {
junit healthScaleFactor: 20.0, testResults: '*/target/surefire-reports/*.xml'
}
if (buildType == 'Linux') {
def changelist = readFile(changelistF)
dir(m2repo) {
archiveArtifacts artifacts: "**/*$changelist/*$changelist*",
excludes: '**/*.lastUpdated,**/jenkins-test/',
fingerprint: true
}
}
}
}
}
@@ -91,6 +97,7 @@ builds.ath = {

builds.failFast = failFast
parallel builds
infra.maybePublishIncrementals()

// This method sets up the Maven and JDK tools, puts them in the environment along
// with whatever other arbitrary environment variables we passed in, and runs the
@@ -115,15 +122,3 @@ void withMavenEnv(List envVars = [], def body) {
body.call()
}
}

void renameFiles(def files, String prefix) {
for(i = 0; i < files.length; i++) {
def newPath = files[i].path.replace(files[i].name, "${prefix}-${files[i].name}")
def rename = "${files[i].path} ${newPath}"
if(isUnix()) {
sh "mv ${rename}"
} else {
bat "move ${rename}"
}
}
}
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-parent</artifactId>
<version>2.120-SNAPSHOT</version>
<version>${revision}${changelist}</version>
</parent>

<artifactId>cli</artifactId>
@@ -29,7 +29,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-parent</artifactId>
<version>2.120-SNAPSHOT</version>
<version>${revision}${changelist}</version>
</parent>

<artifactId>jenkins-core</artifactId>
15 pom.xml
@@ -28,13 +28,13 @@ THE SOFTWARE.
<parent>
<groupId>org.jenkins-ci</groupId>
<artifactId>jenkins</artifactId>
<version>1.41</version>
<version>1.43</version>
<relativePath />
</parent>

<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-parent</artifactId>
<version>2.120-SNAPSHOT</version>
<version>${revision}${changelist}</version>
<packaging>pom</packaging>

<name>Jenkins main module</name>
@@ -59,7 +59,7 @@ THE SOFTWARE.
<connection>scm:git:git://github.com/jenkinsci/jenkins.git</connection>
<developerConnection>scm:git:ssh://git@github.com/jenkinsci/jenkins.git</developerConnection>
<url>https://github.com/jenkinsci/jenkins</url>
<tag>HEAD</tag>
<tag>${scmTag}</tag>
</scm>

<distributionManagement>
@@ -75,6 +75,9 @@ THE SOFTWARE.
</issueManagement>

<properties>
<revision>2.120</revision>
<changelist>-SNAPSHOT</changelist>

<!-- *.html files are in UTF-8, and *.properties are in iso-8859-1, so this configuration is actually incorrect,
but this suppresses a warning from Maven, and as long as we don't do filtering we should be OK. -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -505,10 +508,6 @@ THE SOFTWARE.
<artifactId>maven-makepkgs-plugin</artifactId>
<version>0.6.2</version>
</plugin>
<plugin>
<groupId>org.jenkins-ci.tools</groupId>
<artifactId>maven-hpi-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
@@ -566,7 +565,7 @@ THE SOFTWARE.
<artifactId>maven-release-plugin</artifactId>
<configuration>
<!-- enable release profile during the release, create IPS package, and sign bits. -->
<prepareVerifyArgs>-P release,sign</prepareVerifyArgs>
<arguments>-P release,sign</arguments>
<!-- work around for a bug in javadoc plugin that causes the release to fail. see MRELEASE-271 -->
<preparationGoals>clean install</preparationGoals>
<goals>-DskipTests -Danimal.sniffer.skip=false javadoc:javadoc deploy javadoc:aggregate</goals>
@@ -28,7 +28,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-parent</artifactId>
<version>2.120-SNAPSHOT</version>
<version>${revision}${changelist}</version>
</parent>

<artifactId>jenkins-test</artifactId>
@@ -28,7 +28,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-parent</artifactId>
<version>2.120-SNAPSHOT</version>
<version>${revision}${changelist}</version>
</parent>

<artifactId>jenkins-war</artifactId>

0 comments on commit 3fb17fb

Please sign in to comment.
You can’t perform that action at this time.