Skip to content
Permalink
Browse files
[JENKINS-30671] Add ability to expan tokens for file name
  • Loading branch information
Brantone committed Sep 28, 2015
1 parent ac25660 commit c7afc24bca36d60463d8871377533a45a73dc8b5
@@ -114,12 +114,13 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListen
final String artifactId = TokenMacro.expandAll(build, listener, a.getArtifactId());
final String groupId = TokenMacro.expandAll(build, listener, a.getGroupId());
final String packaging = TokenMacro.expandAll(build, listener, a.getExtension());
final String targetFileName = TokenMacro.expandAll(build, listener, a.getTargetFileName());

Artifact aTmp = new Artifact(groupId, artifactId, classifier, version, packaging, a.getTargetFileName());
Artifact aTmp = new Artifact(groupId, artifactId, classifier, version, packaging, targetFileName);

String fileName = aTmp.getTargetFileName();
FilePath source = new FilePath(build.getWorkspace(), fileName);
String f = new File(fileName).getName();
String aTmpFileName = aTmp.getTargetFileName();
FilePath source = new FilePath(build.getWorkspace(), aTmpFileName);
String f = new File(aTmpFileName).getName();
int dotPos = f.lastIndexOf(".");
String extension = f.substring(dotPos + 1);
final File targetFile = File.createTempFile(f, "." + extension);

0 comments on commit c7afc24

Please sign in to comment.