Skip to content

Commit 05f7444

Browse files
committed
distribute.sh: Show correct version when building without VisiCutBuilder
Before, when building with distribute.sh without VisiCutBuilder, the window title showed a fixed fallback string for the version, and the splash screen always showed "1.7". Now, when building without VisiCutBuilder, the right version (determined from $VERSION or from git) is shown in the splash screen, and the window title simply doesn't show the version. Nothing has changed when building *with* VisiCutBuilder, which writes the version into VisicutApp.properties.
1 parent d0f2a71 commit 05f7444

11 files changed

+33
-34
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
/distribute/visicut/
1414
/distribute/VisiCut.app/
1515
/settings/
16+
/src/main/resources/de/thomas_oster/visicut/gui/resources/splash.png
1617
/*-pak
1718
# Temporary files:
1819
/distribute/wintmp/

Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ help:
1212
make run: compile and run \n\
1313
make clean: remove all compiled files\n\
1414
"
15+
# Note: If you override the splash screen version with $VERSION, you must run 'make clean' because 'make' doesn't understand the dependency on environment variables.
1516
src/main/resources/de/thomas_oster/visicut/gui/resources/splash.png: splashsource.svg src/main/resources/de/thomas_oster/visicut/gui/resources/VisicutApp.properties
1617
./generatesplash.sh
1718
jar: src/main/resources/de/thomas_oster/visicut/gui/resources/splash.png libLaserCut
@@ -24,6 +25,7 @@ libLaserCut:
2425
cd LibLaserCut && mvn install
2526
cd ..
2627
clean:
28+
rm -f src/main/resources/de/thomas_oster/visicut/gui/resources/splash.png
2729
mvn clean
2830
install:
2931
mkdir -p $(DESTDIR)$(PREFIX)/share/visicut

distribute/distribute.sh

+6-3
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,20 @@ else
1010
COMPILE=1
1111
fi
1212
echo "Determining Version (may be overriden with environment variable VERSION):"
13+
# VisiCutBuilder writes the setting in that file:
1314
VERSION=${VERSION:-$(cat ../src/main/resources/de/thomas_oster/visicut/gui/resources/VisicutApp.properties |grep Application.version)}
15+
# remove "Application.version = " prefix which comes from the VisiCutApp.properties file
1416
VERSION=${VERSION#*=}
1517
VERSION=${VERSION// /}
18+
# normally running ./distribute.sh doesn't write the above file. Then, fall back to what git describe tells us
19+
VERSION=${VERSION:-$(git describe --tags)+devel}
1620
echo "Version is: \"$VERSION\""
1721
if [ "$COMPILE" == 1 ]
1822
then
1923
echo "Building jar..."
2024
cd ..
2125
make clean > /dev/null
22-
make > /dev/null || exit 1
26+
VERSION="$VERSION" make > /dev/null || { echo "Compilation failed. Please run 'make' to see what failed."; exit 1; }
2327
cd distribute
2428
fi
2529

@@ -57,14 +61,13 @@ WINDOWS_JRE_SHA256=${WINDOWS_JRE_SHA256:-"be88c679fd24194bee71237f92f7a2a71c88f7
5761

5862
if which makensis > /dev/null
5963
then
60-
echo "Building Windows launcher and installer"
6164
mkdir -p cache
6265
echo "Downloading OpenJRE for Windows (may be overridden with WINDOWS_JRE_URL and WINDOWS_JRE_SHA256)"
6366
# download JRE if not existing or wrong file contents
6467
check_sha256 cache/jre.zip $WINDOWS_JRE_SHA256 || wget "$WINDOWS_JRE_URL" -O cache/jre.zip
6568
# check if downloaded JRE is correct (to exclude incomplete download)
6669
check_sha256 cache/jre.zip $WINDOWS_JRE_SHA256 || exit 1
67-
70+
echo "Building Windows launcher and installer"
6871
# Copy files to wintmp/
6972
rm -rf wintmp
7073
mkdir wintmp

generatesplash.sh

+9-4
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@
22
echo "Checking for rsvg..."
33
if which rsvg-convert >/dev/null 2>&1
44
then
5-
echo "found."
5+
echo "found rsvg-convert."
66
else
7-
echo "no rsvg-convert found. skipping generation of splash"
7+
echo "no rsvg-convert found. skipping generation of splash" >&2
8+
cp src/main/resources/de/thomas_oster/visicut/gui/resources/splash{-fallback,}.png
89
exit
910
fi
10-
echo "Determining Version..."
11-
VERSION=$(cat src/main/resources/de/thomas_oster/visicut/gui/resources/VisicutApp.properties |grep Application.version|cut -d'=' -f2|tr -d ' ')
11+
echo "Determining Version (may be overridden with environment variable VERSION)"
12+
cd "$(dirname $0)"
13+
VERSION=${VERSION:-$(cat ./src/main/resources/de/thomas_oster/visicut/gui/resources/VisicutApp.properties |grep Application.version)}
14+
VERSION=${VERSION#*=}
15+
VERSION=${VERSION// /}
16+
echo "Version is: \"$VERSION\""
1217
echo "Version is: $VERSION"
1318
echo "Generating SVG"
1419
cat splashsource.svg|sed s#insert#$VERSION#g# > splash.svg

splashsource.svg

+11-23
Loading

src/main/resources/de/thomas_oster/visicut/gui/resources/VisicutApp.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Application.name = VisiCut
44
Application.title = VisiCut
5-
Application.version = 1.9
5+
Application.version =
66
Application.vendor = <html>Thomas Oster, Media Computing Group<br>RWTH Aachen University<br>[email protected]</html>
77
Application.homepage = <html><a href="https://visicut.org">https://visicut.org</a></html>
88
Application.description = A Java Desktop Application for Lasercutting

src/main/resources/de/thomas_oster/visicut/gui/resources/VisicutApp_de_DE.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Application.name = VisiCut
44
Application.title = VisiCut
5-
Application.version = 1.7
5+
Application.version =
66
Application.vendor = <html>Thomas Oster, Media Computing Group<br>RWTH Aachen University<br>[email protected]</html>
77
Application.homepage = <html><a href="http://hci.rwth-aachen.de/visicut">http://hci.rwth-aachen.de/visicut</a></html>
88
Application.description = Eine Java Arbeitsfl\u00e4chenanwendung zum Lasercutten

src/main/resources/de/thomas_oster/visicut/gui/resources/VisicutApp_fr_FR.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Application.name = VisiCut
44
Application.title = VisiCut
5-
Application.version = 1.7
5+
Application.version =
66
Application.vendor = <html>Thomas Oster, Media Computing Group<br>RWTH Aachen University<br>[email protected]</html>
77
Application.homepage = <html><a href="http://hci.rwth-aachen.de/visicut">http://hci.rwth-aachen.de/visicut</a></html>
88
Application.description = Une Application Java de Bureau pour D\u00e9coupe Laser

src/main/resources/de/thomas_oster/visicut/gui/resources/VisicutApp_it_IT.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Application.name = VisiCut
44
Application.title = VisiCut
5-
Application.version = 1.7
5+
Application.version =
66
Application.vendor = <html>Thomas Oster, Media Computing Group<br>RWTH Aachen University<br>[email protected]</html>
77
Application.homepage = <html><a href="http://hci.rwth-aachen.de/visicut">http://hci.rwth-aachen.de/visicut</a></html>
88
Application.description = A Java Desktop Application for Lasercutting
Loading
Binary file not shown.

0 commit comments

Comments
 (0)