Skip to content

Commit 11fd4c9

Browse files
authored
Merge pull request #1 from kajinka13/master
add proxy options
2 parents c906abd + ca1d2b8 commit 11fd4c9

2 files changed

Lines changed: 20 additions & 5 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions-snapshots/gradle-5.0-20180912002106+0000-bin.zip
3+
distributionUrl=http\://services.gradle.org/distributions/gradle-5.0-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

src/main/java/App.java

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,19 @@ public class App {
5151
@Option(name = "-notesFile", forbids = "-notes", usage = "(optional) Release notes from file")
5252
private String notesPath;
5353

54+
@Option(name = "-proxyHost", forbids = "", usage = "(optional) Configure the proxy address")
55+
private String proxyHost;
56+
57+
@Option(name = "-proxyPort", forbids = "", usage = "(optional) Configure the proxy port")
58+
private String proxyPort;
59+
5460
/**
5561
* Entry point
56-
*
62+
*
5763
* @param args process arguments
5864
*/
5965
public static void main(String... args) {
66+
6067
try {
6168
// do upload
6269
new App().parseArgs(args).upload();
@@ -70,7 +77,7 @@ public static void main(String... args) {
7077

7178
/**
7279
* Construct localized version on message
73-
*
80+
*
7481
* @param message message
7582
* @return localized version
7683
*/
@@ -91,7 +98,7 @@ public String format(Object... args) {
9198

9299
/**
93100
* Parse process arguments.
94-
*
101+
*
95102
* @param args process arguments
96103
* @throws Exception argumentss error
97104
* @return {@link App} instance
@@ -123,10 +130,18 @@ private App parseArgs(String... args) throws CmdLineException {
123130

124131
/**
125132
* Perform apk upload an release on given track
126-
*
133+
*
127134
* @throws Exception Upload error
128135
*/
129136
private void upload() throws Exception {
137+
// configure proxy
138+
if (this.proxyHost != null && !this.proxyHost.isEmpty()) {
139+
System.setProperty("https.proxyHost", this.proxyHost);
140+
}
141+
142+
if (this.proxyPort != null && !this.proxyPort.isEmpty()) {
143+
System.setProperty("https.proxyPort", this.proxyPort);
144+
}
130145

131146
// load key file credentials
132147
System.out.println("Loading account credentials...");

0 commit comments

Comments
 (0)