Committed by
Gerrit Code Review
Enhancing OnosJar to build OSGi jars and wars if required.
Also, simplifying onos.bucklet by using the rule Change-Id: If89633db2d83cbfc56a8e70d2bea665ffaf186ff
Showing
7 changed files
with
140 additions
and
70 deletions
... | @@ -114,6 +114,7 @@ def osgi_jar( | ... | @@ -114,6 +114,7 @@ def osgi_jar( |
114 | api_description = NONE, | 114 | api_description = NONE, |
115 | resources = NONE, | 115 | resources = NONE, |
116 | resources_root = None, | 116 | resources_root = None, |
117 | + tests = None, | ||
117 | **kwargs | 118 | **kwargs |
118 | ): | 119 | ): |
119 | 120 | ||
... | @@ -134,76 +135,42 @@ def osgi_jar( | ... | @@ -134,76 +135,42 @@ def osgi_jar( |
134 | resources_root = RESOURCES_ROOT | 135 | resources_root = RESOURCES_ROOT |
135 | 136 | ||
136 | if api_title != NONE: | 137 | if api_title != NONE: |
137 | - r = 'WEB-INF/classes/apidoc/swagger.json=bin/swagger.json' | 138 | + r = 'WEB-INF/classes/apidoc/swagger.json=swagger.json' |
138 | include_resources = include_resources + ',' + r if include_resources != NONE else r | 139 | include_resources = include_resources + ',' + r if include_resources != NONE else r |
139 | 140 | ||
140 | - bare_jar_name = name + '-jar' | ||
141 | - osgi_jar_name = name + '-osgi' | ||
142 | mvn_coords = group_id + ':' + name + ':' + version | 141 | mvn_coords = group_id + ':' + name + ':' + version |
143 | 142 | ||
144 | - | ||
145 | onos_jar( | 143 | onos_jar( |
146 | - name = bare_jar_name, | 144 | + name = name, |
147 | - srcs = srcs, | 145 | + srcs = srcs + glob(['src/main/webapp/**']), |
148 | deps = deps, | 146 | deps = deps, |
149 | - visibility = [], #intentially, not visible | 147 | + visibility = visibility, |
150 | resources = resources, | 148 | resources = resources, |
151 | resources_root = resources_root, | 149 | resources_root = resources_root, |
150 | + bundle_name = name, | ||
151 | + group_id = group_id, | ||
152 | + bundle_version = version, | ||
153 | + bundle_license = license, | ||
154 | + bundle_description = description, | ||
155 | + import_packages = import_packages, | ||
156 | + export_packages = export_packages, | ||
157 | + include_resources = include_resources, | ||
158 | + dynamicimport_packages = dynamicimport_packages, | ||
152 | web_context = web_context, | 159 | web_context = web_context, |
153 | api_title = api_title, | 160 | api_title = api_title, |
154 | api_version = api_version, | 161 | api_version = api_version, |
155 | api_package = api_package, | 162 | api_package = api_package, |
156 | api_description = api_description, | 163 | api_description = api_description, |
164 | + tests = tests, | ||
165 | + maven_coords = mvn_coords, | ||
157 | **kwargs | 166 | **kwargs |
158 | ) | 167 | ) |
159 | 168 | ||
160 | - cp = ':'.join(['$(classpath %s)' % c for c in deps]) if deps else '""' | ||
161 | - | ||
162 | - args = ( '$(location :%s)' % bare_jar_name, #input jar | ||
163 | - '$OUT', #output jar | ||
164 | - cp, #classpath | ||
165 | - name, #bundle name | ||
166 | - group_id, #group id | ||
167 | - version, #version | ||
168 | - license, #license url | ||
169 | - "'%s'" % import_packages, #packages to import | ||
170 | - "'%s'" % export_packages, #packages to export | ||
171 | - include_resources, #custom includes to classpath | ||
172 | - web_context, #web context (REST API only) | ||
173 | - "'%s'" % dynamicimport_packages, #DynamicImport-Package | ||
174 | - description, #description | ||
175 | - ) | ||
176 | - | ||
177 | - #TODO stage_jar is a horrendous hack | ||
178 | - stage_jar = 'pushd $SRCDIR; mkdir bin; cd bin; jar xf $(location :%s); ls; popd; ' % bare_jar_name | ||
179 | - wrap_jar = '$(exe //utils/osgiwrap:osgi-jar) ' + ' '.join(args) | ||
180 | - bash = stage_jar + wrap_jar | ||
181 | - if debug: | ||
182 | - bash = stage_jar + DEBUG_ARG + ' ' + wrap_jar | ||
183 | - print bash | ||
184 | - | ||
185 | - # FIXME: make sure that /swagger.json gets filtered | ||
186 | - genrule( | ||
187 | - name = osgi_jar_name, | ||
188 | - bash = bash, | ||
189 | - out = '%s-%s.jar' % (name, version), #FIXME add version to jar file | ||
190 | - srcs = glob(['src/main/webapp/**']), | ||
191 | - visibility = [], #intentially, not visible | ||
192 | - ) | ||
193 | - | ||
194 | - # TODO we really should shade the jar with maven flavor | ||
195 | - prebuilt_jar( | ||
196 | - name = name, | ||
197 | - maven_coords = mvn_coords, | ||
198 | - binary_jar = ':' + osgi_jar_name, | ||
199 | - visibility = visibility, | ||
200 | - ) | ||
201 | - | ||
202 | ### Checkstyle | 169 | ### Checkstyle |
203 | checkstyle( | 170 | checkstyle( |
204 | name = name + '-checkstyle-files', | 171 | name = name + '-checkstyle-files', |
205 | srcs = srcs, | 172 | srcs = srcs, |
206 | - jar_target = ':'+ bare_jar_name, | 173 | + jar_target = ':'+ name, |
207 | ) | 174 | ) |
208 | 175 | ||
209 | java_doc( | 176 | java_doc( |
... | @@ -219,7 +186,7 @@ def osgi_jar( | ... | @@ -219,7 +186,7 @@ def osgi_jar( |
219 | 186 | ||
220 | # TODO add project config for intellij | 187 | # TODO add project config for intellij |
221 | # project_config( | 188 | # project_config( |
222 | - # src_target = ':' + bare_jar_name, | 189 | + # src_target = ':' + name, |
223 | # src_roots = [ 'src/main/java' ], | 190 | # src_roots = [ 'src/main/java' ], |
224 | # test_target = ':' + name + '-tests', | 191 | # test_target = ':' + name + '-tests', |
225 | # test_roots = [ 'src/test/java' ], | 192 | # test_roots = [ 'src/test/java' ], |
... | @@ -247,6 +214,8 @@ def osgi_jar( | ... | @@ -247,6 +214,8 @@ def osgi_jar( |
247 | def osgi_jar_with_tests( | 214 | def osgi_jar_with_tests( |
248 | name = None, | 215 | name = None, |
249 | deps = [], | 216 | deps = [], |
217 | + group_id = ONOS_GROUP_ID, | ||
218 | + version = ONOS_VERSION, | ||
250 | test_srcs = None, | 219 | test_srcs = None, |
251 | test_deps = [ '//lib:TEST' ], | 220 | test_deps = [ '//lib:TEST' ], |
252 | test_resources = None, | 221 | test_resources = None, |
... | @@ -260,7 +229,10 @@ def osgi_jar_with_tests( | ... | @@ -260,7 +229,10 @@ def osgi_jar_with_tests( |
260 | 229 | ||
261 | osgi_jar(name = name, | 230 | osgi_jar(name = name, |
262 | deps = deps, | 231 | deps = deps, |
232 | + group_id = group_id, | ||
233 | + version = version, | ||
263 | visibility = visibility, | 234 | visibility = visibility, |
235 | + tests = [':' + name + '-tests'], | ||
264 | **kwargs) | 236 | **kwargs) |
265 | 237 | ||
266 | if test_resources and not test_resources_root: | 238 | if test_resources and not test_resources_root: |
... | @@ -275,16 +247,18 @@ def osgi_jar_with_tests( | ... | @@ -275,16 +247,18 @@ def osgi_jar_with_tests( |
275 | if test_srcs is None: | 247 | if test_srcs is None: |
276 | test_srcs = glob([TEST + '/*.java']) | 248 | test_srcs = glob([TEST + '/*.java']) |
277 | 249 | ||
250 | + mvn_coords = group_id + ':' + name + ':jar:tests:' + version | ||
251 | + | ||
278 | java_test( | 252 | java_test( |
279 | name = name + '-tests', | 253 | name = name + '-tests', |
280 | srcs = test_srcs, | 254 | srcs = test_srcs, |
281 | deps = deps + | 255 | deps = deps + |
282 | test_deps + | 256 | test_deps + |
283 | - [':' + name + '-jar'], | 257 | + [':' + name + '#non-osgi'], |
284 | - source_under_test = [':' + name + '-jar'], | ||
285 | resources = test_resources, | 258 | resources = test_resources, |
286 | resources_root = test_resources_root, | 259 | resources_root = test_resources_root, |
287 | - visibility = visibility | 260 | + maven_coords = mvn_coords, |
261 | + visibility = visibility, | ||
288 | ) | 262 | ) |
289 | 263 | ||
290 | checkstyle( | 264 | checkstyle( |
... | @@ -292,5 +266,3 @@ def osgi_jar_with_tests( | ... | @@ -292,5 +266,3 @@ def osgi_jar_with_tests( |
292 | srcs = test_srcs, | 266 | srcs = test_srcs, |
293 | jar_target = ':' + name + '-tests', | 267 | jar_target = ':' + name + '-tests', |
294 | ) | 268 | ) |
295 | - | ||
296 | - #FIXME need to run checkstyle on test sources | ... | ... |
1 | +# Comment the remote_jar out for local buck development | ||
1 | remote_jar ( | 2 | remote_jar ( |
2 | name = 'buck-api', | 3 | name = 'buck-api', |
3 | out = 'buck.jar', | 4 | out = 'buck.jar', |
4 | - url = 'https://github.com/bocon13/buck/releases/download/v2016.07.29.01-wip/buck.jar', | 5 | + url = 'https://github.com/bocon13/buck/releases/download/v2016.09.13.01/buck.jar', |
5 | - sha1 = 'f89324cb869b74fdcd4db9972233065a93d890a2', | 6 | + sha1 = 'd5415b4326e5316675532a8cd48001a8456e8c9e', |
6 | visibility = [], | 7 | visibility = [], |
7 | ) | 8 | ) |
8 | 9 | ||
10 | +# Uncomment the prebuilt_jar and copy buck-api to lib/buck.jar for local buck development | ||
11 | +# prebuilt_jar ( | ||
12 | +# name = 'buck-api', | ||
13 | +# binary_jar = 'lib/buck.jar' | ||
14 | +# ) | ||
15 | + | ||
9 | COMPILE = [ | 16 | COMPILE = [ |
10 | '//lib:qdox', | 17 | '//lib:qdox', |
11 | - #'//lib:jackson-core', | 18 | + '//lib:guava', |
12 | - #'//lib:jackson-databind', | 19 | + '//lib:bndlib', |
13 | - #'//lib:jackson-annotations', | 20 | + '//lib:org.apache.felix.scr.bnd' |
14 | -] | ||
15 | - | ||
16 | -RUNTIME = [ | ||
17 | ] | 21 | ] |
18 | 22 | ||
19 | java_library( | 23 | java_library( | ... | ... |
This diff is collapsed. Click to expand it.
... | @@ -17,6 +17,10 @@ package org.onosproject.onosjar; | ... | @@ -17,6 +17,10 @@ package org.onosproject.onosjar; |
17 | 17 | ||
18 | import com.facebook.buck.jvm.java.CompileToJarStepFactory; | 18 | import com.facebook.buck.jvm.java.CompileToJarStepFactory; |
19 | import com.facebook.buck.jvm.java.DefaultJavaLibrary; | 19 | import com.facebook.buck.jvm.java.DefaultJavaLibrary; |
20 | +import com.facebook.buck.jvm.java.HasClasspathEntries; | ||
21 | +import com.facebook.buck.jvm.java.HasMavenCoordinates; | ||
22 | +import com.facebook.buck.jvm.java.JavaLibrary; | ||
23 | +import com.facebook.buck.jvm.java.MavenPublishable; | ||
20 | import com.facebook.buck.model.BuildTarget; | 24 | import com.facebook.buck.model.BuildTarget; |
21 | import com.facebook.buck.rules.AddToRuleKey; | 25 | import com.facebook.buck.rules.AddToRuleKey; |
22 | import com.facebook.buck.rules.BuildRule; | 26 | import com.facebook.buck.rules.BuildRule; |
... | @@ -24,6 +28,7 @@ import com.facebook.buck.rules.BuildRuleParams; | ... | @@ -24,6 +28,7 @@ import com.facebook.buck.rules.BuildRuleParams; |
24 | import com.facebook.buck.rules.SourcePath; | 28 | import com.facebook.buck.rules.SourcePath; |
25 | import com.facebook.buck.rules.SourcePathResolver; | 29 | import com.facebook.buck.rules.SourcePathResolver; |
26 | import com.google.common.base.Optional; | 30 | import com.google.common.base.Optional; |
31 | +import com.google.common.base.Preconditions; | ||
27 | import com.google.common.collect.ImmutableList; | 32 | import com.google.common.collect.ImmutableList; |
28 | import com.google.common.collect.ImmutableSet; | 33 | import com.google.common.collect.ImmutableSet; |
29 | import com.google.common.collect.ImmutableSortedSet; | 34 | import com.google.common.collect.ImmutableSortedSet; |
... | @@ -36,7 +41,8 @@ import java.util.regex.Pattern; | ... | @@ -36,7 +41,8 @@ import java.util.regex.Pattern; |
36 | * Implementation of a build rule that generates a onosjar.json file for a set | 41 | * Implementation of a build rule that generates a onosjar.json file for a set |
37 | * of Java sources. | 42 | * of Java sources. |
38 | */ | 43 | */ |
39 | -public class OnosJar extends DefaultJavaLibrary { | 44 | +public class OnosJar extends DefaultJavaLibrary |
45 | + implements MavenPublishable{ | ||
40 | 46 | ||
41 | @AddToRuleKey | 47 | @AddToRuleKey |
42 | final Optional<String> webContext; | 48 | final Optional<String> webContext; |
... | @@ -53,6 +59,8 @@ public class OnosJar extends DefaultJavaLibrary { | ... | @@ -53,6 +59,8 @@ public class OnosJar extends DefaultJavaLibrary { |
53 | @AddToRuleKey | 59 | @AddToRuleKey |
54 | final Optional<String> apiDescription; | 60 | final Optional<String> apiDescription; |
55 | 61 | ||
62 | + private final ImmutableSortedSet<HasMavenCoordinates> mavenDeps; | ||
63 | + | ||
56 | public OnosJar(BuildRuleParams params, | 64 | public OnosJar(BuildRuleParams params, |
57 | SourcePathResolver resolver, | 65 | SourcePathResolver resolver, |
58 | Set<? extends SourcePath> srcs, | 66 | Set<? extends SourcePath> srcs, |
... | @@ -84,5 +92,32 @@ public class OnosJar extends DefaultJavaLibrary { | ... | @@ -84,5 +92,32 @@ public class OnosJar extends DefaultJavaLibrary { |
84 | this.apiVersion = apiVersion; | 92 | this.apiVersion = apiVersion; |
85 | this.apiPackage = apiPackage; | 93 | this.apiPackage = apiPackage; |
86 | this.apiDescription = apiDescription; | 94 | this.apiDescription = apiDescription; |
95 | + this.mavenDeps = computeMavenDeps(); | ||
96 | + } | ||
97 | + | ||
98 | + private ImmutableSortedSet<HasMavenCoordinates> computeMavenDeps() { | ||
99 | + ImmutableSortedSet.Builder<HasMavenCoordinates> mavenDeps = ImmutableSortedSet.naturalOrder(); | ||
100 | + for (JavaLibrary javaLibrary : getTransitiveClasspathDeps()) { | ||
101 | + if (this.equals(javaLibrary)) { | ||
102 | + // no need to include ourself | ||
103 | + continue; | ||
104 | + } else if (HasMavenCoordinates.MAVEN_COORDS_PRESENT_PREDICATE.apply(javaLibrary)) { | ||
105 | + mavenDeps.add(javaLibrary); | ||
106 | + //FIXME BOC do we always want to exclude all of a maven jar's dependencies? probably. | ||
107 | + mavenDeps.addAll(javaLibrary.getTransitiveClasspathDeps()); | ||
108 | + } | ||
109 | + } | ||
110 | + return mavenDeps.build(); | ||
111 | + } | ||
112 | + | ||
113 | + @Override | ||
114 | + public Iterable<HasMavenCoordinates> getMavenDeps() { | ||
115 | + return mavenDeps; | ||
116 | + } | ||
117 | + | ||
118 | + @Override | ||
119 | + public Iterable<BuildRule> getPackagedDependencies() { | ||
120 | + //FIXME this is not supported at the moment | ||
121 | + return ImmutableList.of(); | ||
87 | } | 122 | } |
88 | } | 123 | } | ... | ... |
This diff is collapsed. Click to expand it.
... | @@ -28,12 +28,14 @@ import com.facebook.buck.rules.BuildableContext; | ... | @@ -28,12 +28,14 @@ import com.facebook.buck.rules.BuildableContext; |
28 | import com.facebook.buck.rules.SourcePath; | 28 | import com.facebook.buck.rules.SourcePath; |
29 | import com.facebook.buck.rules.SourcePathResolver; | 29 | import com.facebook.buck.rules.SourcePathResolver; |
30 | import com.facebook.buck.step.Step; | 30 | import com.facebook.buck.step.Step; |
31 | +import com.facebook.buck.step.fs.CopyStep; | ||
31 | import com.google.common.base.Optional; | 32 | import com.google.common.base.Optional; |
32 | import com.google.common.collect.ImmutableList; | 33 | import com.google.common.collect.ImmutableList; |
33 | import com.google.common.collect.ImmutableSet; | 34 | import com.google.common.collect.ImmutableSet; |
34 | import com.google.common.collect.ImmutableSortedSet; | 35 | import com.google.common.collect.ImmutableSortedSet; |
35 | 36 | ||
36 | import java.nio.file.Path; | 37 | import java.nio.file.Path; |
38 | +import java.nio.file.Paths; | ||
37 | import java.util.regex.Pattern; | 39 | import java.util.regex.Pattern; |
38 | import java.util.stream.Collectors; | 40 | import java.util.stream.Collectors; |
39 | 41 | ||
... | @@ -49,6 +51,15 @@ public class OnosJarStepFactory extends JavacToJarStepFactory { | ... | @@ -49,6 +51,15 @@ public class OnosJarStepFactory extends JavacToJarStepFactory { |
49 | private final String apiPackage; | 51 | private final String apiPackage; |
50 | private final String apiDescription; | 52 | private final String apiDescription; |
51 | private final Optional<ImmutableSortedSet<SourcePath>> resources; | 53 | private final Optional<ImmutableSortedSet<SourcePath>> resources; |
54 | + private final String groupId; | ||
55 | + private final String bundleName; | ||
56 | + private final String bundleVersion; | ||
57 | + private final String bundleLicense; | ||
58 | + private final String bundleDescription; | ||
59 | + private final String importPackages; | ||
60 | + private final String exportPackages; | ||
61 | + private final String includeResources; | ||
62 | + private final String dynamicimportPackages; | ||
52 | 63 | ||
53 | public OnosJarStepFactory(JavacOptions javacOptions, | 64 | public OnosJarStepFactory(JavacOptions javacOptions, |
54 | JavacOptionsAmender amender, | 65 | JavacOptionsAmender amender, |
... | @@ -57,8 +68,26 @@ public class OnosJarStepFactory extends JavacToJarStepFactory { | ... | @@ -57,8 +68,26 @@ public class OnosJarStepFactory extends JavacToJarStepFactory { |
57 | Optional<String> apiVersion, | 68 | Optional<String> apiVersion, |
58 | Optional<String> apiPackage, | 69 | Optional<String> apiPackage, |
59 | Optional<String> apiDescription, | 70 | Optional<String> apiDescription, |
60 | - Optional<ImmutableSortedSet<SourcePath>> resources) { | 71 | + Optional<ImmutableSortedSet<SourcePath>> resources, |
72 | + Optional<String> groupId, | ||
73 | + Optional<String> bundleName, | ||
74 | + Optional<String> bundleVersion, | ||
75 | + Optional<String> bundleLicense, | ||
76 | + Optional<String> bundleDescription, | ||
77 | + Optional<String> importPackages, | ||
78 | + Optional<String> exportPackages, | ||
79 | + Optional<String> includeResources, | ||
80 | + Optional<String> dynamicimportPackages) { | ||
61 | super(javacOptions, amender); | 81 | super(javacOptions, amender); |
82 | + this.bundleDescription = processParameter(bundleDescription); | ||
83 | + this.importPackages = processParameter(importPackages); | ||
84 | + this.exportPackages = processParameter(exportPackages); | ||
85 | + this.includeResources = processParameter(includeResources); | ||
86 | + this.dynamicimportPackages = processParameter(dynamicimportPackages); | ||
87 | + this.groupId = processParameter(groupId); | ||
88 | + this.bundleName = processParameter(bundleName); | ||
89 | + this.bundleVersion = processParameter(bundleVersion); | ||
90 | + this.bundleLicense = processParameter(bundleLicense); | ||
62 | this.webContext = processParameter(webContext); | 91 | this.webContext = processParameter(webContext); |
63 | this.apiTitle = processParameter(apiTitle); | 92 | this.apiTitle = processParameter(apiTitle); |
64 | this.apiVersion = processParameter(apiVersion); | 93 | this.apiVersion = processParameter(apiVersion); |
... | @@ -114,6 +143,11 @@ public class OnosJarStepFactory extends JavacToJarStepFactory { | ... | @@ -114,6 +143,11 @@ public class OnosJarStepFactory extends JavacToJarStepFactory { |
114 | apiPackage, apiDescription); | 143 | apiPackage, apiDescription); |
115 | sourceFilePathBuilder.add(swaggerStep.apiRegistratorPath()); | 144 | sourceFilePathBuilder.add(swaggerStep.apiRegistratorPath()); |
116 | steps.add(swaggerStep); | 145 | steps.add(swaggerStep); |
146 | + | ||
147 | +// steps.addAll(sourceFilePaths.stream() | ||
148 | +// .filter(sp -> sp.startsWith("src/main/webapp/")) | ||
149 | +// .map(sp -> CopyStep.forFile(filesystem, sp, outputDirectory)) | ||
150 | +// .iterator()); | ||
117 | } | 151 | } |
118 | 152 | ||
119 | createCompileStep(context, | 153 | createCompileStep(context, |
... | @@ -132,6 +166,7 @@ public class OnosJarStepFactory extends JavacToJarStepFactory { | ... | @@ -132,6 +166,7 @@ public class OnosJarStepFactory extends JavacToJarStepFactory { |
132 | 166 | ||
133 | // post compilation steps | 167 | // post compilation steps |
134 | 168 | ||
169 | + | ||
135 | // FIXME BOC: add mechanism to inject new Steps | 170 | // FIXME BOC: add mechanism to inject new Steps |
136 | //context.additionalStepFactory(JavaStep.class); | 171 | //context.additionalStepFactory(JavaStep.class); |
137 | 172 | ||
... | @@ -143,6 +178,28 @@ public class OnosJarStepFactory extends JavacToJarStepFactory { | ... | @@ -143,6 +178,28 @@ public class OnosJarStepFactory extends JavacToJarStepFactory { |
143 | manifestFile.orNull(), | 178 | manifestFile.orNull(), |
144 | true, | 179 | true, |
145 | blacklistBuilder.build())); | 180 | blacklistBuilder.build())); |
181 | + | ||
182 | + OSGiWrapper osgiStep = new OSGiWrapper( | ||
183 | + outputJar, //input jar | ||
184 | + outputJar, //Paths.get(outputJar.toString() + ".jar"), //output jar | ||
185 | + invokingRule.getBasePath(), // sources dir | ||
186 | + outputDirectory, // classes dir | ||
187 | + declaredClasspathEntries, // classpath | ||
188 | + bundleName, // bundle name | ||
189 | + groupId, // groupId | ||
190 | + bundleVersion, // bundle version | ||
191 | + bundleLicense, // bundle license | ||
192 | + importPackages, // import packages | ||
193 | + exportPackages, // export packages | ||
194 | + includeResources, // include resources | ||
195 | + webContext, // web context | ||
196 | + dynamicimportPackages, // dynamic import packages | ||
197 | + bundleDescription // bundle description | ||
198 | + ); | ||
199 | + steps.add(osgiStep); | ||
200 | + | ||
201 | + //steps.add(CopyStep.forFile(filesystem, Paths.get(outputJar.toString() + ".jar"), outputJar)); | ||
202 | + | ||
146 | } | 203 | } |
147 | 204 | ||
148 | private ImmutableSortedSet<Path> findSwaggerModelDefs(SourcePathResolver resolver, | 205 | private ImmutableSortedSet<Path> findSwaggerModelDefs(SourcePathResolver resolver, | ... | ... |
... | @@ -102,10 +102,12 @@ public class SwaggerGenerator { | ... | @@ -102,10 +102,12 @@ public class SwaggerGenerator { |
102 | } | 102 | } |
103 | if (srcs != null) { | 103 | if (srcs != null) { |
104 | srcs.forEach(src -> { | 104 | srcs.forEach(src -> { |
105 | - try { | 105 | + if (src.toString().endsWith(".java")) { |
106 | - builder.addSource(src); | 106 | + try { |
107 | - } catch (IOException e) { | 107 | + builder.addSource(src); |
108 | - throw new RuntimeException(e); | 108 | + } catch (IOException e) { |
109 | + throw new RuntimeException(e); | ||
110 | + } | ||
109 | } | 111 | } |
110 | }); | 112 | }); |
111 | } | 113 | } | ... | ... |
-
Please register or login to post a comment