Home / Function/ writeNativeImageArgFileIfNecessary() — spring-boot Function Reference

writeNativeImageArgFileIfNecessary() — spring-boot Function Reference

Architecture documentation for the writeNativeImageArgFileIfNecessary() function in BootZipCopyAction.java from the spring-boot codebase.

Function java Archiving LauncherConfig calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  88064515_e5e4_040a_fb1f_b529c6a929fe["writeNativeImageArgFileIfNecessary()"]
  40a2d94c_64cc_cc36_cff0_428f467bc9d9["finish()"]
  40a2d94c_64cc_cc36_cff0_428f467bc9d9 -->|calls| 88064515_e5e4_040a_fb1f_b529c6a929fe
  e16da5d1_b19e_4d45_229b_91569861926e["writeEntry()"]
  88064515_e5e4_040a_fb1f_b529c6a929fe -->|calls| e16da5d1_b19e_4d45_229b_91569861926e
  style 88064515_e5e4_040a_fb1f_b529c6a929fe fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

build-plugin/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootZipCopyAction.java lines 365–389

		private void writeNativeImageArgFileIfNecessary() throws IOException {
			Set<String> excludes = new LinkedHashSet<>();
			for (Map.Entry<String, FileCopyDetails> entry : this.writtenLibraries.entrySet()) {
				DependencyDescriptor descriptor = BootZipCopyAction.this.resolvedDependencies
					.find(entry.getValue().getFile());
				LibraryCoordinates coordinates = (descriptor != null) ? descriptor.getCoordinates() : null;
				FileCopyDetails propertiesFile = (coordinates != null) ? this.reachabilityMetadataProperties
					.get(ReachabilityMetadataProperties.getLocation(coordinates)) : null;
				if (propertiesFile != null) {
					try (InputStream inputStream = propertiesFile.open()) {
						ReachabilityMetadataProperties properties = ReachabilityMetadataProperties
							.fromInputStream(inputStream);
						if (properties.isOverridden()) {
							excludes.add(entry.getKey());
						}
					}
				}
			}
			NativeImageArgFile argFile = new NativeImageArgFile(excludes);
			argFile.writeIfNecessary((lines) -> {
				ZipEntryContentWriter writer = ZipEntryContentWriter.fromLines((BootZipCopyAction.this.encoding != null)
						? BootZipCopyAction.this.encoding : StandardCharsets.UTF_8.name(), lines);
				writeEntry(NativeImageArgFile.LOCATION, writer, true);
			});
		}

Domain

Subdomains

Calls

Called By

Frequently Asked Questions

What does writeNativeImageArgFileIfNecessary() do?
writeNativeImageArgFileIfNecessary() is a function in the spring-boot codebase.
What does writeNativeImageArgFileIfNecessary() call?
writeNativeImageArgFileIfNecessary() calls 1 function(s): writeEntry.
What calls writeNativeImageArgFileIfNecessary()?
writeNativeImageArgFileIfNecessary() is called by 1 function(s): finish.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free