forked from loafle/openapi-generator-original
updated android-volley build.gradle
This commit is contained in:
parent
29c05b5d65
commit
b41efdab5f
@ -62,6 +62,8 @@ public class AndroidVolleyClientCodegen extends DefaultCodegen implements Codege
|
|||||||
instantiationTypes.put("array", "ArrayList");
|
instantiationTypes.put("array", "ArrayList");
|
||||||
instantiationTypes.put("map", "HashMap");
|
instantiationTypes.put("map", "HashMap");
|
||||||
|
|
||||||
|
cliOptions.add(new CliOption(CodegenConstants.MODEL_PACKAGE, CodegenConstants.MODEL_PACKAGE_DESC));
|
||||||
|
cliOptions.add(new CliOption(CodegenConstants.API_PACKAGE, CodegenConstants.API_PACKAGE_DESC));
|
||||||
cliOptions.add(new CliOption(CodegenConstants.INVOKER_PACKAGE, CodegenConstants.INVOKER_PACKAGE_DESC));
|
cliOptions.add(new CliOption(CodegenConstants.INVOKER_PACKAGE, CodegenConstants.INVOKER_PACKAGE_DESC));
|
||||||
cliOptions.add(new CliOption(CodegenConstants.GROUP_ID, "groupId for use in the generated build.gradle and pom.xml"));
|
cliOptions.add(new CliOption(CodegenConstants.GROUP_ID, "groupId for use in the generated build.gradle and pom.xml"));
|
||||||
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_ID, "artifactId for use in the generated build.gradle and pom.xml"));
|
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_ID, "artifactId for use in the generated build.gradle and pom.xml"));
|
||||||
|
@ -25,23 +25,23 @@ public class AndroidVolleyClientOptionsTest extends AbstractOptionsTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void setExpectations() {
|
protected void setExpectations() {
|
||||||
new Expectations(clientCodegen) {{
|
new Expectations(clientCodegen) {{
|
||||||
clientCodegen.setModelPackage(AndroidClientOptionsProvider.MODEL_PACKAGE_VALUE);
|
clientCodegen.setModelPackage(AndroidVolleyClientOptionsProvider.MODEL_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setApiPackage(AndroidClientOptionsProvider.API_PACKAGE_VALUE);
|
clientCodegen.setApiPackage(AndroidVolleyClientOptionsProvider.API_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(AndroidClientOptionsProvider.SORT_PARAMS_VALUE));
|
clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(AndroidVolleyClientOptionsProvider.SORT_PARAMS_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setInvokerPackage(AndroidClientOptionsProvider.INVOKER_PACKAGE_VALUE);
|
clientCodegen.setInvokerPackage(AndroidVolleyClientOptionsProvider.INVOKER_PACKAGE_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setGroupId(AndroidClientOptionsProvider.GROUP_ID_VALUE);
|
clientCodegen.setGroupId(AndroidVolleyClientOptionsProvider.GROUP_ID_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setArtifactId(AndroidClientOptionsProvider.ARTIFACT_ID_VALUE);
|
clientCodegen.setArtifactId(AndroidVolleyClientOptionsProvider.ARTIFACT_ID_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setArtifactVersion(AndroidClientOptionsProvider.ARTIFACT_VERSION_VALUE);
|
clientCodegen.setArtifactVersion(AndroidVolleyClientOptionsProvider.ARTIFACT_VERSION_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setSourceFolder(AndroidClientOptionsProvider.SOURCE_FOLDER_VALUE);
|
clientCodegen.setSourceFolder(AndroidVolleyClientOptionsProvider.SOURCE_FOLDER_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setUseAndroidMavenGradlePlugin(Boolean.valueOf(AndroidClientOptionsProvider.ANDROID_MAVEN_GRADLE_PLUGIN_VALUE));
|
clientCodegen.setUseAndroidMavenGradlePlugin(Boolean.valueOf(AndroidVolleyClientOptionsProvider.ANDROID_MAVEN_GRADLE_PLUGIN_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ public class AndroidVolleyClientOptionsProvider implements OptionsProvider {
|
|||||||
public static final String API_PACKAGE_VALUE = "apiPackage";
|
public static final String API_PACKAGE_VALUE = "apiPackage";
|
||||||
public static final String INVOKER_PACKAGE_VALUE = "io.swagger.client.test";
|
public static final String INVOKER_PACKAGE_VALUE = "io.swagger.client.test";
|
||||||
public static final String SORT_PARAMS_VALUE = "false";
|
public static final String SORT_PARAMS_VALUE = "false";
|
||||||
|
public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
|
||||||
public static final String GROUP_ID_VALUE = "io.swagger.test";
|
public static final String GROUP_ID_VALUE = "io.swagger.test";
|
||||||
public static final String ARTIFACT_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
public static final String ARTIFACT_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||||
public static final String SOURCE_FOLDER_VALUE = "src/main/java/test";
|
public static final String SOURCE_FOLDER_VALUE = "src/main/java/test";
|
||||||
@ -29,6 +30,7 @@ public class AndroidVolleyClientOptionsProvider implements OptionsProvider {
|
|||||||
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
||||||
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||||
|
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
|
||||||
.put(CodegenConstants.INVOKER_PACKAGE, INVOKER_PACKAGE_VALUE)
|
.put(CodegenConstants.INVOKER_PACKAGE, INVOKER_PACKAGE_VALUE)
|
||||||
.put(CodegenConstants.GROUP_ID, GROUP_ID_VALUE)
|
.put(CodegenConstants.GROUP_ID, GROUP_ID_VALUE)
|
||||||
.put(CodegenConstants.ARTIFACT_ID, ARTIFACT_ID_VALUE)
|
.put(CodegenConstants.ARTIFACT_ID, ARTIFACT_ID_VALUE)
|
||||||
|
@ -28,11 +28,11 @@ apply plugin: 'com.github.dcendents.android-maven'
|
|||||||
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 22
|
compileSdkVersion 23
|
||||||
buildToolsVersion '22.0.0'
|
buildToolsVersion '23.0.2'
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 22
|
targetSdkVersion 23
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_7
|
sourceCompatibility JavaVersion.VERSION_1_7
|
||||||
@ -57,6 +57,7 @@ ext {
|
|||||||
gson_version = "2.3.1"
|
gson_version = "2.3.1"
|
||||||
httpclient_version = "4.3.3"
|
httpclient_version = "4.3.3"
|
||||||
junit_version = "4.8.1"
|
junit_version = "4.8.1"
|
||||||
|
volley_version = "1.0.19"
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@ -64,6 +65,7 @@ dependencies {
|
|||||||
compile "com.google.code.gson:gson:$gson_version"
|
compile "com.google.code.gson:gson:$gson_version"
|
||||||
compile "org.apache.httpcomponents:httpcore:$httpclient_version"
|
compile "org.apache.httpcomponents:httpcore:$httpclient_version"
|
||||||
compile "org.apache.httpcomponents:httpmime:$httpclient_version"
|
compile "org.apache.httpcomponents:httpmime:$httpclient_version"
|
||||||
|
compile "com.mcxiaoke.volley:library:${volley_version}@aar"
|
||||||
testCompile "junit:junit:$junit_version"
|
testCompile "junit:junit:$junit_version"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user