-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
* Enter Bach 2024 * Read project version from system properties * Fix and run document action
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
out/ | ||
var/ | ||
|
||
*.class | ||
*.jar |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
public class Build { | ||
public static void main(String... args) { | ||
Project.ofCurrentWorkingDirectory().build(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class Document { | ||
public static void main(String... args) { | ||
Project.ofCurrentWorkingDirectory().document(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import java.io.File; | ||
import java.nio.file.Path; | ||
import java.util.List; | ||
import run.bach.Bach; | ||
import run.bach.ToolCall; | ||
import run.bach.ToolRunner; | ||
import run.bach.workflow.Builder; | ||
import run.bach.workflow.Structure; | ||
import run.bach.workflow.Structure.*; | ||
import run.bach.workflow.Workflow; | ||
|
||
record Project(Workflow workflow) implements Builder { | ||
static final String VERSION = System.getProperty("--project-version", "11-ea"); | ||
static Project ofCurrentWorkingDirectory() { | ||
var basics = new Basics("purejin", VERSION); | ||
var main = | ||
new Space( | ||
"main", | ||
11, | ||
"", | ||
declareModule("main", "se.jbee.inject"), | ||
declareModule("main", "se.jbee.inject.action"), | ||
declareModule("main", "se.jbee.inject.api"), | ||
declareModule("main", "se.jbee.inject.bind"), | ||
declareModule("main", "se.jbee.inject.bootstrap"), | ||
declareModule("main", "se.jbee.inject.container"), | ||
declareModule("main", "se.jbee.inject.contract"), | ||
declareModule("main", "se.jbee.inject.convert"), | ||
declareModule("main", "se.jbee.inject.event"), | ||
declareModule("main", "se.jbee.lang")); | ||
var test = | ||
new Space( | ||
"test", | ||
List.of(main.name()), | ||
0, | ||
List.of(), | ||
new DeclaredModules( | ||
declareModule("test", "se.jbee.junit.assertion"), | ||
declareModule("test", "test.examples"), | ||
declareModule("test", "test.integration"))); | ||
|
||
return new Project( | ||
new Workflow( | ||
Bach.Folders.ofCurrentWorkingDirectory(), | ||
new Structure(basics, new Spaces(main, test)), | ||
ToolRunner.ofSystem())); | ||
} | ||
|
||
private static DeclaredModule declareModule(String space, String module) { | ||
var content = Path.of(module); | ||
return new DeclaredModule(content, content.resolve(space + "/java/module-info.java")); | ||
} | ||
|
||
@Override | ||
public ToolCall classesCompilerNewJavacToolCall() { | ||
return ToolCall.of("javac") | ||
.add("-g") | ||
.add("-encoding", "UTF-8") | ||
.add("-parameters") | ||
.add("-X" + "lint:-missing-explicit-ctor,-serial"); | ||
} | ||
|
||
@Override | ||
public void testerRunJUnitPlatform(ToolCall junit) { | ||
run(junit.add("--details", "NONE").add("--disable-banner")); | ||
} | ||
|
||
void document() { | ||
var main = workflow.structure().spaces().space("main"); | ||
var moduleSourcePaths = main.modules().toModuleSourcePaths(); | ||
var moduleSourcePath = String.join(File.pathSeparator, moduleSourcePaths); | ||
var javadoc = | ||
ToolCall.of("javadoc") | ||
.add("-quiet") | ||
.add("--module", main.modules().names(",")) | ||
.add("--module-source-path", moduleSourcePath) | ||
.add("-d", workflow.folders().out("main", "api")) | ||
.add("-no" + "timestamp") | ||
.add("-encoding", "UTF-8") | ||
.add("-use") | ||
.add("-link" + "source") | ||
.add("-X" + "doc" + "lint:-missing") | ||
.add( | ||
"-group", | ||
"API", | ||
"se.jbee.inject:se.jbee.inject.api:se.jbee.inject.bind:se.jbee.inject.lang") | ||
.add("-group", "Container", "se.jbee.inject.bootstrap:se.jbee.inject.container") | ||
.add( | ||
"-group", | ||
"Add-ons", | ||
"se.jbee.inject.action:se.jbee.inject.event:se.jbee.inject.convert:se.jbee.inject.contract"); | ||
|
||
run(javadoc); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class Rebuild { | ||
public static void main(String... args) { | ||
var project = Project.ofCurrentWorkingDirectory(); | ||
project.clean(); | ||
project.build(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
target/ | ||
src/doc/ | ||
lib/ | ||
lib/*.jar | ||
pom.* | ||
*~ | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule ".bach/src/run/bach"] | ||
path = .bach/src/run/bach | ||
url = https://github.com/sormuras/run.bach |
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.