forked from loafle/openapi-generator-original
Fix customized source folder in Java client (#1978)
* fix customized source folder in java client * update samples
This commit is contained in:
parent
bc6997f0e5
commit
65d9e859be
@ -349,6 +349,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
|||||||
if (additionalProperties.containsKey(CodegenConstants.SOURCE_FOLDER)) {
|
if (additionalProperties.containsKey(CodegenConstants.SOURCE_FOLDER)) {
|
||||||
this.setSourceFolder((String) additionalProperties.get(CodegenConstants.SOURCE_FOLDER));
|
this.setSourceFolder((String) additionalProperties.get(CodegenConstants.SOURCE_FOLDER));
|
||||||
}
|
}
|
||||||
|
additionalProperties.put(CodegenConstants.SOURCE_FOLDER, sourceFolder);
|
||||||
|
|
||||||
if (additionalProperties.containsKey(CodegenConstants.LOCAL_VARIABLE_PREFIX)) {
|
if (additionalProperties.containsKey(CodegenConstants.LOCAL_VARIABLE_PREFIX)) {
|
||||||
this.setLocalVariablePrefix((String) additionalProperties.get(CodegenConstants.LOCAL_VARIABLE_PREFIX));
|
this.setLocalVariablePrefix((String) additionalProperties.get(CodegenConstants.LOCAL_VARIABLE_PREFIX));
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
apply plugin: 'idea'
|
apply plugin: 'idea'
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
|
{{#sourceFolder}}
|
||||||
|
apply plugin: 'java'
|
||||||
|
{{/sourceFolder}}
|
||||||
|
|
||||||
group = '{{groupId}}'
|
group = '{{groupId}}'
|
||||||
version = '{{artifactVersion}}'
|
version = '{{artifactVersion}}'
|
||||||
@ -18,8 +21,12 @@ buildscript {
|
|||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
|
{{#sourceFolder}}
|
||||||
|
sourceSets {
|
||||||
|
main.java.srcDirs = ['{{sourceFolder}}']
|
||||||
|
}
|
||||||
|
|
||||||
|
{{/sourceFolder}}
|
||||||
if(hasProperty('target') && target == 'android') {
|
if(hasProperty('target') && target == 'android') {
|
||||||
|
|
||||||
apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
|
@ -121,8 +121,7 @@
|
|||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<sources>
|
<sources>
|
||||||
<source>
|
<source>{{{sourceFolder}}}</source>
|
||||||
src/main/java</source>
|
|
||||||
</sources>
|
</sources>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
@ -134,8 +133,7 @@
|
|||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<sources>
|
<sources>
|
||||||
<source>
|
<source>src/test/java</source>
|
||||||
src/test/java</source>
|
|
||||||
</sources>
|
</sources>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
apply plugin: 'idea'
|
apply plugin: 'idea'
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
|
apply plugin: 'java'
|
||||||
|
|
||||||
group = 'org.openapitools'
|
group = 'org.openapitools'
|
||||||
version = '1.0.0'
|
version = '1.0.0'
|
||||||
@ -18,7 +19,9 @@ buildscript {
|
|||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
|
sourceSets {
|
||||||
|
main.java.srcDirs = ['src/main/java']
|
||||||
|
}
|
||||||
|
|
||||||
if(hasProperty('target') && target == 'android') {
|
if(hasProperty('target') && target == 'android') {
|
||||||
|
|
||||||
|
@ -114,8 +114,7 @@
|
|||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<sources>
|
<sources>
|
||||||
<source>
|
<source>src/main/java</source>
|
||||||
src/main/java</source>
|
|
||||||
</sources>
|
</sources>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
@ -127,8 +126,7 @@
|
|||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<sources>
|
<sources>
|
||||||
<source>
|
<source>src/test/java</source>
|
||||||
src/test/java</source>
|
|
||||||
</sources>
|
</sources>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
apply plugin: 'idea'
|
apply plugin: 'idea'
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
|
apply plugin: 'java'
|
||||||
|
|
||||||
group = 'org.openapitools'
|
group = 'org.openapitools'
|
||||||
version = '1.0.0'
|
version = '1.0.0'
|
||||||
@ -18,7 +19,9 @@ buildscript {
|
|||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
|
sourceSets {
|
||||||
|
main.java.srcDirs = ['src/main/java']
|
||||||
|
}
|
||||||
|
|
||||||
if(hasProperty('target') && target == 'android') {
|
if(hasProperty('target') && target == 'android') {
|
||||||
|
|
||||||
|
@ -114,8 +114,7 @@
|
|||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<sources>
|
<sources>
|
||||||
<source>
|
<source>src/main/java</source>
|
||||||
src/main/java</source>
|
|
||||||
</sources>
|
</sources>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
@ -127,8 +126,7 @@
|
|||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<sources>
|
<sources>
|
||||||
<source>
|
<source>src/test/java</source>
|
||||||
src/test/java</source>
|
|
||||||
</sources>
|
</sources>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user