-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
1,895 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# This is a Jamal reference file containing serialized base64 encoded macros | ||
# Created: 2023-12-27 19:49:51 +0100 | ||
# Created: 2024-01-26 12:29:48 +0100 | ||
# id|openStr|closeStr|verbatim|tailParameter|pure|content|parameters | ||
# TOC | ||
VE9D|eyU=|JX0=|0|0|0|Ci4gPDxJbnN0YWxsYXRpb24+PgouIDw8R1M+PgouIDw8Q29uZmlndXJhdGlvbj4+Ci4gPDxGZWF0dXJlcz4+Ci4gPDxDb250cmlidXRpbmc+PgouIDw8RG9jdW1lbnRhdGlvbj4+Ci4gPDxMaWNlbnNlPj4KLiA8PENoYW5nZWxvZz4+Ci4gPDxSb2FkbWFwPj4KLiA8PFN1cHBvcnQ+PgouIDw8RkFRPj4KLiA8PE1haW50ZW5hbmNlPj4=| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{%@comment nosave%} | ||
{%#java:insert to="../java/javax0/jamal/java/Pom.java" segment="text_tags" | ||
{%!@for $TAG in (modelVersion,groupId,artifactId,version,packaging,name,description,url,inceptionYear)= | ||
public void $TAG(String $TAG) { | ||
project.add("$TAG", $TAG); | ||
} | ||
%}\ | ||
%}\ | ||
{%#java:insert to="../java/javax0/jamal/java/Pom.java" segment="typed_tags" | ||
{%!@for $TAG in (parent,organization,prerequisites,issueManagement,ciManagement,distributionManagement,dependencyManagement,build,reporting)= | ||
{%#define $CLASS={%#case:upper {%@string:substring (begin=0 end=1) $TAG%}%}{%@string:substring (begin=1) $TAG%}%}\ | ||
public {%$CLASS%} $TAG() { | ||
var $TAG = project.get({%$CLASS%}.class, "$TAG"); | ||
if ($TAG != null) { | ||
return $TAG; | ||
} | ||
$TAG = new {%$CLASS%}(); | ||
project.add("$TAG", $TAG); | ||
return $TAG; | ||
} | ||
%} | ||
%} | ||
|
||
{%#java:insert to="../java/javax0/jamal/java/DependencyManagement.java" wholeFile | ||
package javax0.jamal.java; | ||
import static javax0.jamal.java.Xml.path; | ||
public class DependencyManagement extends Xml { | ||
|
||
|
||
public DependencyManagement dependency(CharSequence... dependencies) { | ||
for (var dependency : dependencies) { | ||
if (!(dependency instanceof Dependency)) { | ||
dependency = Dependency.dependency(dependency); | ||
} | ||
add("dependencies", dependency); | ||
} | ||
return this; | ||
} | ||
} | ||
|
||
%} | ||
{%#java:insert to="../java/javax0/jamal/java/Build.java" wholeFile | ||
package javax0.jamal.java; | ||
public class Build extends Xml { | ||
|
||
{%!@for $TAG in (sourceDirectory,scriptSourceDirectory,testSourceDirectory,outputDirectory,testOutputDirectory,extensions )= | ||
public void $TAG(String $TAG) { | ||
add("$TAG", $TAG); | ||
} | ||
%}\ | ||
|
||
public Build extensions(CharSequence... extensions) { | ||
for (var extension : extensions) { | ||
if (!(extension instanceof Extension)) { | ||
extension = Extension.extension(extension); | ||
} | ||
add("extensions", extension); | ||
} | ||
return this; | ||
} | ||
} | ||
|
||
%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,39 @@ | ||
package javax0.jamal.java; | ||
public class Build extends Xml { | ||
|
||
public class Build { | ||
|
||
private final Xml project; | ||
public void sourceDirectory(String sourceDirectory) { | ||
add("sourceDirectory", sourceDirectory); | ||
} | ||
|
||
public void scriptSourceDirectory(String scriptSourceDirectory) { | ||
add("scriptSourceDirectory", scriptSourceDirectory); | ||
} | ||
|
||
public void testSourceDirectory(String testSourceDirectory) { | ||
add("testSourceDirectory", testSourceDirectory); | ||
} | ||
|
||
public Build(Xml project) { | ||
this.project = project; | ||
public void outputDirectory(String outputDirectory) { | ||
add("outputDirectory", outputDirectory); | ||
} | ||
|
||
public void testOutputDirectory(String testOutputDirectory) { | ||
add("testOutputDirectory", testOutputDirectory); | ||
} | ||
|
||
public void extensions (String extensions ) { | ||
add("extensions ", extensions ); | ||
} | ||
|
||
public Build extensions(CharSequence... extensions) { | ||
for (var extension : extensions) { | ||
if (!(extension instanceof Extension)) { | ||
extension = Extension.extension(extension); | ||
} | ||
add("extensions", extension); | ||
} | ||
return this; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package javax0.jamal.java; | ||
|
||
public class CiManagement extends Xml { | ||
} |
16 changes: 16 additions & 0 deletions
16
jamal-java/src/test/java/javax0/jamal/java/DependencyManagement.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package javax0.jamal.java; | ||
import static javax0.jamal.java.Xml.path; | ||
public class DependencyManagement extends Xml { | ||
|
||
|
||
public DependencyManagement dependency(CharSequence... dependencies) { | ||
for (var dependency : dependencies) { | ||
if (!(dependency instanceof Dependency)) { | ||
dependency = Dependency.dependency(dependency); | ||
} | ||
add("dependencies", dependency); | ||
} | ||
return this; | ||
} | ||
} | ||
|
4 changes: 4 additions & 0 deletions
4
jamal-java/src/test/java/javax0/jamal/java/DistributionManagement.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package javax0.jamal.java; | ||
|
||
public class DistributionManagement extends Xml { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package javax0.jamal.java; | ||
|
||
public class Extension extends Xml { | ||
|
||
public Extension() { | ||
super("dependency"); | ||
} | ||
|
||
private Extension(CharSequence coordinate) { | ||
this(); | ||
final var coords = ((String) coordinate).split(":"); | ||
if (coords.length > 0 && !coords[0].isEmpty()) { | ||
groupId(coords[0]); | ||
} | ||
if (coords.length > 1 && !coords[1].isEmpty()) { | ||
artifactId(coords[1]); | ||
} | ||
if (coords.length > 2 && !coords[2].isEmpty()) { | ||
version(coords[2]); | ||
} | ||
} | ||
|
||
public static Extension extension(CharSequence coordinates) { | ||
return new Extension(coordinates); | ||
} | ||
|
||
public static Extension extension() { | ||
return new Extension(); | ||
} | ||
|
||
public Extension groupId(CharSequence groupId) { | ||
add(path("extension", "groupId"), groupId); | ||
return this; | ||
} | ||
|
||
public Extension artifactId(CharSequence artifactId) { | ||
add(path("extension", "artifactId"), artifactId); | ||
return this; | ||
} | ||
|
||
public Extension version(CharSequence version) { | ||
add(path("extension", "version"), version); | ||
return this; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
jamal-java/src/test/java/javax0/jamal/java/IssueManagement.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package javax0.jamal.java; | ||
|
||
public class IssueManagement extends Xml { | ||
} |
Oops, something went wrong.