Skip to content

Commit

Permalink
current version property including resource filtering. SQL Exec versi…
Browse files Browse the repository at this point in the history
…on command
  • Loading branch information
bosborn committed Mar 11, 2024
1 parent d7e245f commit 374dba1
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@
</profiles>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
24 changes: 24 additions & 0 deletions src/main/java/mil/nga/geopackage/io/SQLExec.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
import mil.nga.geopackage.features.user.FeatureDao;
import mil.nga.geopackage.features.user.FeatureRow;
import mil.nga.geopackage.geom.GeoPackageGeometryData;
import mil.nga.geopackage.property.GeoPackageJavaProperties;
import mil.nga.geopackage.property.JavaPropertyConstants;
import mil.nga.geopackage.srs.SpatialReferenceSystem;
import mil.nga.geopackage.tiles.matrix.TileMatrix;
import mil.nga.geopackage.tiles.reproject.TileReprojection;
Expand Down Expand Up @@ -131,6 +133,11 @@ public class SQLExec {
*/
public static final String COMMAND_HELP = "help";

/**
* Version command
*/
public static final String COMMAND_VERSION = "version";

/**
* Tables command
*/
Expand Down Expand Up @@ -571,6 +578,12 @@ private static void commandPrompt(GeoPackage database, Integer maxRows,

resetCommandPrompt(sqlBuilder);

} else if (sqlLine.equalsIgnoreCase(COMMAND_VERSION)) {

printVersion();

resetCommandPrompt(sqlBuilder);

} else if (sqlLineLower.startsWith(COMMAND_TABLES)) {

String name = sqlLine
Expand Down Expand Up @@ -1123,6 +1136,8 @@ private static void printHelp(GeoPackage database) {
+ (isGeoPackage ? "GeoPackage" : "Database") + " information");
System.out.println("\t" + COMMAND_HELP
+ " - print this help information");
System.out.println("\t" + COMMAND_VERSION
+ " - Show the SQLite Exec version");
System.out.println(
"\t" + COMMAND_COUNT + " - count database tables");
System.out.println("\t" + COMMAND_TABLES
Expand Down Expand Up @@ -1293,6 +1308,15 @@ private static void printHelp(GeoPackage database) {

}

/**
* Print the current software version
*/
private static void printVersion() {
System.out.println();
System.out.println(GeoPackageJavaProperties
.getProperty(JavaPropertyConstants.VERSION));
}

/**
* Execute the SQL
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ public class JavaPropertyConstants {

public static final String GEO_PACKAGE = "geopackage";

public static final String VERSION = GEO_PACKAGE + PROPERTY_DIVIDER
+ "version";

public static final String TILE_GENERATOR = GEO_PACKAGE + PROPERTY_DIVIDER
+ "tile_generator";

Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/geopackage-java.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

geopackage.version=${pom.version}

geopackage.tile_generator.variable.z=\\{z\\}
geopackage.tile_generator.variable.x=\\{x\\}
geopackage.tile_generator.variable.y=\\{y\\}
Expand Down

0 comments on commit 374dba1

Please sign in to comment.