Skip to content

Commit

Permalink
Minor code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ethauvin committed Nov 4, 2023
1 parent 219645e commit 3e3d6da
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
1 change: 1 addition & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ Please check the [BootJarOperation documentation](https://rife2.github.io/bld-sp
or [BootWarOperation documentation](https://rife2.github.io/bld-spring-boot/rife/bld/extension/BootWarOperation.html#method-summary)
for all available configuration options.

You might also want to have a look at the [Spring Boot Web Application Example for bld](https://github.com/rife2/spring-boot-bld-example).
You may also want to have a look at the [Spring Boot Web Application Example for bld](https://github.com/rife2/spring-boot-bld-example).
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public DemoApplicationBuild() {
public static void main(String[] args) {
var level = Level.ALL;
var logger = Logger.getLogger("rife.bld.extension");
ConsoleHandler consoleHandler = new ConsoleHandler();
var consoleHandler = new ConsoleHandler();
consoleHandler.setLevel(level);
logger.addHandler(consoleHandler);
logger.setLevel(level);
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/rife/bld/extension/AbstractBootOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,11 @@ public T infLibs(Collection<File> jars) {
/**
* Provides the libraries that will be stored in {@code BOOT-INF} or {@code WEB-INF}.
*
* @param jar one or more Java archive file
* @param jars one or more Java archive files
* @return this operation instance
*/
public T infLibs(File... jar) {
infLibs_.addAll(List.of(jar));
public T infLibs(File... jars) {
infLibs_.addAll(List.of(jars));
//noinspection unchecked
return (T) this;
}
Expand Down Expand Up @@ -386,7 +386,7 @@ public T manifestAttributes(Collection<BootManifestAttribute> attributes) {
/**
* Provides source directories that will be used for the archive creation.
*
* @param directories one or more source directory
* @param directories one or more source directories
* @return this operation instance
*/
public T sourceDirectories(File... directories) {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/rife/bld/extension/BootUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ private BootUtils() {
}

/**
* Deletes the given directory.
* Deletes the given directories.
*
* @param directory the directory to delete
* @param directories one or more directories to delete
*/
public static void deleteDirectories(File... directory) throws FileUtilsErrorException {
for (var d : directory) {
public static void deleteDirectories(File... directories) throws FileUtilsErrorException {
for (var d : directories) {
if (d.exists()) {
FileUtils.deleteDirectory(d);
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/rife/bld/extension/BootWarOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ public BootWarOperation fromProject(Project project) throws IOException {
.infLibs(project.compileClasspathJars())
.infLibs(project.runtimeClasspathJars())
.infLibs(project.buildDistDirectory())
// TODO add provided libs
.launcherClass("org.springframework.boot.loader.WarLauncher")
.launcherLibs(project.standaloneClasspathJars())
.mainClass(project.mainClass())
Expand All @@ -116,6 +115,7 @@ public BootWarOperation fromProject(Project project) throws IOException {
new BootManifestAttribute("Main-Class", launcherClass()),
new BootManifestAttribute("Start-Class", mainClass())
))
.providedLibs(project.providedClasspathJars())
.sourceDirectories(project.buildMainDirectory(), project.srcMainResourcesDirectory());
}

Expand All @@ -133,11 +133,11 @@ public BootWarOperation providedLibs(Collection<File> jars) {
/**
* Provides the libraries that will be used for the WAR creation in {@code /WEB-INF/lib-provided}.
*
* @param jar one or more Java archive file
* @param jars one or more Java archive files
* @return this operation instance
*/
public BootWarOperation providedLibs(File... jar) {
providedLibs_.addAll(List.of(jar));
public BootWarOperation providedLibs(File... jars) {
providedLibs_.addAll(List.of(jars));
return this;
}
}

0 comments on commit 3e3d6da

Please sign in to comment.