Skip to content

Commit

Permalink
Merge pull request #36 from harshitvasu/Add-support-for-DSL-with-and-…
Browse files Browse the repository at this point in the history
…without-local-parameters

Add support for Job DSL with and without localConfig key inside browseStackBuildWrapper
  • Loading branch information
francisf authored Feb 22, 2021
2 parents 176c2ff + c9a198b commit 0a8795a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>

<artifactId>browserstack-integration</artifactId>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.2-SNAPSHOT</version>
<packaging>hpi</packaging>

<name>BrowserStack</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import hudson.util.DescribableList;
import org.apache.commons.lang.StringUtils;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.DataBoundSetter;

import java.io.IOException;
import java.io.PrintStream;
Expand All @@ -31,15 +32,19 @@ public class BrowserStackBuildWrapper extends BuildWrapper {

private static final char CHAR_MASK = '*';

private final LocalConfig localConfig;
private LocalConfig localConfig;

private String credentialsId;
private String username;
private String accesskey;

@DataBoundConstructor
public BrowserStackBuildWrapper(String credentialsId, LocalConfig localConfig) {
public BrowserStackBuildWrapper(String credentialsId) {
this.credentialsId = credentialsId;
}

@DataBoundSetter
public void setLocalConfig(LocalConfig localConfig) {
this.localConfig = localConfig;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ public void addBuildStep() throws IOException {
localConfig.setLocalOptions("-force");

BrowserStackBuildWrapper buildWrapper =
new BrowserStackBuildWrapper(credentialsId, localConfig);
new BrowserStackBuildWrapper(credentialsId);
buildWrapper.setLocalConfig(localConfig);
project.getBuildWrappersList().add(buildWrapper);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ public void addBuildStep() throws IOException {
LocalConfig localConfig = new LocalConfig();
localConfig.setLocalOptions("-force");

BrowserStackBuildWrapper buildWrapper = new BrowserStackBuildWrapper(credentialsId, localConfig);
BrowserStackBuildWrapper buildWrapper = new BrowserStackBuildWrapper(credentialsId);
buildWrapper.setLocalConfig(localConfig);
project.getBuildWrappersList().add(buildWrapper);
}

Expand Down

0 comments on commit 0a8795a

Please sign in to comment.