Compare commits
1 Commits
v1.0.1
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
206d70766b |
@@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "terminal-ui",
|
|
||||||
"image": "mcr.microsoft.com/devcontainers/java:1-21-bookworm",
|
|
||||||
"features": {
|
|
||||||
"ghcr.io/devcontainers/features/java:1": {
|
|
||||||
"version": "21",
|
|
||||||
"installGradle": "true",
|
|
||||||
"installMaven": "false"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"postCreateCommand": "java -version && ./gradlew --version",
|
|
||||||
"customizations": {
|
|
||||||
"vscode": {
|
|
||||||
"extensions": [
|
|
||||||
"vscjava.vscode-java-pack",
|
|
||||||
"vscjava.vscode-gradle"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# EditorConfig: consistent style across editors
|
|
||||||
# https://editorconfig.org
|
|
||||||
|
|
||||||
root = true
|
|
||||||
|
|
||||||
[*]
|
|
||||||
charset = utf-8
|
|
||||||
end_of_line = lf
|
|
||||||
insert_final_newline = true
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
|
|
||||||
[*.{java,kts}]
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 4
|
|
||||||
|
|
||||||
[*.{yml,yaml,md,json}]
|
|
||||||
indent_size = 2
|
|
||||||
|
|
||||||
[*.bat]
|
|
||||||
end_of_line = crlf
|
|
||||||
9
.gitattributes
vendored
9
.gitattributes
vendored
@@ -1,9 +0,0 @@
|
|||||||
# Normalize line endings
|
|
||||||
* text=auto eol=lf
|
|
||||||
*.bat text eol=crlf
|
|
||||||
*.cmd text eol=crlf
|
|
||||||
|
|
||||||
# GitHub linguist: don't count these as language
|
|
||||||
gradle/wrapper/gradle-wrapper.jar binary
|
|
||||||
*.jar binary
|
|
||||||
*.zip binary
|
|
||||||
27
.github/release-drafter.yml
vendored
27
.github/release-drafter.yml
vendored
@@ -1,27 +0,0 @@
|
|||||||
# Config for release-drafter v6: categorizes PRs in draft release notes
|
|
||||||
# https://github.com/release-drafter/release-drafter
|
|
||||||
|
|
||||||
template: |
|
|
||||||
## What's Changed
|
|
||||||
|
|
||||||
$CHANGES
|
|
||||||
|
|
||||||
**Full Changelog**: https://github.com/jakubbbdev/terminal-ui/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
|
|
||||||
|
|
||||||
name-template: 'v$RESOLVED_VERSION'
|
|
||||||
tag-template: 'v$RESOLVED_VERSION'
|
|
||||||
|
|
||||||
categories:
|
|
||||||
- title: '🚀 Features'
|
|
||||||
labels: [feature, enhancement]
|
|
||||||
- title: '🐛 Bug Fixes'
|
|
||||||
labels: [bug, fix]
|
|
||||||
- title: '📚 Documentation'
|
|
||||||
labels: [documentation]
|
|
||||||
- title: '⬆️ Dependencies'
|
|
||||||
labels: [dependencies]
|
|
||||||
- title: 'Other'
|
|
||||||
labels: ['*']
|
|
||||||
|
|
||||||
exclude-labels:
|
|
||||||
- skip-changelog
|
|
||||||
7
.github/workflows/codeql.yml
vendored
7
.github/workflows/codeql.yml
vendored
@@ -21,13 +21,6 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up JDK 21
|
|
||||||
uses: actions/setup-java@v4
|
|
||||||
with:
|
|
||||||
distribution: temurin
|
|
||||||
java-version: 21
|
|
||||||
cache: gradle
|
|
||||||
|
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v3
|
uses: github/codeql-action/init@v3
|
||||||
with:
|
with:
|
||||||
|
|||||||
22
.github/workflows/release-drafter.yml
vendored
22
.github/workflows/release-drafter.yml
vendored
@@ -1,22 +0,0 @@
|
|||||||
# Drafts release notes from merged PRs when you create a release.
|
|
||||||
# Install: add a Release Drafter config (see below), then create a release on GitHub;
|
|
||||||
# this workflow will update the draft with categorized PRs.
|
|
||||||
name: Release Drafter
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main, master]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
update_release_draft:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Draft Release
|
|
||||||
uses: release-drafter/release-drafter@v6
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
13
.github/workflows/release.yml
vendored
13
.github/workflows/release.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
# On push of a version tag (e.g. v1.0.0): build, publish to GitHub Packages, create Release, upload JARs.
|
# On push of a version tag (e.g. v1.0.0): build, create GitHub Release, upload JARs.
|
||||||
name: Release
|
name: Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
@@ -8,13 +8,10 @@ on:
|
|||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
packages: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
|
||||||
RELEASE_VERSION: ${{ github.ref_name }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -26,13 +23,7 @@ jobs:
|
|||||||
java-version: 21
|
java-version: 21
|
||||||
cache: gradle
|
cache: gradle
|
||||||
|
|
||||||
- name: Strip v from version
|
- run: chmod +x gradlew && ./gradlew build --no-daemon
|
||||||
run: echo "RELEASE_VERSION=${RELEASE_VERSION#v}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Build and publish to GitHub Packages
|
|
||||||
run: chmod +x gradlew && ./gradlew build publish --no-daemon
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
|
|||||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -4,7 +4,7 @@
|
|||||||
<component name="FrameworkDetectionExcludesConfiguration">
|
<component name="FrameworkDetectionExcludesConfiguration">
|
||||||
<file type="web" url="file://$PROJECT_DIR$" />
|
<file type="web" url="file://$PROJECT_DIR$" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="corretto-21" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="corretto-21" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
60
README.md
60
README.md
@@ -3,54 +3,6 @@
|
|||||||
Java library for terminal UI: tables, rules, colors, prompts, menus, SelectList, pager, and more. Fluent API, ANSI support, testable.
|
Java library for terminal UI: tables, rules, colors, prompts, menus, SelectList, pager, and more. Fluent API, ANSI support, testable.
|
||||||
|
|
||||||
[](https://github.com/jakubbbdev/terminal-ui/actions/workflows/ci.yml)
|
[](https://github.com/jakubbbdev/terminal-ui/actions/workflows/ci.yml)
|
||||||
[](https://openjdk.org/)
|
|
||||||
[](LICENSE)
|
|
||||||
|
|
||||||
[](https://codespaces.new/jakubbbdev/terminal-ui)
|
|
||||||
|
|
||||||
## Install
|
|
||||||
|
|
||||||
Published to [GitHub Packages](https://github.com/jakubbbdev/terminal-ui/packages). Replace `VERSION` with a [release](https://github.com/jakubbbdev/terminal-ui/releases) tag (e.g. `1.0.0`).
|
|
||||||
|
|
||||||
**Gradle (Kotlin DSL):**
|
|
||||||
|
|
||||||
```kotlin
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
maven { url = uri("https://maven.pkg.github.com/jakubbbdev/terminal-ui") }
|
|
||||||
}
|
|
||||||
dependencies {
|
|
||||||
implementation("dev.jakub.terminal:terminal-ui:VERSION")
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Gradle (Groovy):**
|
|
||||||
|
|
||||||
```groovy
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
maven { url "https://maven.pkg.github.com/jakubbbdev/terminal-ui" }
|
|
||||||
}
|
|
||||||
dependencies {
|
|
||||||
implementation "dev.jakub.terminal:terminal-ui:VERSION"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Maven:**
|
|
||||||
|
|
||||||
```xml
|
|
||||||
<repository>
|
|
||||||
<id>github</id>
|
|
||||||
<url>https://maven.pkg.github.com/jakubbbdev/terminal-ui</url>
|
|
||||||
</repository>
|
|
||||||
<dependency>
|
|
||||||
<groupId>dev.jakub.terminal</groupId>
|
|
||||||
<artifactId>terminal-ui</artifactId>
|
|
||||||
<version>VERSION</version>
|
|
||||||
</dependency>
|
|
||||||
```
|
|
||||||
|
|
||||||
For public packages, read access usually works without credentials. If your tool asks for auth, use a [GitHub PAT](https://github.com/settings/tokens) with `read:packages` as username and the token as password.
|
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
@@ -69,6 +21,18 @@ Run tests:
|
|||||||
./gradlew test
|
./gradlew test
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Demo (non-interactive):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./gradlew run
|
||||||
|
```
|
||||||
|
|
||||||
|
Interactive demo (best run in a real terminal):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./gradlew runDemo2
|
||||||
|
```
|
||||||
|
|
||||||
## Usage (excerpt)
|
## Usage (excerpt)
|
||||||
|
|
||||||
```java
|
```java
|
||||||
|
|||||||
11
SECURITY.md
11
SECURITY.md
@@ -1,11 +0,0 @@
|
|||||||
# Security
|
|
||||||
|
|
||||||
## Reporting a vulnerability
|
|
||||||
|
|
||||||
If you find a security issue, please report it responsibly:
|
|
||||||
|
|
||||||
1. **Do not** open a public issue.
|
|
||||||
2. Email the maintainers or report via [GitHub Security Advisories](https://github.com/jakubbbdev/terminal-ui/security/advisories/new) (if enabled).
|
|
||||||
3. Give a clear description and steps to reproduce; we’ll respond as soon as we can.
|
|
||||||
|
|
||||||
Thank you for helping keep this project safe.
|
|
||||||
@@ -2,15 +2,15 @@ plugins {
|
|||||||
id("java")
|
id("java")
|
||||||
id("java-library")
|
id("java-library")
|
||||||
id("application")
|
id("application")
|
||||||
id("maven-publish")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.named<JavaExec>("run") {
|
tasks.named<JavaExec>("run") {
|
||||||
jvmArgs("-Ddev.jakub.terminal.ansi=true", "-Dfile.encoding=UTF-8")
|
jvmArgs("-Ddev.jakub.terminal.ansi=true", "-Dfile.encoding=UTF-8")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
group = "dev.jakub.terminal"
|
group = "dev.jakub.terminal"
|
||||||
version = System.getenv("RELEASE_VERSION") ?: "1.0-SNAPSHOT"
|
version = "1.0-SNAPSHOT"
|
||||||
|
|
||||||
java {
|
java {
|
||||||
sourceCompatibility = JavaVersion.VERSION_21
|
sourceCompatibility = JavaVersion.VERSION_21
|
||||||
@@ -29,25 +29,4 @@ dependencies {
|
|||||||
|
|
||||||
tasks.test {
|
tasks.test {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
|
||||||
|
|
||||||
publishing {
|
|
||||||
publications {
|
|
||||||
create<MavenPublication>("maven") {
|
|
||||||
groupId = project.group.toString()
|
|
||||||
artifactId = "terminal-ui"
|
|
||||||
version = project.version.toString()
|
|
||||||
from(components["java"])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
repositories {
|
|
||||||
maven {
|
|
||||||
name = "GitHubPackages"
|
|
||||||
url = uri("https://maven.pkg.github.com/jakubbbdev/terminal-ui")
|
|
||||||
credentials {
|
|
||||||
username = System.getenv("GITHUB_ACTOR") ?: project.findProperty("gpr.user")?.toString()
|
|
||||||
password = System.getenv("GITHUB_TOKEN") ?: project.findProperty("gpr.token")?.toString()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
|||||||
#Fri Mar 13 15:14:45 CET 2026
|
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
|
||||||
|
networkTimeout=10000
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
50
gradlew
vendored
Normal file → Executable file
50
gradlew
vendored
Normal file → Executable file
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright © 2015-2021 the original authors.
|
# Copyright © 2015 the original authors.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
@@ -15,6 +15,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
@@ -55,7 +57,7 @@
|
|||||||
# Darwin, MinGW, and NonStop.
|
# Darwin, MinGW, and NonStop.
|
||||||
#
|
#
|
||||||
# (3) This script is generated from the Groovy template
|
# (3) This script is generated from the Groovy template
|
||||||
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
# within the Gradle project.
|
# within the Gradle project.
|
||||||
#
|
#
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
@@ -80,13 +82,11 @@ do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
# This is normally unused
|
||||||
|
# shellcheck disable=SC2034
|
||||||
APP_NAME="Gradle"
|
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
@@ -114,7 +114,6 @@ case "$( uname )" in #(
|
|||||||
NONSTOP* ) nonstop=true ;;
|
NONSTOP* ) nonstop=true ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
@@ -133,22 +132,29 @@ location of your Java installation."
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
JAVACMD=java
|
JAVACMD=java
|
||||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
if ! command -v java >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
Please set the JAVA_HOME variable in your environment to match the
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
location of your Java installation."
|
location of your Java installation."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Increase the maximum file descriptors if we can.
|
# Increase the maximum file descriptors if we can.
|
||||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC2039,SC3045
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC2039,SC3045
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
@@ -165,7 +171,6 @@ fi
|
|||||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
if "$cygwin" || "$msys" ; then
|
if "$cygwin" || "$msys" ; then
|
||||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
|
||||||
|
|
||||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||||
|
|
||||||
@@ -193,18 +198,27 @@ if "$cygwin" || "$msys" ; then
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Collect all arguments for the java command;
|
|
||||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
# shell script including quotes and variable substitutions, so put them in
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
# double quotes to make sure that they get re-expanded; and
|
|
||||||
# * put everything else in single quotes, so that it's not re-expanded.
|
# Collect all arguments for the java command:
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
|
# and any embedded shellness will be escaped.
|
||||||
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
-classpath "$CLASSPATH" \
|
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||||
org.gradle.wrapper.GradleWrapperMain \
|
|
||||||
"$@"
|
"$@"
|
||||||
|
|
||||||
|
# Stop when "xargs" is not available.
|
||||||
|
if ! command -v xargs >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "xargs is not available"
|
||||||
|
fi
|
||||||
|
|
||||||
# Use "xargs" to parse quoted args.
|
# Use "xargs" to parse quoted args.
|
||||||
#
|
#
|
||||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||||
|
|||||||
182
gradlew.bat
vendored
182
gradlew.bat
vendored
@@ -1,89 +1,93 @@
|
|||||||
@rem
|
@rem
|
||||||
@rem Copyright 2015 the original author or authors.
|
@rem Copyright 2015 the original author or authors.
|
||||||
@rem
|
@rem
|
||||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@rem you may not use this file except in compliance with the License.
|
@rem you may not use this file except in compliance with the License.
|
||||||
@rem You may obtain a copy of the License at
|
@rem You may obtain a copy of the License at
|
||||||
@rem
|
@rem
|
||||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||||
@rem
|
@rem
|
||||||
@rem Unless required by applicable law or agreed to in writing, software
|
@rem Unless required by applicable law or agreed to in writing, software
|
||||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
@rem See the License for the specific language governing permissions and
|
@rem See the License for the specific language governing permissions and
|
||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
|
@rem SPDX-License-Identifier: Apache-2.0
|
||||||
@if "%DEBUG%" == "" @echo off
|
@rem
|
||||||
@rem ##########################################################################
|
|
||||||
@rem
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem Gradle startup script for Windows
|
@rem ##########################################################################
|
||||||
@rem
|
@rem
|
||||||
@rem ##########################################################################
|
@rem Gradle startup script for Windows
|
||||||
|
@rem
|
||||||
@rem Set local scope for the variables with windows NT shell
|
@rem ##########################################################################
|
||||||
if "%OS%"=="Windows_NT" setlocal
|
|
||||||
|
@rem Set local scope for the variables with windows NT shell
|
||||||
set DIRNAME=%~dp0
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
if "%DIRNAME%" == "" set DIRNAME=.
|
|
||||||
set APP_BASE_NAME=%~n0
|
set DIRNAME=%~dp0
|
||||||
set APP_HOME=%DIRNAME%
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
|
@rem This is normally unused
|
||||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
set APP_BASE_NAME=%~n0
|
||||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||||
|
|
||||||
@rem Find java.exe
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||||
|
|
||||||
set JAVA_EXE=java.exe
|
@rem Find java.exe
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
if "%ERRORLEVEL%" == "0" goto execute
|
|
||||||
|
set JAVA_EXE=java.exe
|
||||||
echo.
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
echo.
|
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo. 1>&2
|
||||||
echo location of your Java installation.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||||
|
echo. 1>&2
|
||||||
goto fail
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
|
echo location of your Java installation. 1>&2
|
||||||
:findJavaFromJavaHome
|
|
||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
goto fail
|
||||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|
||||||
|
:findJavaFromJavaHome
|
||||||
if exist "%JAVA_EXE%" goto execute
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
echo.
|
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
if exist "%JAVA_EXE%" goto execute
|
||||||
echo.
|
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo. 1>&2
|
||||||
echo location of your Java installation.
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||||
|
echo. 1>&2
|
||||||
goto fail
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
|
echo location of your Java installation. 1>&2
|
||||||
:execute
|
|
||||||
@rem Setup the command line
|
goto fail
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
:execute
|
||||||
|
@rem Setup the command line
|
||||||
|
|
||||||
@rem Execute Gradle
|
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
|
||||||
|
@rem Execute Gradle
|
||||||
:end
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||||
@rem End local scope for the variables with windows NT shell
|
|
||||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
:end
|
||||||
|
@rem End local scope for the variables with windows NT shell
|
||||||
:fail
|
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
||||||
rem the _cmd.exe /c_ return code!
|
:fail
|
||||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
exit /b 1
|
rem the _cmd.exe /c_ return code!
|
||||||
|
set EXIT_CODE=%ERRORLEVEL%
|
||||||
:mainEnd
|
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||||
|
exit /b %EXIT_CODE%
|
||||||
:omega
|
|
||||||
|
:mainEnd
|
||||||
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|
||||||
|
:omega
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public final class Confirm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Uses the given scanner for one line. Use when sharing one scanner (e.g. interactive app).
|
* Uses the given scanner for one line. Use when sharing one scanner (e.g. demo).
|
||||||
*/
|
*/
|
||||||
public boolean ask(Scanner sharedScanner) {
|
public boolean ask(Scanner sharedScanner) {
|
||||||
if (sharedScanner == null) return ask();
|
if (sharedScanner == null) return ask();
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public final class Prompt {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Prompts and returns the next line from the given scanner. Use this when
|
* Prompts and returns the next line from the given scanner. Use this when
|
||||||
* sharing one scanner (e.g. in an interactive app) so input blocks correctly.
|
* sharing one scanner (e.g. in a demo) so input blocks correctly.
|
||||||
*/
|
*/
|
||||||
public String ask(Scanner sharedScanner) {
|
public String ask(Scanner sharedScanner) {
|
||||||
if (sharedScanner == null) return ask();
|
if (sharedScanner == null) return ask();
|
||||||
|
|||||||
Reference in New Issue
Block a user