Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change apiview_properties.json naming scheme #8066

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ private static void processJavaSourcesJar(File inputFile, APIListing apiListing)
final ReviewProperties reviewProperties = getReviewProperties(inputFile);

final String groupId = reviewProperties.getMavenPom().getGroupId();
final String artifactId = reviewProperties.getMavenPom().getArtifactId();

final String reviewName = reviewProperties.getMavenPom().getArtifactId()
+ " (version " + reviewProperties.getMavenPom().getVersion() + ")";
final String reviewName = artifactId + " (version " + reviewProperties.getMavenPom().getVersion() + ")";
System.out.println(" Using '" + reviewName + "' for the review name");

final String packageName = (groupId.isEmpty() ? "" : groupId + ":") + reviewProperties.getMavenPom().getArtifactId();
final String packageName = (groupId.isEmpty() ? "" : groupId + ":") + artifactId;
System.out.println(" Using '" + packageName + "' for the package name");

System.out.println(" Using '" + reviewProperties.getMavenPom().getVersion() + "' for the package version");
Expand All @@ -172,7 +172,9 @@ private static void processJavaSourcesJar(File inputFile, APIListing apiListing)
try {
// we eagerly load the apiview_properties.json file into an ApiViewProperties object, so that it can
// be used throughout the analysis process, as required
URL apiViewPropertiesFile = fs.getPath("/META-INF/apiview_properties.json").toUri().toURL();
// the filename is [<artifactid>_]apiview_properties.json
String filename = (artifactId != null && !artifactId.isEmpty() ? (artifactId + "_") : "") + "apiview_properties.json";
URL apiViewPropertiesFile = fs.getPath("/META-INF/" + filename).toUri().toURL();
final ObjectMapper objectMapper = new ObjectMapper();
ApiViewProperties properties = objectMapper.readValue(apiViewPropertiesFile, ApiViewProperties.class);
apiListing.setApiViewProperties(properties);
Expand Down