Class Base

java.lang.Object
de.sormuras.bach.project.Base

public final class Base
extends Object
A collection of project-defining directories and derived paths.

Example


 Component     Directory Tree Example
 --------------------------------------------------------
 directory --> jigsaw-quick-start
               ├───.bach
               │   │   build.jsh
               │   ├───lib
               │   │       de.sormuras.bach@14-M1.jar
               │   ├───src
 workspace ----│-> └───workspace
               │       ├───classes
               │       │   └───11
               │       │       ├───com.greetings
               │       │       │       module-info.class
               │       │       └───com
               │       │           └───greetings
               │       │                   Main.class
               │       ├───classes-test
               │       ├───documentation
               │       ├───image
               │       ├───modules
               │       │       com.greetings@1-ea.jar
               │       ├───modules-test
               │       ├───reports
               │       └───sources
 libraries --> ├───lib
               └───src
                   └───com.greetings
                       │   module-info.java
                       └───com
                           └───greetings
                                   Main.java
 
  • Constructor Details

    • Base

      public Base​(Path directory, Path libraries, Path workspace)
      Initializes a new base instance with the given component values.
      Parameters:
      directory - The path to the base directory of the project
      libraries - The directory that contains 3rd-party modules
      workspace - The directory that collects all generated assets
  • Method Details

    • of

      public static Base of()
      Return a new base instance for the current user directory.
      • directory = Path.of("")
      • libraries = Path.of("lib")
      • workspace = Path.of(".bach", "workspace")
      Returns:
      A new default base object
    • of

      public static Base of​(String first, String... more)
      Return a new base instance for the given directory.
      • directory = Path.of(first, more)
      • libraries = Path.of(first, more, "lib")
      • workspace = Path.of(first, more, ".bach", "workspace")
      Parameters:
      first - The first path element to use as the base directory
      more - The array of path elements to complete the base directory
      Returns:
      A new base object initialized for the given directory
    • of

      public static Base of​(Path directory)
      Return a new base instance for the given directory.
      • directory = directory
      • libraries = directory.resolve("lib")
      • workspace = directory.resolve(".bach", "workspace")
      Parameters:
      directory - The path to use as the base directory
      Returns:
      A new base object initialized for the given directory
    • directory

      public Path directory()
    • libraries

      public Path libraries()
    • workspace

      public Path workspace()
    • directory

      public Path directory​(String entry, String... more)
    • libraries

      public Path libraries​(String entry)
    • workspace

      public Path workspace​(String entry, String... more)
    • classes

      public Path classes​(String realm, int release)
    • classes

      public Path classes​(String realm, int release, String module)
    • documentation

      public Path documentation​(String entry)
    • modules

      public Path modules​(String realm)
    • sources

      public Path sources​(String realm)
    • reports

      public Path reports​(String entry, String... more)