Skip to content

Commit cdffe27

Browse files
inidonawing328
authored andcommitted
[codegen][java]Issue 8055: create javadoc and source jar from gradle build (#8056)
* Update build.gradle.mustache creating javadoc and source jar fieles * Update build.gradle.mustache * Update build.gradle.mustache
1 parent f6fca76 commit cdffe27

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

modules/swagger-codegen/src/main/resources/Java/build.gradle.mustache

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ repositories {
1818
jcenter()
1919
}
2020

21-
2221
if(hasProperty('target') && target == 'android') {
2322
2423
apply plugin: 'com.android.library'
@@ -103,6 +102,21 @@ if(hasProperty('target') && target == 'android') {
103102
main = System.getProperty('mainClass')
104103
classpath = sourceSets.main.runtimeClasspath
105104
}
105+
106+
task sourcesJar(type: Jar, dependsOn: classes) {
107+
classifier = 'sources'
108+
from sourceSets.main.allSource
109+
}
110+
111+
task javadocJar(type: Jar, dependsOn: javadoc) {
112+
classifier = 'javadoc'
113+
from javadoc.destinationDir
114+
}
115+
116+
artifacts {
117+
archives sourcesJar
118+
archives javadocJar
119+
}
106120
}
107121

108122
ext {
@@ -135,3 +149,4 @@ dependencies {
135149
{{/java8}}
136150
testCompile "junit:junit:$junit_version"
137151
}
152+

0 commit comments

Comments
 (0)