Skip to content

Commit c670a72

Browse files
committed
Updates tosupport SDKMAN
1 parent 3867d77 commit c670a72

File tree

4 files changed

+154
-2
lines changed

4 files changed

+154
-2
lines changed

.gitignore

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,102 @@ buildNumber.properties
5858
out/
5959
.idea/
6060
.env
61+
62+
# Created by http://www.toptal.com/developers/gitignore/api/vim
63+
# Edit at http://www.toptal.com/developers/gitignore?templates=vim
64+
65+
### Vim ###
66+
# Swap
67+
[._]*.s[a-v][a-z]
68+
!*.svg # comment out if you don't need vector files
69+
[._]*.sw[a-p]
70+
[._]s[a-rt-v][a-z]
71+
[._]ss[a-gi-z]
72+
[._]sw[a-p]
73+
74+
# Session
75+
Session.vim
76+
Sessionx.vim
77+
78+
# Temporary
79+
.netrwhist
80+
*~
81+
# Auto-generated tag files
82+
tags
83+
# Persistent undo
84+
[._]*.un~
85+
86+
# End of http://www.toptal.com/developers/gitignore/api/vim
87+
88+
# Created by http://www.toptal.com/developers/gitignore/api/eclipse
89+
# Edit at http://www.toptal.com/developers/gitignore?templates=eclipse
90+
91+
### Eclipse ###
92+
.metadata
93+
bin/
94+
tmp/
95+
*.tmp
96+
*.bak
97+
*.swp
98+
*~.nib
99+
local.properties
100+
.settings/
101+
.loadpath
102+
.recommenders
103+
104+
# External tool builders
105+
.externalToolBuilders/
106+
107+
# Locally stored "Eclipse launch configurations"
108+
*.launch
109+
110+
# PyDev specific (Python IDE for Eclipse)
111+
*.pydevproject
112+
113+
# CDT-specific (C/C++ Development Tooling)
114+
.cproject
115+
116+
# CDT- autotools
117+
.autotools
118+
119+
# Java annotation processor (APT)
120+
.factorypath
121+
122+
# PDT-specific (PHP Development Tools)
123+
.buildpath
124+
125+
# sbteclipse plugin
126+
.target
127+
128+
# Tern plugin
129+
.tern-project
130+
131+
# TeXlipse plugin
132+
.texlipse
133+
134+
# STS (Spring Tool Suite)
135+
.springBeans
136+
137+
# Code Recommenders
138+
.recommenders/
139+
140+
# Annotation Processing
141+
.apt_generated/
142+
.apt_generated_test/
143+
144+
# Scala IDE specific (Scala & Java development for Eclipse)
145+
.cache-main
146+
.scala_dependencies
147+
.worksheet
148+
149+
# Uncomment this line if you wish to ignore the project description file.
150+
# Typically, this file would be tracked if it contains build/dependency configurations:
151+
#.project
152+
153+
### Eclipse Patch ###
154+
# Spring Boot Tooling
155+
.sts4-cache/
156+
157+
# End of http://www.toptal.com/developers/gitignore/api/eclipse
158+
.classpath
159+
.project

bin/ki

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env bash
2+
3+
if command -v java &>/dev/null; then
4+
_JAVA=java
5+
elif [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then
6+
_JAVA="$JAVA_HOME/bin/java"
7+
else
8+
echo "java not found"
9+
exit 1
10+
fi
11+
12+
if [[ "$_JAVA" ]]; then
13+
JAVA_VERSION=$("$_JAVA" -version 2>&1 | awk -F '"' '/version/ {print $2}')
14+
if [[ "$JAVA_VERSION" =~ ^1\.[0-8]+ ]]; then
15+
if [[ "$JAVA_VERSION" =~ ^1\.[0-7]+ ]]; then
16+
echo "java has version $JAVA_VERSION but at least 1.8 is required"
17+
exit 1
18+
fi
19+
else
20+
ADD_OPENS="--add-opens java.base/java.util=ALL-UNNAMED"
21+
if [[ "$JAVA_OPTS" ]]; then
22+
JAVA_OPTS="$JAVA_OPTS $ADD_OPENS"
23+
else
24+
JAVA_OPTS=$ADD_OPENS
25+
fi
26+
fi
27+
fi
28+
29+
command -v realpath &>/dev/null || realpath() {
30+
SCRIPT_PATH=$([[ $1 == /* ]] && echo "$1" || echo "$PWD/${1#./}")
31+
if [[ -L "$SCRIPT_PATH" ]]; then
32+
readlink "$SCRIPT_PATH"
33+
else
34+
echo $SCRIPT_PATH
35+
fi
36+
}
37+
38+
SCRIPT_DIR="$(dirname "$(realpath "$0")")"
39+
KI_SHELL=$SCRIPT_DIR/../lib/ki-shell.jar
40+
41+
$_JAVA $JAVA_OPTS -jar "${KI_SHELL}" $@

jreleaser.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "ki"
3-
version = "0.3.3"
3+
version = "0.4.0"
44
description = "ki shell"
55
longDescription = "Extendable Kotlin interactive shell with code completion, syntax highlighting, and other features"
66
website = "http://github.com/Kotlin/kotlin-interactive-shell"
@@ -16,6 +16,7 @@
1616
]
1717
tags = ["cli", "kotlin", "shell", "interactive"]
1818

19+
1920
[release.github]
2021
owner = "Kotlin"
2122
username = "asm0dey"
@@ -29,3 +30,10 @@
2930
tap.owner = "JetBrains"
3031
tap.name = "homebrew-utils"
3132
tap.username = "asm0dey"
33+
34+
#
35+
[packagers.sdkman]
36+
active = "ALWAYS"
37+
continueOnError = true
38+
releaseNotesUrl = "http://github.com/Kotlin/{{projectName}}/{{tagName}}"
39+
command = "MINOR"

ki-shell/src/assembly/bin.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
<format>zip</format>
66
</formats>
77
<files>
8+
<file>
9+
<source>bin/ki</source>
10+
<outputDirectory>bin</outputDirectory>
11+
</file>
812
<file>
913
<source>bin/ki.sh</source>
1014
<outputDirectory>bin</outputDirectory>
@@ -19,4 +23,4 @@
1923
</file>
2024
</files>
2125
<id>archive</id>
22-
</assembly>
26+
</assembly>

0 commit comments

Comments
 (0)