package project;

import com.github.sormuras.bach.Main;
import com.github.sormuras.bach.project.Project;
import java.util.Map;

public class Configurator implements Project.Configurator {
  @Override
  public Project apply(Project project) {
    return project
        .withTargetsJava(17)
        .withTargetsJava("test", Runtime.version().feature())
        .withLauncher(Main.class.getCanonicalName())
        .withRequiresModule("com.github.sormuras.hello", "org.junit.platform.console")
        .withExternalModule(
            "com.github.sormuras.hello",
            """
                https://github.com/sormuras/hello/releases\
                /download/1-M3/com.github.sormuras.hello@1-M3.jar\
                #SHA-256=0c993996571cee9555ef947eb198145ddc30a2d834fe606a6f16780afd8aea7b""")
        .withExternalModules(Map.of(/* here be name-from pairs */ ))
        .withExternalModules("junit", "5.8.2")
        .withExternalTool(
            "format@1.15.0",
            """
            https://github.com/google/google-java-format/releases\
            /download/v1.15.0/google-java-format-1.15.0-all-deps.jar\
            #SIZE=3519780\
            &SHA-256=a356bb0236b29c57a3ab678f17a7b027aad603b0960c183a18f1fe322e4f38ea""");
  }
}

@@ -101,30 +101,8 @@
 ect;
-%0Aimport java.util.Map;
 %0A%0Apu
@@ -221,51 +221,246 @@
     
-return project%0A        .withTargetsJava(17)
+// Operate on the project instance preconfigured by Bach%0A    return project%0A        // Modules of main module space target Java release 17.%0A        .withTargetsJava(17)%0A%0A        // Modules of test module space target current Java release.
 %0A   
@@ -513,24 +513,74 @@
 ).feature())
+%0A%0A        // Main module space's main entry-point.
 %0A        .wi
@@ -625,94 +625,454 @@
 ())%0A
-        .withRequiresModule(%22com.github.sormuras.hello%22, %22org.junit.platform.console%22)
+%0A        // Additional names of external modules required by this project.%0A        // All other dependencies are acquired from %60module-info.java%60 files.%0A        .withRequiresModule(%22com.github.sormuras.hello%22)%0A        .withRequiresModule(%22org.junit.platform.console%22)%0A%0A        // Specify remote locations of all required external modules and tools.%0A        // Locate module %22com.github.sormuras.hello%22 via an explicit URL with checksum fragments.
 %0A   
@@ -1159,35 +1159,32 @@
 %22%22%0A             
-   
 https://github.c
@@ -1216,35 +1216,32 @@
 s%5C%0A             
- 
-  
 /download/1-M3/c
@@ -1288,19 +1288,16 @@
         
-  
- 
 #SHA-256
@@ -1365,128 +1365,243 @@
 ea7b
-%22%22%22)%0A        .withExternalModules(Map.of(/* here be name-from pairs */ ))%0A        .withExternalModules(%22junit%22, %225.8.2%22)
+%0A             %22%22%22)%0A        // Locate JUnit modules via https://github.com/sormuras/bach-external-modules%0A        .withExternalModules(%22junit%22, %225.8.2%22)%0A        // Locate tool %22format@1.15.0%22 via an explicit URL with checksum fragments.
 %0A   
@@ -1918,16 +1918,29 @@
 2e4f38ea
+%0A            
 %22%22%22);%0A  

Document Bach's own project configurator