Skip to content

Commit fec1f4e

Browse files
committed
Support for resuming builds
1 parent 0a2ed44 commit fec1f4e

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/main/java/org/jenkinsci/plugins/workflow/libs/LibraryAdder.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,9 @@
9999
if (action != null) {
100100
// Resuming a build, so just look up what we loaded before.
101101
for (LibraryRecord record : action.getLibraries()) {
102-
// TODO call LibraryRetriever.dir2Jar as needed
103-
FilePath libDir = new FilePath(execution.getOwner().getRootDir()).child("libs/" + record.getDirectoryName());
104-
for (String root : new String[] {"src", "vars"}) {
105-
FilePath dir = libDir.child(root);
106-
if (dir.isDirectory()) {
107-
additions.add(new Addition(dir.toURI().toURL(), record.trusted));
108-
}
102+
FilePath libJar = new FilePath(execution.getOwner().getRootDir()).child("libs/" + record.getDirectoryName() + ".jar");
103+
if (libJar.exists()) {
104+
additions.add(new Addition(libJar.toURI().toURL(), record.trusted));
109105
}
110106
String unparsed = librariesUnparsed.get(record.name);
111107
if (unparsed != null) {

src/test/java/org/jenkinsci/plugins/workflow/libs/LibraryAdderTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,8 @@ public void parallelBuildsDontInterfereWithExpiredCache() throws Throwable {
516516
// r.assertLogContains("Library library@master is cached. Copying from home.", f2.get());
517517
}
518518

519+
// TODO test migration in LibraryAdder.add after reload build started prior to dir2Jar (@OldData)
520+
519521
@Issue("JENKINS-68544")
520522
@WithoutJenkins
521523
@Test public void className() {

0 commit comments

Comments
 (0)