multiModuleCustomLayers() — spring-boot Function Reference
Architecture documentation for the multiModuleCustomLayers() function in AbstractBootArchiveIntegrationTests.java from the spring-boot codebase.
Entity Profile
Dependency Diagram
graph TD bfc328c2_9a96_d1f1_d259_8f62ad8057fe["multiModuleCustomLayers()"] 1b7ab26c_1b23_854e_e55d_187dce5b4cd2["writeSettingsGradle()"] bfc328c2_9a96_d1f1_d259_8f62ad8057fe -->|calls| 1b7ab26c_1b23_854e_e55d_187dce5b4cd2 c1d87296_7b81_712e_cfb5_8a0a1fef6968["writeMainClass()"] bfc328c2_9a96_d1f1_d259_8f62ad8057fe -->|calls| c1d87296_7b81_712e_cfb5_8a0a1fef6968 2537bd26_f68f_0773_f0ef_19e3a06ef3b7["writeResource()"] bfc328c2_9a96_d1f1_d259_8f62ad8057fe -->|calls| 2537bd26_f68f_0773_f0ef_19e3a06ef3b7 4411a1be_530d_c0d4_e4d4_669711600b98["readLayerIndex()"] bfc328c2_9a96_d1f1_d259_8f62ad8057fe -->|calls| 4411a1be_530d_c0d4_e4d4_669711600b98 c312f8db_dbba_3214_8e81_013a94f3f3ca["getExpectedApplicationLayerContents()"] bfc328c2_9a96_d1f1_d259_8f62ad8057fe -->|calls| c312f8db_dbba_3214_8e81_013a94f3f3ca f135ea13_1496_d12c_baa5_7d8c5094e579["assertExtractedLayers()"] bfc328c2_9a96_d1f1_d259_8f62ad8057fe -->|calls| f135ea13_1496_d12c_baa5_7d8c5094e579 style bfc328c2_9a96_d1f1_d259_8f62ad8057fe fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveIntegrationTests.java lines 488–548
@TestTemplate
void multiModuleCustomLayers() throws IOException {
writeSettingsGradle();
writeMainClass();
writeResource();
BuildResult build = this.gradleBuild.build(this.taskName);
BuildTask task = build.task(":" + this.taskName);
assertThat(task).isNotNull();
assertThat(task.getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
Map<String, List<String>> indexedLayers;
String toolsJar = this.libPath + JarModeLibrary.TOOLS.getName();
try (JarFile jarFile = new JarFile(new File(this.gradleBuild.getProjectDir(), "build/libs").listFiles()[0])) {
assertThat(jarFile.getEntry(toolsJar)).isNotNull();
assertThat(jarFile.getEntry(this.libPath + "alpha-1.2.3.jar")).isNotNull();
assertThat(jarFile.getEntry(this.libPath + "bravo-1.2.3.jar")).isNotNull();
assertThat(jarFile.getEntry(this.libPath + "charlie-1.2.3.jar")).isNotNull();
assertThat(jarFile.getEntry(this.libPath + "commons-lang3-3.9.jar")).isNotNull();
assertThat(jarFile.getEntry(this.libPath + "spring-core-5.2.5.RELEASE.jar")).isNotNull();
assertThat(jarFile.getEntry(this.libPath + "spring-jcl-5.2.5.RELEASE.jar")).isNotNull();
assertThat(jarFile.getEntry(this.libPath + "library-1.0-SNAPSHOT.jar")).isNotNull();
assertThat(jarFile.getEntry(this.classesPath + "example/Main.class")).isNotNull();
assertThat(jarFile.getEntry(this.classesPath + "static/file.txt")).isNotNull();
assertThat(jarFile.getEntry(this.indexPath + "layers.idx")).isNotNull();
indexedLayers = readLayerIndex(jarFile);
}
List<String> layerNames = Arrays.asList("dependencies", "commons-dependencies", "snapshot-dependencies",
"subproject-dependencies", "static", "app");
assertThat(indexedLayers.keySet()).containsExactlyElementsOf(layerNames);
Set<String> expectedSubprojectDependencies = new TreeSet<>();
expectedSubprojectDependencies.add(this.libPath + "alpha-1.2.3.jar");
expectedSubprojectDependencies.add(this.libPath + "bravo-1.2.3.jar");
expectedSubprojectDependencies.add(this.libPath + "charlie-1.2.3.jar");
Set<String> expectedDependencies = new TreeSet<>();
expectedDependencies.add(this.libPath + "spring-core-5.2.5.RELEASE.jar");
expectedDependencies.add(this.libPath + "spring-jcl-5.2.5.RELEASE.jar");
List<String> expectedSnapshotDependencies = new ArrayList<>();
expectedSnapshotDependencies.add(this.libPath + "library-1.0-SNAPSHOT.jar");
(toolsJar.contains("SNAPSHOT") ? expectedSnapshotDependencies : expectedDependencies).add(toolsJar);
assertThat(indexedLayers.get("subproject-dependencies"))
.containsExactlyElementsOf(expectedSubprojectDependencies);
assertThat(indexedLayers.get("dependencies")).containsExactlyElementsOf(expectedDependencies);
assertThat(indexedLayers.get("commons-dependencies")).containsExactly(this.libPath + "commons-lang3-3.9.jar");
assertThat(indexedLayers.get("snapshot-dependencies")).containsExactlyElementsOf(expectedSnapshotDependencies);
assertThat(indexedLayers.get("static")).containsExactly(this.classesPath + "static/");
List<String> appLayer = new ArrayList<>(indexedLayers.get("app"));
String[] appLayerContents = getExpectedApplicationLayerContents(this.classesPath + "example/");
assertThat(appLayer).containsSubsequence(appLayerContents);
appLayer.removeAll(Arrays.asList(appLayerContents));
assertThat(appLayer).containsExactly("org/");
BuildResult listLayers = this.gradleBuild.build("listLayers");
task = listLayers.task(":listLayers");
assertThat(task).isNotNull();
assertThat(task.getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
String listLayersOutput = listLayers.getOutput();
assertThat(new BufferedReader(new StringReader(listLayersOutput)).lines()).containsSequence(layerNames);
BuildResult extractLayers = this.gradleBuild.build("extractLayers");
task = extractLayers.task(":extractLayers");
assertThat(task).isNotNull();
assertThat(task.getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
assertExtractedLayers(layerNames, indexedLayers);
}
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does multiModuleCustomLayers() do?
multiModuleCustomLayers() is a function in the spring-boot codebase.
What does multiModuleCustomLayers() call?
multiModuleCustomLayers() calls 6 function(s): assertExtractedLayers, getExpectedApplicationLayerContents, readLayerIndex, writeMainClass, writeResource, writeSettingsGradle.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free