package build;

import de.sormuras.bach.Bach;

class Build {
  public static void main(String... args) {
    var bach =
        Bach.of(
            scanner -> scanner.offset("src"),
            project ->
                project
                    .title("Silk DI")
                    .version("19.1-ea")
                    .requires("org.hamcrest") // By junit at runtime.
                    .requires("org.junit.vintage.engine") // Discovers and executes junit 3/4 tests.
                    .requires("org.junit.platform.console") // Launch the JUnit Platform.
            );

    bach.build(
        (arguments, project, context) -> {
          var tool = context.get("tool");
          if ("javadoc".equals(tool)) arguments.put("-Xdoclint:none");
          // if ("junit".equals(tool))
          //  arguments.put("--include-classname", "se.jbee.inject.bind.TestDiskScopeBinds");
        });
  }
}

@@ -38,16 +38,94 @@
 ch.Bach;
+%0Aimport java.nio.file.Files;%0Aimport java.nio.file.Path;%0Aimport java.util.List;
 %0A%0Aclass 
@@ -174,17 +174,64 @@
 . args) 
-%7B
+throws Exception %7B%0A    var version = %2219.1-ea%22;%0A
 %0A    var
@@ -415,25 +415,23 @@
 version(
-%2219.1-ea%22
+version
 )%0A      
@@ -1017,15 +1017,1855 @@
      %7D);
+%0A%0A    generateMavenPomXml(version);%0A  %7D%0A%0A  private static void generateMavenPomXml(String version) throws Exception %7B%0A    Files.write(%0A        Path.of(%22.bach/workspace/se.jbee.inject@%22 + version + %22.pom.xml%22),%0A        List.of(%0A            %22%3C?xml version='1.0' encoding='UTF-8'?%3E%22,%0A            %22%3Cproject xmlns='http://maven.apache.org/POM/4.0.0'%22,%0A            %22    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'%22,%0A            %22    xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd'%3E%22,%0A            %22    %3CmodelVersion%3E4.0.0%3C/modelVersion%3E%22,%0A            %22%22,%0A            %22    %3CgroupId%3Ese.jbee%3C/groupId%3E%22,%0A            %22    %3CartifactId%3Ese.jbee.inject%3C/artifactId%3E%22,%0A            %22    %3Cversion%3E%22 + version + %22%3C/version%3E%22,%0A            %22%22,%0A            %22    %3Cname%3ESilk DI%3C/name%3E%22,%0A            %22    %3Cdescription%3ESilk Java dependency injection framework%3C/description%3E%22,%0A            %22%22,%0A            %22    %3Curl%3Ehttp://www.silkdi.com%3C/url%3E%22,%0A            %22   %3Clicenses%3E%22,%0A            %22        %3Clicense%3E%22,%0A            %22            %3Cname%3EApache License, Version 2.0%3C/name%3E%22,%0A            %22            %3Curl%3Ehttps://www.apache.org/licenses/LICENSE-2.0.txt%3C/url%3E%22,%0A            %22            %3Cdistribution%3Erepo%3C/distribution%3E%22,%0A            %22        %3C/license%3E%22,%0A            %22    %3C/licenses%3E%22,%0A            %22    %3Cscm%3E%22,%0A            %22        %3Curl%3Ehttps://github.com/jbee/silk%3C/url%3E%22,%0A            %22        %3Cconnection%3Ehttps://github.com/jbee/silk.git%3C/connection%3E%22,%0A            %22   %3C/scm%3E%22,%0A            %22%22,%0A            %22    %3Cdevelopers%3E%22,%0A            %22        %3Cdeveloper%3E%22,%0A            %22            %3Cid%3Ejan%3C/id%3E%22,%0A            %22            %3Cname%3EJan Bernitt%3C/name%3E%22,%0A            %22            %3Cemail%3Ejan@jbee.se%3C/email%3E%22,%0A            %22        %3C/developer%3E%22,%0A            %22    %3C/developers%3E%22,%0A            %22%3C/project%3E%22));
 %0A  %7D%0A%7D%0A

Generate "consumer-pom" for Maven deployments