/*
 * Bach - Java Shell Builder
 * Copyright (C) 2017 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.
 */

import java.nio.file.Paths;
import java.util.List;

class Demo {

  public static void main(String... args) throws Exception {
    new Demo().basic();
  }

  private void basic() {
    StackWalker.getInstance().forEach(System.out::println);
    Bach builder = new Bach();
    builder.call("java", "--version");
    builder.javac(
        option -> {
          option.moduleSourcePaths =
              List.of(Paths.get("demo/basic/greetings"), Paths.get("demo/basic/hello"));
          option.destinationPath = Paths.get("target/jshell/demo/basic");
          return option;
        });
    builder.java(
        option -> {
          option.modulePaths = List.of(Paths.get("target/jshell/demo/basic"));
          option.module = "com.greetings/com.greetings.Main";
          return option;
        });
    StackWalker.getInstance().forEach(System.out::println);
  }
}

@@ -778,20 +778,45 @@
 asic();%0A
+    new Demo().common();%0A
   %7D%0A
-
 %0A  priva
@@ -903,22 +903,19 @@
   Bach b
-uilder
+ach
  = new B
@@ -926,22 +926,19 @@
 );%0A    b
-uilder
+ach
 .call(%22j
@@ -958,30 +958,27 @@
 ion%22);%0A    b
-uilder
+ach
 .javac(%0A    
@@ -1235,22 +1235,19 @@
 );%0A    b
-uilder
+ach
 .java(%0A 
@@ -1439,24 +1439,24 @@
         %7D);%0A
-
     StackWal
@@ -1506,11 +1506,529 @@
 ln);%0A  %7D
+%0A%0A  private void common() %7B%0A    Bach bach = new Bach();%0A    bach.javac(%0A        options -%3E %7B%0A          options.moduleSourcePaths = List.of(Paths.get(%22deprecated/demo/common/main/java%22));%0A          options.destinationPath = Paths.get(%22target/jshell/demo/common%22);%0A          return options;%0A        %7D);%0A    bach.java(%0A        option -%3E %7B%0A          option.modulePaths = List.of(Paths.get(%22target/jshell/demo/common%22));%0A          option.module = %22com.greetings/com.greetings.Main%22;%0A          return option;%0A        %7D);%0A  %7D
 %0A%7D%0A

Add (deprecated) common layout demo