/*
 * Bach - Java Shell Builder
 * Copyright (C) 2020 Christian Stein
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package build;

import de.sormuras.bach.Bach;
import de.sormuras.bach.project.MainSources;
import de.sormuras.bach.project.ModuleSource;
import de.sormuras.bach.project.Project;
import java.nio.file.Path;

/** Bach's own build program. */
class Build {

  public static void main(String... args) {
    var project =
        Project.of("bach", Bach.VERSION.toString())
            // .title("\uD83C\uDFBC Bach.java")
            // .compileForJavaRelease(11)
            // .terminateCompilationIfWarningsOccur(true)
            // .requires("org.junit.platform.console")
            .with(
                MainSources.of().with(ModuleSource.of(Path.of("src/de.sormuras.bach/main/java"))));

    Bach.of(project).build();
  }
}

@@ -673,16 +673,54 @@
 h.Bach;%0A
+import de.sormuras.bach.project.Base;%0A
 import d
@@ -843,16 +843,52 @@
 roject;%0A
+import de.sormuras.bach.tool.Javac;%0A
 import j
@@ -999,16 +999,64 @@
 args) %7B%0A
+    var base = Base.of();%0A    var release = 11;%0A
     var 
@@ -1117,16 +1117,40 @@
 ring())%0A
+            .with(base)%0A
         
@@ -1209,51 +1209,585 @@
 // .
-compileForJavaRelease(11)%0A            // .t
+requires(%22org.junit.platform.console%22)%0A            .with(%0A                MainSources.of()%0A                    .with(%0A                        Javac.of()%0A                            .with(%22-d%22, base.classes(%22%22, release))%0A                            .with(%22--module%22, %22de.sormuras.bach%22)%0A                            .with(%22--module-source-path%22, %22src/*/main/java%22)%0A                            .withCompileForJavaRelease(release)%0A                            .withRecommendedWarnings()%0A                            .withWarnings(%22all%22, %22-preview%22)%0A                            .withT
 ermi
@@ -1821,12 +1821,8 @@
 cur(
-true
 )%0A  
@@ -1835,69 +1835,120 @@
     
-// .requires(%22org.junit.platform.console%22)%0A            .with(
+                .with(%22--module-version%22, Bach.VERSION)%0A                            .with(%22-encoding%22, %22UTF-8%22))
 %0A   
@@ -1960,32 +1960,20 @@
         
-MainSources.of()
+    
 .with(Mo

Update build program