-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experiment with generating config files for the IDEs
- Loading branch information
Showing
14 changed files
with
204 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...va/io/quarkus/annotation/processor/documentation/config/ide/IdeConfigJavadocElements.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.quarkus.annotation.processor.documentation.config.ide; | ||
|
||
import java.util.List; | ||
|
||
import io.quarkus.annotation.processor.documentation.config.model.JavadocElements; | ||
|
||
public record IdeConfigJavadocElements(IdeExtension extension, List<IdeConfigJavadocElement> elements) { | ||
|
||
public record IdeConfigJavadocElement(String key, String description, String since) { | ||
} | ||
|
||
public static IdeConfigJavadocElements of(JavadocElements javadocElements) { | ||
return new IdeConfigJavadocElements(IdeExtension.of(javadocElements.extension()), | ||
javadocElements.elements().entrySet().stream() | ||
.map(e -> new IdeConfigJavadocElement(e.getKey(), e.getValue().description(), e.getValue().since())) | ||
.toList()); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...rc/main/java/io/quarkus/annotation/processor/documentation/config/ide/IdeConfigModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package io.quarkus.annotation.processor.documentation.config.ide; | ||
|
||
import java.util.List; | ||
|
||
import io.quarkus.annotation.processor.documentation.config.model.ConfigProperty; | ||
import io.quarkus.annotation.processor.documentation.config.model.Extension; | ||
|
||
public record IdeConfigModel(IdeExtension extension, List<IdeConfigProperty> properties) { | ||
|
||
public static IdeConfigModel of(Extension extension, List<ConfigProperty> properties) { | ||
return new IdeConfigModel(IdeExtension.of(extension), | ||
properties.stream().map(p -> IdeConfigProperty.of(p)).toList()); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...rc/main/java/io/quarkus/annotation/processor/documentation/config/ide/IdeConfigPhase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package io.quarkus.annotation.processor.documentation.config.ide; | ||
|
||
import io.quarkus.annotation.processor.documentation.config.model.ConfigPhase; | ||
|
||
public enum IdeConfigPhase { | ||
|
||
RUN_TIME, | ||
BUILD_TIME, | ||
BUILD_AND_RUN_TIME_FIXED; | ||
|
||
public static IdeConfigPhase of(ConfigPhase phase) { | ||
switch (phase) { | ||
case BUILD_AND_RUN_TIME_FIXED: | ||
return IdeConfigPhase.BUILD_AND_RUN_TIME_FIXED; | ||
case BUILD_TIME: | ||
return IdeConfigPhase.BUILD_TIME; | ||
case RUN_TIME: | ||
return IdeConfigPhase.RUN_TIME; | ||
default: | ||
throw new IllegalStateException("Phase " + phase + " not supported in " + IdeConfigPhase.class.getSimpleName()); | ||
} | ||
} | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
...main/java/io/quarkus/annotation/processor/documentation/config/ide/IdeConfigProperty.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package io.quarkus.annotation.processor.documentation.config.ide; | ||
|
||
import java.util.List; | ||
|
||
import io.quarkus.annotation.processor.documentation.config.model.ConfigProperty; | ||
|
||
public record IdeConfigProperty( | ||
IdeConfigPhase phase, | ||
String path, | ||
List<String> additionalPaths, | ||
String environmentVariable, | ||
String sourceClass, | ||
String sourceName, | ||
String type, | ||
String typeDescription, | ||
String javadocLink, | ||
String defaultValue, | ||
boolean optional, | ||
boolean isEnum, | ||
IdeEnumAcceptedValues enumAcceptedValues, | ||
boolean deprecated) { | ||
|
||
public static IdeConfigProperty of(ConfigProperty configProperty) { | ||
return new IdeConfigProperty(IdeConfigPhase.of(configProperty.getPhase()), | ||
configProperty.getPath(), | ||
configProperty.getAdditionalPaths(), | ||
configProperty.getEnvironmentVariable(), | ||
configProperty.getSourceClass(), | ||
configProperty.getSourceName(), | ||
configProperty.getType(), | ||
configProperty.getTypeDescription(), | ||
configProperty.getJavadocSiteLink(), | ||
configProperty.getDefaultValue(), | ||
configProperty.isOptional(), | ||
configProperty.isEnum(), | ||
IdeEnumAcceptedValues.of(configProperty.getEnumAcceptedValues()), | ||
configProperty.isDeprecated()); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
.../java/io/quarkus/annotation/processor/documentation/config/ide/IdeEnumAcceptedValues.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package io.quarkus.annotation.processor.documentation.config.ide; | ||
|
||
import java.util.Map; | ||
import java.util.Map.Entry; | ||
import java.util.stream.Collectors; | ||
|
||
import io.quarkus.annotation.processor.documentation.config.model.EnumAcceptedValues; | ||
import io.quarkus.annotation.processor.documentation.config.model.EnumAcceptedValues.EnumAcceptedValue; | ||
|
||
public record IdeEnumAcceptedValues(String qualifiedName, Map<String, IdeEnumAcceptedValue> values) { | ||
|
||
public record IdeEnumAcceptedValue(String configValue) { | ||
|
||
public static IdeEnumAcceptedValue of(EnumAcceptedValue enumAcceptedValue) { | ||
return new IdeEnumAcceptedValue(enumAcceptedValue.configValue()); | ||
} | ||
} | ||
|
||
public static IdeEnumAcceptedValues of(EnumAcceptedValues enumAcceptedValues) { | ||
if (enumAcceptedValues == null) { | ||
return null; | ||
} | ||
|
||
return new IdeEnumAcceptedValues(enumAcceptedValues.qualifiedName(), | ||
enumAcceptedValues.values().entrySet().stream() | ||
.collect(Collectors.toMap(Entry::getKey, v -> IdeEnumAcceptedValue.of(v.getValue())))); | ||
} | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
.../src/main/java/io/quarkus/annotation/processor/documentation/config/ide/IdeExtension.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package io.quarkus.annotation.processor.documentation.config.ide; | ||
|
||
import io.quarkus.annotation.processor.documentation.config.model.Extension; | ||
|
||
public record IdeExtension(String groupId, String artifactId) { | ||
|
||
public static IdeExtension of(Extension extension) { | ||
return new IdeExtension(extension.groupId(), extension.artifactId()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...in/java/io/quarkus/annotation/processor/documentation/config/model/ConfigItemVisitor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package io.quarkus.annotation.processor.documentation.config.model; | ||
|
||
public interface ConfigItemVisitor { | ||
|
||
public void visit(AbstractConfigItem configItem); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters