Skip to content

Commit

Permalink
Make PomBuilder.generateInto(File) static
Browse files Browse the repository at this point in the history
  • Loading branch information
ethauvin committed Aug 16, 2023
1 parent 4924356 commit c933f16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/main/java/rife/bld/publish/PomBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,12 @@ public String build() {
*
* @since 1.7.1
*/
public void generateInto(PublishInfo info, DependencyScopes dependencies, File file)
public static void generateInto(PublishInfo info, DependencyScopes dependencies, File file)
throws FileUtilsErrorException {
info_ = info;
dependencies_ = dependencies;
FileUtils.writeString(build(), file);
var pomBuilder = new PomBuilder();
pomBuilder.info_ = info;
pomBuilder.dependencies_ = dependencies;
FileUtils.writeString(pomBuilder.build(), file);
}

private void addDependencies(Template t, Scope scope) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/rife/bld/publish/TestPomBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void testGenerateInto() throws IOException {
var deps = new DependencyScopes();
deps.scope(Scope.compile).include(new Dependency("com.uwyn.rife2", "rife2"));

new PomBuilder().generateInto(new PublishInfo().name("the thing"), deps, temp);
PomBuilder.generateInto(new PublishInfo().name("the thing"), deps, temp);

assertEquals("""
<?xml version="1.0" encoding="UTF-8"?>
Expand Down

0 comments on commit c933f16

Please sign in to comment.