Skip to content

Commit

Permalink
Added --timeout comamnd line option to all repo using tools (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
quintesse committed Sep 24, 2014
1 parent eb80916 commit 156f46f
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public abstract class RepoUsingTool extends CeylonBaseTool {
protected String systemRepo;
protected String cacheRepo;
protected String mavenOverrides;
protected int timeout = -1;
protected boolean noDefRepos;
protected boolean offline;
protected Logger log;
Expand Down Expand Up @@ -140,6 +141,12 @@ public void setOffline(boolean offline) {
this.offline = offline;
}

@OptionArgument(shortName='T', longName="timeout", argumentName="seconds")
@Description("Sets the timeout for connections to remote repositories, use 0 for no timeout (default: 20).")
public void setTimeout(int timeout) {
this.timeout = timeout;
}

public void setOut(Appendable out) {
this.out = out;
}
Expand Down Expand Up @@ -167,6 +174,7 @@ protected CeylonUtils.CeylonRepoManagerBuilder createRepositoryManagerBuilderNoO
.noDefaultRepos(noDefRepos)
.userRepos(getRepositoryAsStrings())
.offline(offline)
.timeout((timeout >= 0) ? timeout * 1000 : -1)
.logger(log);
return rmb;
}
Expand Down

0 comments on commit 156f46f

Please sign in to comment.