Compare commits
8 Commits
f97f4f86d3
...
8ed458b4f3
Author | SHA1 | Date | |
---|---|---|---|
8ed458b4f3 | |||
a9903b023f | |||
f1c85e0fb0 | |||
f52eb4755a | |||
a664f42f97 | |||
fd81d268c1 | |||
b0cf3a02c2 | |||
29807d7eaf |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1 +1,3 @@
|
||||
target/
|
||||
deploy/
|
||||
*.class
|
||||
|
@@ -1,4 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
set -uo pipefail
|
||||
|
||||
javac -Xlint -d target/ src/**/*.java
|
||||
if [[ $# -ge 1 && $1 == "clean" ]]; then
|
||||
rm -r target/;
|
||||
fi
|
||||
|
||||
javac -Xlint -d target/ src/**/*.java;
|
||||
|
8
zeitlaeufer/deployProject.sh
Normal file
8
zeitlaeufer/deployProject.sh
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
set -uo pipefail
|
||||
|
||||
if [[ -d deploy/ ]]; then
|
||||
rm -r deploy/;
|
||||
fi
|
||||
|
||||
cp -r target/ deploy/;
|
@@ -74,7 +74,7 @@ public abstract class AbstractLoadingBar {
|
||||
}
|
||||
|
||||
|
||||
public long getPassedMinutes() {
|
||||
public final long getPassedMinutes() {
|
||||
return getPassedMinutes(false);
|
||||
}
|
||||
|
||||
@@ -84,37 +84,37 @@ public abstract class AbstractLoadingBar {
|
||||
}
|
||||
|
||||
|
||||
public void showLoadingBar() {
|
||||
showLoadingBar(false, false, 0);
|
||||
public final void showLoadingBar() {
|
||||
realShowLoadingBar(false, false, 0);
|
||||
}
|
||||
|
||||
|
||||
public void showLoadingBar(boolean debug, boolean passedMinutesZero) {
|
||||
showLoadingBar(debug, passedMinutesZero, 100L);
|
||||
public final void showLoadingBar(boolean debug, boolean passedMinutesZero) {
|
||||
realShowLoadingBar(debug, passedMinutesZero, 100L);
|
||||
}
|
||||
|
||||
|
||||
public void showLoadingBarDebug() {
|
||||
showLoadingBar(true, true, 100L);
|
||||
public final void showLoadingBarDebug() {
|
||||
realShowLoadingBar(true, true, 100L);
|
||||
}
|
||||
|
||||
|
||||
public void showLoadingBarDebug(long millisWaiting) {
|
||||
showLoadingBar(true, true, millisWaiting);
|
||||
public final void showLoadingBarDebug(long millisWaiting) {
|
||||
realShowLoadingBar(true, true, millisWaiting);
|
||||
}
|
||||
|
||||
|
||||
public void showLoadingBarDebug(boolean passedMinutesZero) {
|
||||
showLoadingBar(true, passedMinutesZero, 100L);
|
||||
public final void showLoadingBarDebug(boolean passedMinutesZero) {
|
||||
realShowLoadingBar(true, passedMinutesZero, 100L);
|
||||
}
|
||||
|
||||
|
||||
public void showLoadingBarDebug(boolean passedMinutesZero, long millisWaiting) {
|
||||
showLoadingBar(true, passedMinutesZero, millisWaiting);
|
||||
public final void showLoadingBarDebug(boolean passedMinutesZero, long millisWaiting) {
|
||||
realShowLoadingBar(true, passedMinutesZero, millisWaiting);
|
||||
}
|
||||
|
||||
|
||||
private void showLoadingBar(boolean debug, boolean passedMinutesZero, long millisWaiting) {
|
||||
private void realShowLoadingBar(boolean debug, boolean passedMinutesZero, long millisWaiting) {
|
||||
long passedMinutes = getPassedMinutes(debug && passedMinutesZero);
|
||||
if (passedMinutes > totalMinutes) {
|
||||
passedMinutes = totalMinutes;
|
||||
@@ -129,23 +129,27 @@ public abstract class AbstractLoadingBar {
|
||||
passedMinutes++;
|
||||
}
|
||||
println(fillLoadingBar(passedMinutes, false));
|
||||
afterShowLoadingBar();
|
||||
}
|
||||
|
||||
|
||||
protected abstract String fillLoadingBar(long passedMinutes, boolean progressive);
|
||||
|
||||
|
||||
protected void waitUntilNextMinute() {
|
||||
protected void afterShowLoadingBar() {}
|
||||
|
||||
|
||||
protected final void waitUntilNextMinute() {
|
||||
waitUntilNextMinute(false, 0L);
|
||||
}
|
||||
|
||||
|
||||
protected void waitUntilNextMinuteDebug() {
|
||||
protected final void waitUntilNextMinuteDebug() {
|
||||
waitUntilNextMinute(true, 100L);
|
||||
}
|
||||
|
||||
|
||||
protected void waitUntilNextMinuteDebug(long millisWaiting) {
|
||||
protected final void waitUntilNextMinuteDebug(long millisWaiting) {
|
||||
waitUntilNextMinute(true, millisWaiting);
|
||||
}
|
||||
|
||||
|
@@ -45,14 +45,16 @@ public class SimpleLoadingBar extends AbstractProgressBar {
|
||||
} else {
|
||||
startTime = firstTime;
|
||||
}
|
||||
boolean debug = false;
|
||||
boolean passedMinutesZero = false;
|
||||
if (args.length == 2 || !title.isBlank()) {
|
||||
new SimpleLoadingBar(startTime, endTime, title).showLoadingBar();
|
||||
new SimpleLoadingBar(startTime, endTime, title).showLoadingBar(debug, passedMinutesZero);
|
||||
return;
|
||||
}
|
||||
// if there are 3 arguments, the third will be discarded.
|
||||
boolean hasTitleArg = args.length > 3 && "-msg".equals(args[2]);
|
||||
title = hasTitleArg ? args[3] : title;
|
||||
new SimpleLoadingBar(startTime, endTime, title).showLoadingBar();
|
||||
new SimpleLoadingBar(startTime, endTime, title).showLoadingBar(debug, passedMinutesZero);
|
||||
}
|
||||
|
||||
|
||||
@@ -94,9 +96,7 @@ public class SimpleLoadingBar extends AbstractProgressBar {
|
||||
|
||||
|
||||
@Override
|
||||
public void showLoadingBar() {
|
||||
super.showLoadingBar();
|
||||
// showLoadingBarDebug(); // DEBUG
|
||||
protected void afterShowLoadingBar() {
|
||||
println(title);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user