|
5 | 5 | import javax.annotation.processing.RoundEnvironment;
|
6 | 6 | import javax.lang.model.element.Element;
|
7 | 7 | import javax.lang.model.element.TypeElement;
|
8 |
| -import javax.tools.FileObject; |
9 |
| -import java.io.IOException; |
10 |
| -import java.io.Writer; |
11 | 8 | import java.util.HashMap;
|
12 | 9 | import java.util.List;
|
13 | 10 | import java.util.Map;
|
@@ -50,39 +47,6 @@ void write(boolean processingOver) {
|
50 | 47 | for (Data value : scopeAnnotations.values()) {
|
51 | 48 | value.write(processingOver);
|
52 | 49 | }
|
53 |
| - if (processingOver) { |
54 |
| - writeModuleCustomServicesFile(); |
55 |
| - } |
56 |
| - } |
57 |
| - |
58 |
| - private void writeModuleCustomServicesFile() { |
59 |
| - if (scopeAnnotations.isEmpty()) { |
60 |
| - return; |
61 |
| - } |
62 |
| - try { |
63 |
| - FileObject jfo = context.createMetaInfModuleCustom(); |
64 |
| - if (jfo != null) { |
65 |
| - Writer writer = jfo.openWriter(); |
66 |
| - for (Data value : scopeAnnotations.values()) { |
67 |
| - final String moduleFullName = value.moduleFullName(); |
68 |
| - if (moduleFullName == null) { |
69 |
| - // an empty module, custom scope with no beans |
70 |
| - final TypeElement typeElement = value.annotationType(); |
71 |
| - if (typeElement != null) { |
72 |
| - context.logWarn("Empty module for "+typeElement); |
73 |
| - } |
74 |
| - } else { |
75 |
| - writer.write(moduleFullName); |
76 |
| - writer.write("\n"); |
77 |
| - } |
78 |
| - } |
79 |
| - writer.close(); |
80 |
| - } |
81 |
| - |
82 |
| - } catch (IOException e) { |
83 |
| - e.printStackTrace(); |
84 |
| - context.logError("Failed to write services file " + e.getMessage()); |
85 |
| - } |
86 | 50 | }
|
87 | 51 |
|
88 | 52 | void readModules(List<String> customScopeModules) {
|
@@ -125,13 +89,5 @@ static class Data {
|
125 | 89 | void write(boolean processingOver) {
|
126 | 90 | scopeInfo.write(processingOver);
|
127 | 91 | }
|
128 |
| - |
129 |
| - String moduleFullName() { |
130 |
| - return scopeInfo.moduleFullName(); |
131 |
| - } |
132 |
| - |
133 |
| - TypeElement annotationType() { |
134 |
| - return scopeInfo.annotationType(); |
135 |
| - } |
136 | 92 | }
|
137 | 93 | }
|
0 commit comments