Compare commits

...

4 commits
main ... 0.9.6

7 changed files with 11 additions and 28 deletions

View file

@ -1,7 +1,7 @@
bld.downloadExtensionJavadoc=false bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true bld.downloadExtensionSources=true
bld.downloadLocation= bld.downloadLocation=
bld.extension-boot=com.uwyn.rife2:bld-spring-boot:0.9.5 bld.extension-boot=com.uwyn.rife2:bld-spring-boot:0.9.6
bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.sourceDirectories= bld.sourceDirectories=
bld.version=1.9.1 bld.version=1.9.1

View file

@ -1,7 +1,7 @@
bld.downloadExtensionJavadoc=false bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true bld.downloadExtensionSources=true
bld.downloadLocation= bld.downloadLocation=
bld.extension-pmd=com.uwyn.rife2:bld-pmd:1.0.1 bld.extension-pmd=com.uwyn.rife2:bld-pmd:1.1.0
bld.repositories=MAVEN_CENTRAL,MAVEN_LOCAL,RIFE2_RELEASES bld.repositories=MAVEN_CENTRAL,MAVEN_LOCAL,RIFE2_RELEASES
bld.sourceDirectories= bld.sourceDirectories=
bld.version=1.9.1 bld.version=1.9.1

View file

@ -33,10 +33,10 @@ public class SpringBootBuild extends Project {
public SpringBootBuild() { public SpringBootBuild() {
pkg = "rife.bld.extension"; pkg = "rife.bld.extension";
name = "bld-spring-boot"; name = "bld-spring-boot";
version = version(0, 9, 5); version = version(0, 9, 6);
javaRelease = 17; javaRelease = 17;
downloadSources = true; downloadSources = true;
autoDownloadPurge = true; autoDownloadPurge = true;

View file

@ -144,15 +144,13 @@ public abstract class AbstractBootOperation<T extends AbstractBootOperation<T>>
var inf_classes_dir = new File(stagingInfDirectory, "classes"); var inf_classes_dir = new File(stagingInfDirectory, "classes");
BootUtils.mkDirs(inf_classes_dir); BootUtils.mkDirs(inf_classes_dir);
for (var dir : sourceDirectories()) { for (var dir : sourceDirectories_) {
if (dir.exists()) { if (dir.exists()) {
FileUtils.copyDirectory(dir, inf_classes_dir); FileUtils.copyDirectory(dir, inf_classes_dir);
} else if (LOGGER.isLoggable(Level.WARNING)) { } else if (LOGGER.isLoggable(Level.WARNING)) {
LOGGER.warning("Directory not found: " + dir.getAbsolutePath()); LOGGER.warning("Directory not found: " + dir.getAbsolutePath());
} }
} }
BootUtils.deleteDirectories(new File(inf_classes_dir, "resources"), new File(inf_classes_dir, "templates"));
} }
/** /**

View file

@ -17,8 +17,6 @@
package rife.bld.extension; package rife.bld.extension;
import rife.bld.Project; import rife.bld.Project;
import rife.tools.FileUtils;
import rife.tools.exceptions.FileUtilsErrorException;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@ -38,20 +36,6 @@ public final class BootUtils {
// no-op // no-op
} }
/**
* Deletes the given directories.
*
* @param directories one or more directories to delete
* @throws FileUtilsErrorException if an error occurs
*/
public static void deleteDirectories(File... directories) throws FileUtilsErrorException {
for (var d : directories) {
if (d.exists()) {
FileUtils.deleteDirectory(d);
}
}
}
/** /**
* Calculates the given file size in bytes, kilobytes, megabytes, gigabytes or terabytes. * Calculates the given file size in bytes, kilobytes, megabytes, gigabytes or terabytes.
* *

View file

@ -139,6 +139,7 @@ public class BootWarOperation extends AbstractBootOperation<BootWarOperation> {
.providedLibs(project.providedClasspathJars()) .providedLibs(project.providedClasspathJars())
.sourceDirectories(project.buildMainDirectory(), project.srcMainResourcesDirectory()); .sourceDirectories(project.buildMainDirectory(), project.srcMainResourcesDirectory());
} }
/** /**
* Provides libraries that will be used for the WAR creation in {@code /WEB-INF/lib-provided}. * Provides libraries that will be used for the WAR creation in {@code /WEB-INF/lib-provided}.
* *

View file

@ -24,7 +24,6 @@ import rife.tools.FileUtils;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.List; import java.util.List;
import java.util.jar.JarEntry; import java.util.jar.JarEntry;
@ -277,10 +276,12 @@ class BootJarOperationTest {
void testProject() throws IOException { void testProject() throws IOException {
var tmp_dir = Files.createTempDirectory("bootprjtmp").toFile(); var tmp_dir = Files.createTempDirectory("bootprjtmp").toFile();
var project = new CustomProject(tmp_dir); var project = new CustomProject(tmp_dir);
var bootJar = new BootJarOperation().fromProject(project); var bootJar = new BootJarOperation().fromProject(project).sourceDirectories("src/main/java");
assertThat(bootJar.mainClass()).as("mainClass").isEqualTo(MAIN_CLASS); assertThat(bootJar.mainClass()).as("mainClass").isEqualTo(MAIN_CLASS);
assertThat(bootJar.sourceDirectories()).as("sourceDirectories.size").hasSize(2); assertThat(bootJar.sourceDirectories()).as("sourceDirectories.size").hasSize(3)
.containsExactly(project.buildMainDirectory(), project.srcMainResourcesDirectory(),
new File("src/main/java"));
assertThat(bootJar.manifestAttributes()).as("manifestAttributes.size").hasSize(3); assertThat(bootJar.manifestAttributes()).as("manifestAttributes.size").hasSize(3);
assertThat(bootJar.manifestAttributes().get("Manifest-Version")).as("Manifest-Version").isEqualTo("1.0"); assertThat(bootJar.manifestAttributes().get("Manifest-Version")).as("Manifest-Version").isEqualTo("1.0");
assertThat(bootJar.manifestAttributes().get("Main-Class")).as("Main-Class").endsWith("JarLauncher"); assertThat(bootJar.manifestAttributes().get("Main-Class")).as("Main-Class").endsWith("JarLauncher");
@ -288,8 +289,7 @@ class BootJarOperationTest {
assertThat(bootJar.manifestAttribute("Manifest-Test", "tsst") assertThat(bootJar.manifestAttribute("Manifest-Test", "tsst")
.manifestAttributes().get("Manifest-Test")).as("Manifest-Test").isEqualTo("tsst"); .manifestAttributes().get("Manifest-Test")).as("Manifest-Test").isEqualTo("tsst");
assertThat(bootJar.destinationDirectory()).as("destinationDirectory").isDirectory(); assertThat(bootJar.destinationDirectory()).as("destinationDirectory").isDirectory();
assertThat(bootJar.destinationDirectory().getAbsolutePath()).as("destinationDirectory") assertThat(bootJar.destinationDirectory()).isEqualTo(project.buildDistDirectory());
.isEqualTo(Path.of(tmp_dir.getPath(), "build", "dist").toString());
assertThat(bootJar.infLibs()).as("infoLibs").isEmpty(); assertThat(bootJar.infLibs()).as("infoLibs").isEmpty();
assertThat(bootJar.launcherLibs()).as("launcherJars").isEmpty(); assertThat(bootJar.launcherLibs()).as("launcherJars").isEmpty();
assertThat(bootJar.destinationFileName()).isEqualTo("test_project-0.0.1-boot.jar"); assertThat(bootJar.destinationFileName()).isEqualTo("test_project-0.0.1-boot.jar");