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

[GR-52578] Dump All Registered Resources #8676

Closed
wants to merge 19 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
a2125e1
Print registered resources and sizes in terminal
dnestoro Mar 7, 2024
eb342e5
Enable option check
dnestoro Mar 8, 2024
e8e3f9f
Remove redudant module transformation and print entries in new format
dnestoro Mar 13, 2024
ad6a5b4
Redefine collecting information and add missing negative query reigis…
dnestoro Mar 14, 2024
1eb0b4d
Execute declareResourceAsRegister function only when DumpRegisterReso…
dnestoro Mar 14, 2024
749ad60
Make resource origins URI
dnestoro Mar 19, 2024
cfb3f84
Collect information whether resource is directory or not
dnestoro Mar 22, 2024
1831819
Extract resources info collecting into EmbeddedResourceExporter
dnestoro Mar 25, 2024
ca7d173
Make registered resources list always available and extract resource …
dnestoro Mar 26, 2024
78ee909
Make EmbeddedResourcesInfo singleton
dnestoro Mar 26, 2024
4255e4e
Add embedded-resources-schema
dnestoro Mar 26, 2024
1b5e449
Add missing license headers
dnestoro Mar 27, 2024
76c1583
Use toURI instead of getPath to avoid errors on Windows
dnestoro Mar 28, 2024
ad1e237
Rename ModuleResourceRecord to ModuleResourceKey
dnestoro Apr 2, 2024
7c604b4
Use EMBEDDED_RESOURCES_FILE_NAME constant for declaring file name in …
dnestoro Apr 2, 2024
26b9c60
Collect resources info only when option is passed
dnestoro Apr 4, 2024
0895578
Extend embedded resources section in BuildOutput.md
dnestoro Apr 8, 2024
8bf4abe
Add embedded-resources.json in the list of produced artifacts
dnestoro Apr 12, 2024
01ac294
Do not print anything if data collection is disabled
dnestoro Apr 12, 2024
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
@@ -112,7 +112,7 @@ public static Comparator<ModuleResourceRecord> comparator() {
* specified in the configuration, but we do not want to throw directly (for example when we try
* to check all the modules for a resource).
*/
public static final ResourceStorageEntryBase MISSING_METADATA_MARKER = new ResourceStorageEntryBase();
private static final ResourceStorageEntryBase MISSING_METADATA_MARKER = new ResourceStorageEntryBase();

/**
* Embedding a resource into an image is counted as a modification. Since all resources are
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ private static void resourceReportElement(Resources.ModuleResourceRecord p, Json
w.append('{').indent().newline();
w.quote("resource").append(':').quote(p.resource());
w.newline();
w.quote("module").append(':').quote(p.module() == null ? "ALL_UNNAMED" : p.module().getName());
w.quote("module").append(':').quote(p.module() == null ? "ALL-UNNAMED" : p.module().getName());
w.unindent().newline().append('}');
w.unindent();
}
Original file line number Diff line number Diff line change
@@ -600,17 +600,17 @@ boolean moduleNameMatches(String resourceContainerModuleName) {
@Override
public void afterAnalysis(AfterAnalysisAccess access) {
sealed = true;
// if (Options.DumpRegisteredResources.getValue()) {
Iterable<Resources.ModuleResourceRecord> registeredResources = Resources.singleton().getResourceStorage().getKeys();
List<Resources.ModuleResourceRecord> resourceInfoList = new ArrayList<>();
registeredResources.forEach(resource -> {
String resourceName = resource.resource();
Module module = resource.module();
resourceInfoList.add(new Resources.ModuleResourceRecord(module, resourceName));
});
if (Options.DumpRegisteredResources.getValue()) {
Iterable<Resources.ModuleResourceRecord> registeredResources = Resources.singleton().getResourceStorage().getKeys();
List<Resources.ModuleResourceRecord> resourceInfoList = new ArrayList<>();
registeredResources.forEach(resource -> {
String resourceName = resource.resource();
Module module = resource.module();
resourceInfoList.add(new Resources.ModuleResourceRecord(module, resourceName));
});

ResourceReporter.printReport(resourceInfoList);
// }
ResourceReporter.printReport(resourceInfoList);
}
}

@Override