-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor liquify to follow new argument format.
Refactor argument parser to parse arguments in new format. Create target file name builder to create the file name based on arguments. Modify usage printer to update usage display. Add new database parameter to ConversionArguments. Modify Liquify to handle exceptions better. Modify README to reflect the project better.
- Loading branch information
Showing
6 changed files
with
159 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# liquifier | ||
|
||
Liquifier is a command-line tool to convert Liquibase changelog files | ||
between the supported file formats(xml,yaml,json,sql). | ||
|
||
Usage: | ||
|
||
liquify [-options] <source> | ||
|
||
Options: | ||
Required: | ||
-t, --type Change log file type to convert to (xml,yaml,json,sql). | ||
|
||
Optional: | ||
-db, --database Database type to use when using the sql type (i.e oracle, h2, etc). | ||
|
||
Example Usage: | ||
liquify -t sql -db oracle db.changelog.xml (creates db.changelog.oracle.sql with the oracle dialect). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 7 additions & 9 deletions
16
src/main/java/com/refactify/arguments/ConversionArgumentsParser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/main/java/com/refactify/arguments/TargetFileNameBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.refactify.arguments; | ||
|
||
public class TargetFileNameBuilder { | ||
public String buildFilename(final ConversionArguments arguments) { | ||
String fileName; | ||
String source = arguments.getSource(); | ||
String baseFileName = source.substring(0, source.lastIndexOf(".")); | ||
if(arguments.getConversionType().equals(ConversionArguments.ConversionType.SQL)) { | ||
fileName = String.format("%s.%s.%s", baseFileName, arguments.getDatabase(), | ||
arguments.getConversionType().getExtension()); | ||
} | ||
else { | ||
fileName = String.format("%s.%s", baseFileName, arguments.getConversionType().getExtension()); | ||
} | ||
return fileName; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters