Merge pull request #3039 from cbornet/spring_interface

[Spring] Add an option to only generate stubs of the API and no server files
This commit is contained in:
wing328
2016-06-09 01:38:17 +08:00
45 changed files with 1989 additions and 306 deletions

View File

@@ -10,6 +10,8 @@ public class SpringBootServerOptionsProvider extends JavaOptionsProvider {
public static final String CONFIG_PACKAGE_VALUE = "configPackage";
public static final String BASE_PACKAGE_VALUE = "basePackage";
public static final String LIBRARY_VALUE = "j8-async"; //FIXME hidding value from super class
public static final String INTERFACE_ONLY = "true";
public static final String SINGLE_CONTENT_TYPES = "true";
@Override
public String getLanguage() {
@@ -22,6 +24,9 @@ public class SpringBootServerOptionsProvider extends JavaOptionsProvider {
options.put(SpringBootServerCodegen.CONFIG_PACKAGE, CONFIG_PACKAGE_VALUE);
options.put(SpringBootServerCodegen.BASE_PACKAGE, BASE_PACKAGE_VALUE);
options.put(CodegenConstants.LIBRARY, LIBRARY_VALUE);
options.put(SpringBootServerCodegen.INTERFACE_ONLY, INTERFACE_ONLY);
options.put(SpringBootServerCodegen.SINGLE_CONTENT_TYPES, SINGLE_CONTENT_TYPES);
return options;
}

View File

@@ -54,6 +54,10 @@ public class SpringBootServerOptionsTest extends JavaClientOptionsTest {
times = 1;
clientCodegen.setBasePackage(SpringBootServerOptionsProvider.BASE_PACKAGE_VALUE);
times = 1;
clientCodegen.setInterfaceOnly(Boolean.valueOf(SpringBootServerOptionsProvider.INTERFACE_ONLY));
times = 1;
clientCodegen.setSingleContentTypes(Boolean.valueOf(SpringBootServerOptionsProvider.SINGLE_CONTENT_TYPES));
times = 1;
}};
}