Finishing Build Action

This commit is contained in:
Speiger 2021-12-27 20:28:45 +01:00
parent af62394651
commit b46a739008
3 changed files with 29 additions and 7 deletions

View File

@ -30,7 +30,7 @@ jobs:
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
- name: Make gradlew executable - name: Make gradlew executable
run: chmod +x ./gradlew run: chmod +x ./gradlew
- name: Build with Gradle - name: Generate SourceCode with Gradle
run: ./gradlew generateSource run: ./gradlew generateGithubSource
- name: Build with Gradle - name: Build with Gradle
run: ./gradlew build run: ./gradlew build

View File

@ -42,8 +42,8 @@ configurations {
} }
dependencies { dependencies {
builderCompile 'de.speiger:Simple-Code-Generator:1.0.5' builderCompile 'de.speiger:Simple-Code-Generator:1.0.6'
runtimeOnly 'de.speiger:Simple-Code-Generator:1.0.5' runtimeOnly 'de.speiger:Simple-Code-Generator:1.0.6'
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
testImplementation 'com.google.guava:guava-testlib:31.0.1-jre' testImplementation 'com.google.guava:guava-testlib:31.0.1-jre'
} }
@ -55,6 +55,14 @@ task generateSource(type: JavaExec) {
main = 'speiger.src.builder.PrimitiveCollectionsBuilder' main = 'speiger.src.builder.PrimitiveCollectionsBuilder'
} }
task generateGithubSource(type: JavaExec) {
group = 'internal'
description = 'Builds the sourcecode for Github Actions'
classpath = sourceSets.builder.runtimeClasspath
main = 'speiger.src.builder.PrimitiveCollectionsBuilder'
args = ['false', 'true']
}
task forceGenerateSource(type: JavaExec) { task forceGenerateSource(type: JavaExec) {
group = 'internal' group = 'internal'
description = 'Builds the sourcecode forceful' description = 'Builds the sourcecode forceful'

View File

@ -29,12 +29,22 @@ public class PrimitiveCollectionsBuilder extends TemplateProcessor
public PrimitiveCollectionsBuilder() public PrimitiveCollectionsBuilder()
{ {
super(Paths.get("src/builder/resources/speiger/assets/collections/templates/"), Paths.get("src/main/java/speiger/src/collections/"), Paths.get("src/builder/resources/speiger/assets/collections/")); this(false);
}
public PrimitiveCollectionsBuilder(boolean silencedSuccess)
{
super(silencedSuccess, Paths.get("src/builder/resources/speiger/assets/collections/templates/"), Paths.get("src/main/java/speiger/src/collections/"), Paths.get("src/builder/resources/speiger/assets/collections/"));
} }
public PrimitiveCollectionsBuilder(Path sourceFolder, Path outputFolder, Path dataFolder) public PrimitiveCollectionsBuilder(Path sourceFolder, Path outputFolder, Path dataFolder)
{ {
super(sourceFolder, outputFolder, dataFolder); this(false, sourceFolder, outputFolder, dataFolder);
}
public PrimitiveCollectionsBuilder(boolean silencedSuccess, Path sourceFolder, Path outputFolder, Path dataFolder)
{
super(silencedSuccess, sourceFolder, outputFolder, dataFolder);
} }
@Override @Override
@ -159,10 +169,14 @@ public class PrimitiveCollectionsBuilder extends TemplateProcessor
new PrimitiveCollectionsBuilder().process(false); new PrimitiveCollectionsBuilder().process(false);
} else if(args.length == 1) { } else if(args.length == 1) {
new PrimitiveCollectionsBuilder().process(Boolean.parseBoolean(args[0])); new PrimitiveCollectionsBuilder().process(Boolean.parseBoolean(args[0]));
} else if(args.length == 2) {
new PrimitiveCollectionsBuilder(Boolean.parseBoolean(args[1])).process(Boolean.parseBoolean(args[0]));
} else if(args.length == 3) { } else if(args.length == 3) {
new PrimitiveCollectionsBuilder(Paths.get(args[0]), Paths.get(args[1]), Paths.get(args[2])).process(false); new PrimitiveCollectionsBuilder(Paths.get(args[0]), Paths.get(args[1]), Paths.get(args[2])).process(false);
} else if(args.length == 4) { } else if(args.length == 4) {
new PrimitiveCollectionsBuilder(Paths.get(args[0]), Paths.get(args[1]), Paths.get(args[2])).process(Boolean.parseBoolean(args[3])); new PrimitiveCollectionsBuilder(false, Paths.get(args[0]), Paths.get(args[1]), Paths.get(args[2])).process(Boolean.parseBoolean(args[3]));
} else if(args.length == 4) {
new PrimitiveCollectionsBuilder(Boolean.parseBoolean(args[4]), Paths.get(args[0]), Paths.get(args[1]), Paths.get(args[2])).process(Boolean.parseBoolean(args[3]));
} else { } else {
System.out.println("Invalid argument count passed in"); System.out.println("Invalid argument count passed in");
System.exit(1); System.exit(1);