# HG changeset patch # User František Kučera # Date 1387222747 -3600 # Node ID 7900bb1666f602a4ba5580cc3f4dc563f360d1cf # Parent d8ab8aece6f2f6bac6f7d4ca8ab4972f59f55954 version info: option --version diff -r d8ab8aece6f2 -r 7900bb1666f6 .hgignore --- a/.hgignore Mon Dec 16 20:20:54 2013 +0100 +++ b/.hgignore Mon Dec 16 20:39:07 2013 +0100 @@ -5,3 +5,5 @@ java/sql-dk/dist/ java/sql-dk/build/ java/sql-dk/nbproject/private/ + +java/sql-dk/data/info/globalcode/sql/dk/version.txt diff -r d8ab8aece6f2 -r 7900bb1666f6 java/sql-dk/build.xml --- a/java/sql-dk/build.xml Mon Dec 16 20:20:54 2013 +0100 +++ b/java/sql-dk/build.xml Mon Dec 16 20:39:07 2013 +0100 @@ -70,5 +70,10 @@ properties which you can use, check the target you are overriding in the nbproject/build-impl.xml file. - --> + --> + + + + + diff -r d8ab8aece6f2 -r 7900bb1666f6 java/sql-dk/data/info/globalcode/sql/dk/license.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/sql-dk/data/info/globalcode/sql/dk/license.txt Mon Dec 16 20:39:07 2013 +0100 @@ -0,0 +1,1 @@ +../../../../../../../license/gpl.txt \ No newline at end of file diff -r d8ab8aece6f2 -r 7900bb1666f6 java/sql-dk/nbproject/build-impl.xml --- a/java/sql-dk/nbproject/build-impl.xml Mon Dec 16 20:20:54 2013 +0100 +++ b/java/sql-dk/nbproject/build-impl.xml Mon Dec 16 20:39:07 2013 +0100 @@ -141,6 +141,7 @@ + @@ -229,6 +230,7 @@ Must set src.dir + Must set src.data.dir Must set test.src.dir Must set build.dir Must set dist.dir @@ -250,7 +252,7 @@ - + @@ -290,7 +292,7 @@ - + @@ -322,7 +324,7 @@ - + @@ -920,12 +922,13 @@ - + + @@ -946,7 +949,7 @@ Must select some files in the IDE or set javac.includes - + @@ -1210,6 +1213,9 @@ + + + @@ -1220,6 +1226,9 @@ + + + diff -r d8ab8aece6f2 -r 7900bb1666f6 java/sql-dk/nbproject/genfiles.properties --- a/java/sql-dk/nbproject/genfiles.properties Mon Dec 16 20:20:54 2013 +0100 +++ b/java/sql-dk/nbproject/genfiles.properties Mon Dec 16 20:39:07 2013 +0100 @@ -1,8 +1,8 @@ -build.xml.data.CRC32=c64bb3a1 +build.xml.data.CRC32=b51b939b build.xml.script.CRC32=f55b3340 build.xml.stylesheet.CRC32=28e38971@1.56.1.46 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=c64bb3a1 -nbproject/build-impl.xml.script.CRC32=4453928c +nbproject/build-impl.xml.data.CRC32=b51b939b +nbproject/build-impl.xml.script.CRC32=53c1d5ab nbproject/build-impl.xml.stylesheet.CRC32=c6d2a60f@1.56.1.46 diff -r d8ab8aece6f2 -r 7900bb1666f6 java/sql-dk/nbproject/project.properties --- a/java/sql-dk/nbproject/project.properties Mon Dec 16 20:20:54 2013 +0100 +++ b/java/sql-dk/nbproject/project.properties Mon Dec 16 20:39:07 2013 +0100 @@ -1,9 +1,10 @@ annotation.processing.enabled=true annotation.processing.enabled.in.editor=false -annotation.processing.processor.options= annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=sql-dk +application.vendor=fiki build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: @@ -24,6 +25,7 @@ dist.dir=dist dist.jar=${dist.dir}/sql-dk.jar dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= excludes= includes=** jar.compress=false @@ -68,5 +70,6 @@ ${javac.test.classpath}:\ ${build.test.classes.dir} source.encoding=UTF-8 +src.data.dir=data src.dir=src test.src.dir=test diff -r d8ab8aece6f2 -r 7900bb1666f6 java/sql-dk/nbproject/project.xml --- a/java/sql-dk/nbproject/project.xml Mon Dec 16 20:20:54 2013 +0100 +++ b/java/sql-dk/nbproject/project.xml Mon Dec 16 20:39:07 2013 +0100 @@ -6,6 +6,7 @@ sql-dk + diff -r d8ab8aece6f2 -r 7900bb1666f6 java/sql-dk/src/info/globalcode/sql/dk/Constants.java --- a/java/sql-dk/src/info/globalcode/sql/dk/Constants.java Mon Dec 16 20:20:54 2013 +0100 +++ b/java/sql-dk/src/info/globalcode/sql/dk/Constants.java Mon Dec 16 20:39:07 2013 +0100 @@ -24,6 +24,8 @@ public class Constants { public static final String WEBSITE = "https://sql-dk.globalcode.info/"; + public static final String LICENSE_FILE = "info/globalcode/sql/dk/license.txt"; + public static final String VERSION_FILE = "info/globalcode/sql/dk/version.txt"; private Constants() { } diff -r d8ab8aece6f2 -r 7900bb1666f6 java/sql-dk/src/info/globalcode/sql/dk/InfoLister.java --- a/java/sql-dk/src/info/globalcode/sql/dk/InfoLister.java Mon Dec 16 20:20:54 2013 +0100 +++ b/java/sql-dk/src/info/globalcode/sql/dk/InfoLister.java Mon Dec 16 20:39:07 2013 +0100 @@ -52,13 +52,13 @@ println("TODO: show some help"); break; case LICENSE: - printLicense(); + printResource(Constants.LICENSE_FILE); break; case TYPES: println("TODO: list supported types"); break; case VERSION: - println("TODO: show version"); + printResource(Constants.VERSION_FILE); break; case DATABASES: println("TODO: list databases"); @@ -72,10 +72,10 @@ } } - private void printLicense() { - try (BufferedReader license = new BufferedReader(new InputStreamReader(getClass().getClassLoader().getResourceAsStream("info/globalcode/sql/dk/license.txt")))) { + private void printResource(String fileName) { + try (BufferedReader reader = new BufferedReader(new InputStreamReader(getClass().getClassLoader().getResourceAsStream(fileName)))) { while (true) { - String line = license.readLine(); + String line = reader.readLine(); if (line == null) { break; } else { @@ -83,7 +83,7 @@ } } } catch (Exception e) { - log.log(Level.SEVERE, "Unable to print license. See our website for license information.", e); + log.log(Level.SEVERE, "Unable to print this info. Please see our website for it: " + Constants.WEBSITE, e); } } diff -r d8ab8aece6f2 -r 7900bb1666f6 java/sql-dk/src/info/globalcode/sql/dk/license.txt --- a/java/sql-dk/src/info/globalcode/sql/dk/license.txt Mon Dec 16 20:20:54 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../../../../../../../license/gpl.txt \ No newline at end of file diff -r d8ab8aece6f2 -r 7900bb1666f6 java/sql-dk/version-info.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/sql-dk/version-info.sh Mon Dec 16 20:39:07 2013 +0100 @@ -0,0 +1,5 @@ +#!/bin/bash + +echo -n "Mercurial: "; hg identify || echo "n/a"; +echo -n "Compiled: "; date --rfc-3339=seconds; +