Compare commits
3 commits
7df5b39c6a
...
6cb78a9e91
Author | SHA1 | Date | |
---|---|---|---|
6cb78a9e91 | |||
41e5467196 | |||
248d2c3362 |
6 changed files with 37 additions and 34 deletions
4
.github/workflows/bld.yml
vendored
4
.github/workflows/bld.yml
vendored
|
@ -11,8 +11,8 @@ jobs:
|
|||
|
||||
strategy:
|
||||
matrix:
|
||||
java-version: [17, 21, 22]
|
||||
kotlin-version: [ 1.19.24, 2.0.0 ]
|
||||
java-version: [17, 21, 23]
|
||||
kotlin-version: [1.9.24, 2.0.21]
|
||||
|
||||
steps:
|
||||
- name: Checkout source repository
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
<!-- BEST PRACTICES -->
|
||||
<rule ref="category/java/bestpractices.xml">
|
||||
<exclude name="AvoidPrintStackTrace"/>
|
||||
<exclude name="JUnit4TestShouldUseTestAnnotation"/>
|
||||
<exclude name="JUnitTestContainsTooManyAsserts"/>
|
||||
<exclude name="GuardLogStatement"/>
|
||||
<exclude name="UnitTestContainsTooManyAsserts"/>
|
||||
<exclude name="UnitTestShouldUseTestAnnotation"/>
|
||||
</rule>
|
||||
|
||||
<rule ref="category/java/bestpractices.xml/MissingOverride">
|
||||
|
|
|
@ -27,8 +27,8 @@ public class SampleBuild extends Project {
|
|||
|
||||
repositories = List.of(MAVEN_CENTRAL, RIFE2_RELEASES);
|
||||
scope(test)
|
||||
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 11, 0)))
|
||||
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 11, 0)));
|
||||
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 11, 3)))
|
||||
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 11, 3)));
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
bld.downloadExtensionJavadoc=false
|
||||
bld.downloadExtensionSources=true
|
||||
bld.downloadLocation=
|
||||
bld.extension-pmd=com.uwyn.rife2:bld-pmd:1.1.5
|
||||
bld.extension-pmd=com.uwyn.rife2:bld-pmd:1.1.7
|
||||
bld.repositories=MAVEN_CENTRAL,MAVEN_LOCAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
|
||||
bld.version=2.1.0
|
||||
|
|
|
@ -46,8 +46,8 @@ public class GeneratedVersionOperationBuild extends Project {
|
|||
scope(compile)
|
||||
.include(dependency("com.uwyn.rife2", "bld", version(2, 1, 0)));
|
||||
scope(test)
|
||||
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 11, 0)))
|
||||
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 11, 0)))
|
||||
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 11, 3)))
|
||||
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 11, 3)))
|
||||
.include(dependency("org.assertj", "assertj-core", version(3, 26, 3)));
|
||||
|
||||
precompileOperation()
|
||||
|
@ -63,25 +63,23 @@ public class GeneratedVersionOperationBuild extends Project {
|
|||
|
||||
publishOperation()
|
||||
.repositories(version.isSnapshot() ? repository("rife2-snapshot") : repository("rife2"))
|
||||
.repository(repository("github"))
|
||||
.info()
|
||||
.groupId("com.uwyn.rife2")
|
||||
.artifactId("bld-generated-version")
|
||||
.description("bld Extension to Generate Project Version Data")
|
||||
.url("https://github.com/rife2/generated-version")
|
||||
.developer(
|
||||
new PublishDeveloper()
|
||||
.developer(new PublishDeveloper()
|
||||
.id("ethauvin")
|
||||
.name("Erik C. Thauvin")
|
||||
.email("erik@thauvin.net")
|
||||
.url("https://erik.thauvin.net/")
|
||||
)
|
||||
.license(
|
||||
new PublishLicense()
|
||||
.license(new PublishLicense()
|
||||
.name("The Apache License, Version 2.0")
|
||||
.url("https://www.apache.org/licenses/LICENSE-2.0.txt")
|
||||
)
|
||||
.scm(
|
||||
new PublishScm()
|
||||
.scm(new PublishScm()
|
||||
.connection("scm:git:https://github.com/rife2/generated-version.git")
|
||||
.developerConnection("scm:git:git@github.com:rife2/generated-version.git")
|
||||
.url("https://github.com/rife2/generated-version")
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package rife.bld.extension;
|
||||
|
||||
import org.assertj.core.api.AutoCloseableSoftAssertions;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import rife.bld.BaseProject;
|
||||
|
@ -116,9 +117,11 @@ class GeneratedVersionTest {
|
|||
var t = gv.buildTemplate();
|
||||
assertThat(t).isNotNull();
|
||||
|
||||
assertThat(gv.getProject()).isEqualTo(PROJECT);
|
||||
assertThat(gv.getPackageName()).isEqualTo(PROJECT.pkg());
|
||||
assertThat(gv.getProjectName()).isEqualTo(PROJECT.name());
|
||||
try (var softly = new AutoCloseableSoftAssertions()) {
|
||||
softly.assertThat(gv.getProject()).isEqualTo(PROJECT);
|
||||
softly.assertThat(gv.getPackageName()).isEqualTo(PROJECT.pkg());
|
||||
softly.assertThat(gv.getProjectName()).isEqualTo(PROJECT.name());
|
||||
}
|
||||
|
||||
assertThat(t.getContent()).contains("package com.example;").contains("class GeneratedVersion")
|
||||
.contains("PROJECT = \"MyExample\";").contains("MAJOR = 2").contains("MINOR = 1")
|
||||
|
@ -201,13 +204,15 @@ class GeneratedVersionTest {
|
|||
gv.setDirectory(new File("build"));
|
||||
gv.setExtension(".java");
|
||||
|
||||
assertThat(gv.getProject()).as("project").isEqualTo(PROJECT);
|
||||
assertThat(gv.getTemplate()).as("template").exists();
|
||||
assertThat(gv.getPackageName()).as("package name").isEqualTo("com.example.cool");
|
||||
assertThat(gv.getProjectName()).as("project name").isEqualTo("Cool App");
|
||||
assertThat(gv.getClassName()).as("class name").isEqualTo("CoolVersion");
|
||||
assertThat(gv.getExtension()).as("extension").isEqualTo(".java");
|
||||
assertThat(gv.getDirectory()).as("directory").isDirectory();
|
||||
try (var softly = new AutoCloseableSoftAssertions()) {
|
||||
softly.assertThat(gv.getProject()).as("project").isEqualTo(PROJECT);
|
||||
softly.assertThat(gv.getTemplate()).as("template").exists();
|
||||
softly.assertThat(gv.getPackageName()).as("package name").isEqualTo("com.example.cool");
|
||||
softly.assertThat(gv.getProjectName()).as("project name").isEqualTo("Cool App");
|
||||
softly.assertThat(gv.getClassName()).as("class name").isEqualTo("CoolVersion");
|
||||
softly.assertThat(gv.getExtension()).as("extension").isEqualTo(".java");
|
||||
softly.assertThat(gv.getDirectory()).as("directory").isDirectory();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue