Skip to content

Commit

Permalink
chore: add latest H2 Snapshot
Browse files Browse the repository at this point in the history
- wrap the WebSwing library
- fix the Recovery CLI Unit test

Signed-off-by: Andreas Reichel <[email protected]>
  • Loading branch information
manticore-projects committed Mar 9, 2024
1 parent e7bc122 commit 7db6e9e
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 93 deletions.
5 changes: 1 addition & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ dependencies {
implementation 'org.apache.commons:commons-lang3:3.+'
implementation 'commons-cli:commons-cli:1.+'

// for checking if we run withing WebSwing
implementation 'org.webswing:webswing-api:20.2.4'

testImplementation 'org.apache.groovy:groovy:+'
testImplementation 'org.apache.groovy:groovy-sql:+'
testImplementation 'org.apache.groovy:groovy-jsr223:+'
Expand Down Expand Up @@ -142,7 +139,7 @@ tasks.register('copyH2Jars') {
// compile H2
exec {
executable "sh"
args "-c", "mvn -f ../h2database/h2 clean package -DskipTests"
args "-c", "mvn39 -f ../h2database/h2 clean package -DskipTests"
}
// copy the JARs into our resource folder
exec {
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/com/manticore/h2/H2MigrationUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,13 @@ public class H2MigrationUI extends JFrame {

private static boolean isWebSwing() {
try {
Class<?> clazz = H2MigrationUI.class.getClassLoader().loadClass("org.webswing.toolkit.api.WebswingUtil");
Method method =clazz.getMethod("isWebswing");
Class<?> clazz = H2MigrationUI.class.getClassLoader()
.loadClass("org.webswing.toolkit.api.WebswingUtil");
Method method = clazz.getMethod("isWebswing");
return (boolean) method.invoke(null);
} catch (ClassNotFoundException ex) {
} catch (ClassNotFoundException ex) {
LOGGER.log(Level.FINE, "Could not load the WebswingUtil", ex);
} catch (NoSuchMethodException |InvocationTargetException | IllegalAccessException ex) {
} catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException ex) {
LOGGER.log(Level.FINE, "Failed to call the WebswingUtil.isWebswing() method", ex);
}
return false;
Expand Down
Loading

0 comments on commit 7db6e9e

Please sign in to comment.