Skip to content

Commit 981d2f1

Browse files
committed
Merge pull request #2453 from wing328/bug/fix_2451
[Android] update build.gradle for android (default, volley)
2 parents 16fe8e8 + 00c97c8 commit 981d2f1

File tree

8 files changed

+61
-26
lines changed

8 files changed

+61
-26
lines changed

modules/swagger-codegen/src/main/resources/android/build.mustache

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ buildscript {
88
jcenter()
99
}
1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:1.2.2'
11+
classpath 'com.android.tools.build:gradle:1.5.+'
1212
{{#useAndroidMavenGradlePlugin}}
13-
classpath 'com.github.dcendents:android-maven-plugin:1.2'
13+
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
1414
{{/useAndroidMavenGradlePlugin}}
1515
}
1616
}
@@ -28,11 +28,12 @@ apply plugin: 'com.github.dcendents.android-maven'
2828
{{/useAndroidMavenGradlePlugin}}
2929

3030
android {
31-
compileSdkVersion 22
32-
buildToolsVersion '22.0.0'
31+
compileSdkVersion 23
32+
buildToolsVersion '23.0.2'
33+
useLibrary 'org.apache.http.legacy'
3334
defaultConfig {
3435
minSdkVersion 14
35-
targetSdkVersion 22
36+
targetSdkVersion 23
3637
}
3738
compileOptions {
3839
sourceCompatibility JavaVersion.VERSION_1_7
@@ -55,16 +56,17 @@ android {
5556
ext {
5657
swagger_annotations_version = "1.5.0"
5758
gson_version = "2.3.1"
58-
httpclient_version = "4.3.3"
59-
junit_version = "4.8.1"
59+
httpclient_version = "4.5.2"
60+
httpcore_version = "4.4.4"
61+
junit_version = "4.12"
6062
}
6163

6264
dependencies {
6365
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
6466
compile "com.google.code.gson:gson:$gson_version"
65-
compile "org.apache.httpcomponents:httpcore:$httpclient_version"
67+
compile "org.apache.httpcomponents:httpcore:$httpcore_version"
6668
compile "org.apache.httpcomponents:httpclient:$httpclient_version"
67-
compile ("org.apache.httpcomponents:httpcore:$httpclient_version") {
69+
compile ("org.apache.httpcomponents:httpcore:$httpcore_version") {
6870
exclude(group: 'org.apache.httpcomponents', module: 'httpclient')
6971
}
7072
compile ("org.apache.httpcomponents:httpmime:$httpclient_version") {

modules/swagger-codegen/src/main/resources/android/libraries/volley/apiInvoker.mustache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ public class ApiInvoker {
197197
INSTANCE.authentications.put("{{name}}", new HttpBasicAuth());
198198
{{/isBasic}}
199199
{{#isOAuth}}
200-
INSTANCE.authentications.put("{{name}}", new OAuth());
200+
// TODO: comment out below as OAuth does not exist
201+
//INSTANCE.authentications.put("{{name}}", new OAuth());
201202
{{/isOAuth}}
202203
{{/authMethods}}
203204
// Prevent the authentications from being modified.

modules/swagger-codegen/src/main/resources/android/libraries/volley/build.mustache

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ buildscript {
88
jcenter()
99
}
1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:1.2.2'
11+
classpath 'com.android.tools.build:gradle:1.5.+'
1212
{{#useAndroidMavenGradlePlugin}}
13-
classpath 'com.github.dcendents:android-maven-plugin:1.2'
13+
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
1414
{{/useAndroidMavenGradlePlugin}}
1515
}
1616
}
@@ -59,9 +59,10 @@ android {
5959
ext {
6060
swagger_annotations_version = "1.5.0"
6161
gson_version = "2.3.1"
62-
httpclient_version = "4.3.3"
62+
httpclient_version = "4.5.2"
63+
httpcore_version = "4.4.4"
6364
volley_version = "1.0.19"
64-
junit_version = "4.8.1"
65+
junit_version = "4.12"
6566
robolectric_version = "3.0"
6667
concurrent_unit_version = "0.4.2"
6768
}

samples/client/petstore/android/default/build.gradle

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ buildscript {
66
jcenter()
77
}
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:1.2.2'
9+
classpath 'com.android.tools.build:gradle:1.5.+'
1010

11-
classpath 'com.github.dcendents:android-maven-plugin:1.2'
11+
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
1212

1313
}
1414
}
@@ -24,11 +24,12 @@ apply plugin: 'com.android.library'
2424
apply plugin: 'com.github.dcendents.android-maven'
2525

2626
android {
27-
compileSdkVersion 22
28-
buildToolsVersion '22.0.0'
27+
compileSdkVersion 23
28+
buildToolsVersion '23.0.2'
29+
useLibrary 'org.apache.http.legacy'
2930
defaultConfig {
3031
minSdkVersion 14
31-
targetSdkVersion 22
32+
targetSdkVersion 23
3233
}
3334
compileOptions {
3435
sourceCompatibility JavaVersion.VERSION_1_7
@@ -51,16 +52,17 @@ android {
5152
ext {
5253
swagger_annotations_version = "1.5.0"
5354
gson_version = "2.3.1"
54-
httpclient_version = "4.3.3"
55-
junit_version = "4.8.1"
55+
httpclient_version = "4.5.2"
56+
httpcore_version = "4.4.4"
57+
junit_version = "4.12"
5658
}
5759

5860
dependencies {
5961
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
6062
compile "com.google.code.gson:gson:$gson_version"
61-
compile "org.apache.httpcomponents:httpcore:$httpclient_version"
63+
compile "org.apache.httpcomponents:httpcore:$httpcore_version"
6264
compile "org.apache.httpcomponents:httpclient:$httpclient_version"
63-
compile ("org.apache.httpcomponents:httpcore:$httpclient_version") {
65+
compile ("org.apache.httpcomponents:httpcore:$httpcore_version") {
6466
exclude(group: 'org.apache.httpcomponents', module: 'httpclient')
6567
}
6668
compile ("org.apache.httpcomponents:httpmime:$httpclient_version") {

samples/client/petstore/android/default/src/main/java/io/swagger/client/model/Name.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ public class Name {
1010

1111
@SerializedName("name")
1212
private Integer name = null;
13+
@SerializedName("snake_case")
14+
private Integer snakeCase = null;
1315

1416

1517
/**
@@ -23,13 +25,25 @@ public void setName(Integer name) {
2325
}
2426

2527

28+
/**
29+
**/
30+
@ApiModelProperty(value = "")
31+
public Integer getSnakeCase() {
32+
return snakeCase;
33+
}
34+
public void setSnakeCase(Integer snakeCase) {
35+
this.snakeCase = snakeCase;
36+
}
37+
38+
2639

2740
@Override
2841
public String toString() {
2942
StringBuilder sb = new StringBuilder();
3043
sb.append("class Name {\n");
3144

3245
sb.append(" name: ").append(name).append("\n");
46+
sb.append(" snakeCase: ").append(snakeCase).append("\n");
3347
sb.append("}\n");
3448
return sb.toString();
3549
}

samples/client/petstore/android/volley/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ buildscript {
66
jcenter()
77
}
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:1.2.2'
9+
classpath 'com.android.tools.build:gradle:1.5.0'
1010

11-
classpath 'com.github.dcendents:android-maven-plugin:1.2'
11+
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
1212

1313
}
1414
}

samples/client/petstore/android/volley/src/main/java/io/swagger/client/ApiInvoker.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ public static void initializeInstance(Cache cache, Network network, int threadPo
229229

230230

231231

232-
INSTANCE.authentications.put("petstore_auth", new OAuth());
232+
// TODO: comment out below as OAuth does not exist
233+
//INSTANCE.authentications.put("petstore_auth", new OAuth());
233234

234235

235236
// Prevent the authentications from being modified.

samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Name.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ public class Name {
1010

1111
@SerializedName("name")
1212
private Integer name = null;
13+
@SerializedName("snake_case")
14+
private Integer snakeCase = null;
1315

1416

1517
/**
@@ -23,13 +25,25 @@ public void setName(Integer name) {
2325
}
2426

2527

28+
/**
29+
**/
30+
@ApiModelProperty(value = "")
31+
public Integer getSnakeCase() {
32+
return snakeCase;
33+
}
34+
public void setSnakeCase(Integer snakeCase) {
35+
this.snakeCase = snakeCase;
36+
}
37+
38+
2639

2740
@Override
2841
public String toString() {
2942
StringBuilder sb = new StringBuilder();
3043
sb.append("class Name {\n");
3144

3245
sb.append(" name: ").append(name).append("\n");
46+
sb.append(" snakeCase: ").append(snakeCase).append("\n");
3347
sb.append("}\n");
3448
return sb.toString();
3549
}

0 commit comments

Comments
 (0)