Skip to content

Commit

Permalink
[JENKINS-30671] Add ability to expan tokens for file name
Browse files Browse the repository at this point in the history
  • Loading branch information
Brantone committed Sep 28, 2015
1 parent ac25660 commit c7afc24
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -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);
Expand Down

0 comments on commit c7afc24

Please sign in to comment.