Skip to content

Commit 3add1c9

Browse files
authored
fix(descriptions-javadoc): put descriptions in META-INF folder (via #971)
1 parent 2c3ed8b commit 3add1c9

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

allure-descriptions-javadoc/src/main/java/io/qameta/allure/description/JavaDocDescriptionsProcessor.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
@SupportedAnnotationTypes("io.qameta.allure.Description")
4747
public class JavaDocDescriptionsProcessor extends AbstractProcessor {
4848

49+
private static final String ALLURE_DESCRIPTIONS_FOLDER = "META-INF/allureDescriptions/";
50+
4951
private Filer filer;
5052
private Elements elementUtils;
5153
private Messager messager;
@@ -85,8 +87,8 @@ public boolean process(final Set<? extends TypeElement> annotations, final Round
8587

8688
final String hash = generateMethodSignatureHash(el.getEnclosingElement().toString(), name, typeParams);
8789
try {
88-
final FileObject file = filer.createResource(StandardLocation.CLASS_OUTPUT,
89-
"allureDescriptions", hash);
90+
final FileObject file = filer.createResource(StandardLocation.CLASS_OUTPUT, "",
91+
ALLURE_DESCRIPTIONS_FOLDER + hash);
9092
try (Writer writer = file.openWriter()) {
9193
writer.write(docs);
9294
}

allure-descriptions-javadoc/src/test/java/io/qameta/allure/description/ProcessDescriptionsTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*/
3232
class ProcessDescriptionsTest {
3333

34-
private static final String ALLURE_PACKAGE_NAME = "allureDescriptions";
34+
private static final String ALLURE_DESCRIPTIONS_FOLDER = "META-INF/allureDescriptions/";
3535

3636
@Test
3737
void captureDescriptionTest() {
@@ -58,8 +58,8 @@ void captureDescriptionTest() {
5858
Compilation compilation = compiler.compile(source);
5959
assertThat(compilation).generatedFile(
6060
StandardLocation.CLASS_OUTPUT,
61-
ALLURE_PACKAGE_NAME,
62-
expectedMethodSignatureHash
61+
"",
62+
ALLURE_DESCRIPTIONS_FOLDER + expectedMethodSignatureHash
6363
);
6464
}
6565

@@ -121,8 +121,8 @@ void captureDescriptionParametrizedTestWithGenericParameterTest() {
121121
Compilation compilation = compiler.compile(source);
122122
assertThat(compilation).generatedFile(
123123
StandardLocation.CLASS_OUTPUT,
124-
ALLURE_PACKAGE_NAME,
125-
expectedMethodSignatureHash
124+
"",
125+
ALLURE_DESCRIPTIONS_FOLDER + expectedMethodSignatureHash
126126
);
127127
}
128128

@@ -154,8 +154,8 @@ void captureDescriptionParametrizedTestWithPrimitivesParameterTest() {
154154
Compilation compilation = compiler.compile(source);
155155
assertThat(compilation).generatedFile(
156156
StandardLocation.CLASS_OUTPUT,
157-
ALLURE_PACKAGE_NAME,
158-
expectedMethodSignatureHash
157+
"",
158+
ALLURE_DESCRIPTIONS_FOLDER + expectedMethodSignatureHash
159159
);
160160
}
161161
}

allure-java-commons/src/main/java/io/qameta/allure/util/ResultsUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public final class ResultsUtils {
9797
public static final String LANGUAGE_LABEL_NAME = "language";
9898

9999
private static final Logger LOGGER = LoggerFactory.getLogger(ResultsUtils.class);
100-
private static final String ALLURE_DESCRIPTIONS_PACKAGE = "allureDescriptions/";
100+
private static final String ALLURE_DESCRIPTIONS_FOLDER = "META-INF/allureDescriptions/";
101101
private static final String MD_5 = "MD5";
102102

103103
private static String cachedHost;
@@ -305,7 +305,7 @@ public static Optional<String> getJavadocDescription(final ClassLoader classLoad
305305
name,
306306
parameterTypes);
307307

308-
return readResource(classLoader, ALLURE_DESCRIPTIONS_PACKAGE + signatureHash)
308+
return readResource(classLoader, ALLURE_DESCRIPTIONS_FOLDER + signatureHash)
309309
.map(desc -> separateLines() ? desc.replace("\n", "<br />") : desc);
310310
}
311311

0 commit comments

Comments
 (0)