Skip to content

Commit b41efda

Browse files
committed
updated android-volley build.gradle
1 parent 29c05b5 commit b41efda

File tree

4 files changed

+18
-12
lines changed

4 files changed

+18
-12
lines changed

modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AndroidVolleyClientCodegen.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ public AndroidVolleyClientCodegen() {
6262
instantiationTypes.put("array", "ArrayList");
6363
instantiationTypes.put("map", "HashMap");
6464

65+
cliOptions.add(new CliOption(CodegenConstants.MODEL_PACKAGE, CodegenConstants.MODEL_PACKAGE_DESC));
66+
cliOptions.add(new CliOption(CodegenConstants.API_PACKAGE, CodegenConstants.API_PACKAGE_DESC));
6567
cliOptions.add(new CliOption(CodegenConstants.INVOKER_PACKAGE, CodegenConstants.INVOKER_PACKAGE_DESC));
6668
cliOptions.add(new CliOption(CodegenConstants.GROUP_ID, "groupId for use in the generated build.gradle and pom.xml"));
6769
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_ID, "artifactId for use in the generated build.gradle and pom.xml"));

modules/swagger-codegen/src/test/java/io/swagger/codegen/androidvolley/AndroidVolleyClientOptionsTest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@ protected CodegenConfig getCodegenConfig() {
2525
@Override
2626
protected void setExpectations() {
2727
new Expectations(clientCodegen) {{
28-
clientCodegen.setModelPackage(AndroidClientOptionsProvider.MODEL_PACKAGE_VALUE);
28+
clientCodegen.setModelPackage(AndroidVolleyClientOptionsProvider.MODEL_PACKAGE_VALUE);
2929
times = 1;
30-
clientCodegen.setApiPackage(AndroidClientOptionsProvider.API_PACKAGE_VALUE);
30+
clientCodegen.setApiPackage(AndroidVolleyClientOptionsProvider.API_PACKAGE_VALUE);
3131
times = 1;
32-
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(AndroidClientOptionsProvider.SORT_PARAMS_VALUE));
32+
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(AndroidVolleyClientOptionsProvider.SORT_PARAMS_VALUE));
3333
times = 1;
34-
clientCodegen.setInvokerPackage(AndroidClientOptionsProvider.INVOKER_PACKAGE_VALUE);
34+
clientCodegen.setInvokerPackage(AndroidVolleyClientOptionsProvider.INVOKER_PACKAGE_VALUE);
3535
times = 1;
36-
clientCodegen.setGroupId(AndroidClientOptionsProvider.GROUP_ID_VALUE);
36+
clientCodegen.setGroupId(AndroidVolleyClientOptionsProvider.GROUP_ID_VALUE);
3737
times = 1;
38-
clientCodegen.setArtifactId(AndroidClientOptionsProvider.ARTIFACT_ID_VALUE);
38+
clientCodegen.setArtifactId(AndroidVolleyClientOptionsProvider.ARTIFACT_ID_VALUE);
3939
times = 1;
40-
clientCodegen.setArtifactVersion(AndroidClientOptionsProvider.ARTIFACT_VERSION_VALUE);
40+
clientCodegen.setArtifactVersion(AndroidVolleyClientOptionsProvider.ARTIFACT_VERSION_VALUE);
4141
times = 1;
42-
clientCodegen.setSourceFolder(AndroidClientOptionsProvider.SOURCE_FOLDER_VALUE);
42+
clientCodegen.setSourceFolder(AndroidVolleyClientOptionsProvider.SOURCE_FOLDER_VALUE);
4343
times = 1;
44-
clientCodegen.setUseAndroidMavenGradlePlugin(Boolean.valueOf(AndroidClientOptionsProvider.ANDROID_MAVEN_GRADLE_PLUGIN_VALUE));
44+
clientCodegen.setUseAndroidMavenGradlePlugin(Boolean.valueOf(AndroidVolleyClientOptionsProvider.ANDROID_MAVEN_GRADLE_PLUGIN_VALUE));
4545
times = 1;
4646
}};
4747
}

modules/swagger-codegen/src/test/java/io/swagger/codegen/options/AndroidVolleyClientOptionsProvider.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public class AndroidVolleyClientOptionsProvider implements OptionsProvider {
1313
public static final String API_PACKAGE_VALUE = "apiPackage";
1414
public static final String INVOKER_PACKAGE_VALUE = "io.swagger.client.test";
1515
public static final String SORT_PARAMS_VALUE = "false";
16+
public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
1617
public static final String GROUP_ID_VALUE = "io.swagger.test";
1718
public static final String ARTIFACT_VERSION_VALUE = "1.0.0-SNAPSHOT";
1819
public static final String SOURCE_FOLDER_VALUE = "src/main/java/test";
@@ -29,6 +30,7 @@ public Map<String, String> createOptions() {
2930
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
3031
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
3132
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
33+
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
3234
.put(CodegenConstants.INVOKER_PACKAGE, INVOKER_PACKAGE_VALUE)
3335
.put(CodegenConstants.GROUP_ID, GROUP_ID_VALUE)
3436
.put(CodegenConstants.ARTIFACT_ID, ARTIFACT_ID_VALUE)

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ apply plugin: 'com.github.dcendents.android-maven'
2828

2929

3030
android {
31-
compileSdkVersion 22
32-
buildToolsVersion '22.0.0'
31+
compileSdkVersion 23
32+
buildToolsVersion '23.0.2'
3333
defaultConfig {
3434
minSdkVersion 14
35-
targetSdkVersion 22
35+
targetSdkVersion 23
3636
}
3737
compileOptions {
3838
sourceCompatibility JavaVersion.VERSION_1_7
@@ -57,13 +57,15 @@ ext {
5757
gson_version = "2.3.1"
5858
httpclient_version = "4.3.3"
5959
junit_version = "4.8.1"
60+
volley_version = "1.0.19"
6061
}
6162

6263
dependencies {
6364
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
6465
compile "com.google.code.gson:gson:$gson_version"
6566
compile "org.apache.httpcomponents:httpcore:$httpclient_version"
6667
compile "org.apache.httpcomponents:httpmime:$httpclient_version"
68+
compile "com.mcxiaoke.volley:library:${volley_version}@aar"
6769
testCompile "junit:junit:$junit_version"
6870
}
6971

0 commit comments

Comments
 (0)