Skip to content

Commit 970fb42

Browse files
authored
Kscript 4.2 (#381)
*Breaking changes* * Renamed environment variable from 'KSCRIPT_DIR' to 'KSCRIPT_DIRECTORY' *Enhancements* * New GitHub organization: http://github.com/kscripting[kscripting] * More work on Windows shell compatibility; most functionality works on Windows as on systems with bash * Change the name of the kscript package to io.github.kscripting:kscript * Final execution of the script is handled by kscript, not by bash (reduces dependency on bash) * Separate library for shell execution kscripting/shell * Ability to provide local artifacts path through *KSCRIPT_DIRECTORY_ARTIFACTS* or configuration file property: *scripting.directory.artifacts* (thanks to https://github.com/vsajip[Vsajip] for initial implementation) * kscript jar is released to Maven Central: *io.github.kscripting:kscript:4.2.0* * Change the way of checking the latest kscript version (simplifies releases) * Deprecate old annotations in the kscript-annotations library * Improved implementation: VersionChecker, ConfigBuilder etc. * Updated Gradle and dependencies * Deprecated @file:Include in favour of @file:Import as a preparation of switch to Kotlin Scripting * Replaced DocOpt with Apache CLI * Changed the way of creating distribution package - now it is handled by Gradle * Version of kscript is set by Gradle (generated BuildConfig class) * Improved DependencyResolver: aar archives are also included in the classpath * When creating an IntelliJ project, Gradle and Idea is no more required *Bugfixes* * Fixed exit code on Windows *Other* * Deprecation of "Include" in favor of "Import" * Infrastructure for publishing kscript * Updated kscript-annotations * Changed a way of building distribution of kscript * KScript version is derived from Gradle build file (BuildConfig) * Handle snapshot versions in VersionChecker * Updated Github actions * Updated start-up scripts * Additional tests, which now work on Windows. * Updated Kotlin version * Fixed REPL * Better handling of different command line options * Build target is now JVM 11 * Documentation converted to .adoc * Fixed Dockerfile * Updated docs * Updated dependencies
1 parent eb69141 commit 970fb42

File tree

127 files changed

+2782
-2876
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+2782
-2876
lines changed

.gitattributes

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
1-
# https://techblog.dorogin.com/case-of-windows-line-ending-in-bash-script-7236f056abe
2-
* text=auto
3-
*.sh text eol=lf
4-
*.bat text eol=crlf
5-
6-
7-
# Use linux file endings for kts scripts because some of them contain shebangs and are thus partially interpreted by bash
8-
*.kts text eol=lf
1+
* text eol=lf
92

3+
*.bat text eol=crlf
104

11-
# also use linux style file endings for bash scripts without sh extension
12-
kscript text eol=lf
13-
gradlew text eol=lf
14-
mydsl text eol=lf
5+
*.png binary
6+
*.jpg binary
7+
*.jar binary

.github/workflows/build.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ jobs:
2424
- os: windows-2022
2525
variant: cmd
2626
runs-on: ${{ matrix.os }}
27-
timeout-minutes: 60
27+
timeout-minutes: 30
2828

2929
steps:
3030
- name: Checkout code
31-
uses: actions/checkout@v2
31+
uses: actions/checkout@v3
3232

3333
- name: Setup Java
3434
uses: actions/setup-java@v3
@@ -39,7 +39,7 @@ jobs:
3939
- name: Setup Kotlin
4040
uses: fwilhe2/setup-kotlin@main
4141
with:
42-
version: 1.6.21
42+
version: 1.7.21
4343

4444
- name: Setup Gradle
4545
uses: gradle/gradle-build-action@v2
@@ -68,19 +68,19 @@ jobs:
6868
6969
if [[ "$OSTYPE" == "linux"* ]]; then
7070
echo "Linux test..."
71-
gradle -DosType=$OSTYPE -DincludeTags='posix | linux' integration
71+
gradle -DosType=$OSTYPE -DincludeTags='posix | linux' integrationTest
7272
elif [[ "$OSTYPE" == "darwin"* ]]; then
7373
echo "MacOs test..."
74-
gradle -DosType=$OSTYPE -DincludeTags='posix | macos' integration
74+
gradle -DosType=$OSTYPE -DincludeTags='posix | macos' integrationTest
7575
elif [[ "$OSTYPE" == "cygwin" ]]; then
7676
echo "Cygwin test..."
77-
gradle -DosType=$OSTYPE -DincludeTags='posix | cygwin' integration
77+
gradle -DosType=$OSTYPE -DincludeTags='posix | cygwin' integrationTest
7878
elif [[ "$OSTYPE" == "msys" ]]; then
7979
echo "MSys test..."
80-
gradle -DosType=$OSTYPE -DincludeTags='posix | msys' integration
80+
gradle -DosType=$OSTYPE -DincludeTags='posix | msys' integrationTest
8181
elif [[ "$OSTYPE" == "freebsd"* ]]; then
8282
echo "FreeBsd test..."
83-
gradle -DosType=$OSTYPE -DincludeTags='posix' integration
83+
gradle -DosType=$OSTYPE -DincludeTags='posix' integrationTest
8484
else
8585
echo "Unknown OS"
8686
exit 1
@@ -93,7 +93,7 @@ jobs:
9393
echo "Windows test..."
9494
gradle clean assemble test
9595
if %errorlevel% neq 0 exit /b %errorlevel%
96-
gradle -DosType=windows -DincludeTags="windows" integration
96+
gradle -DosType=windows -DincludeTags="windows" integrationTest
9797
9898
- name: Install Cygwin (only Windows)
9999
if: matrix.variant == 'cygwin'
@@ -108,4 +108,4 @@ jobs:
108108
echo "Changing directory to $GITHUB_WORKSPACE ..."
109109
cd $GITHUB_WORKSPACE
110110
gradle clean assemble test || { echo 'Compilation or Unit tests failed' ; exit 1; }
111-
gradle -DosType=$OSTYPE -DincludeTags='posix | cygwin' integration
111+
gradle -DosType=$OSTYPE -DincludeTags='posix | cygwin' integrationTest

.github/workflows/installer.yml

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
kscript_version:
77
description: 'KScript version to test'
88
required: true
9-
default: '4.0.2'
9+
default: '4.1.1'
1010

1111
jobs:
1212
build:
@@ -15,22 +15,31 @@ jobs:
1515
matrix:
1616
os:
1717
- ubuntu-20.04
18-
- macos-10.15
18+
- macos-12
1919
- windows-2022
20+
variant:
21+
- sdkman
22+
include:
23+
- os: macos-12
24+
variant: brew
25+
# - os: windows-2022
26+
# variant: sdkman-cygwin, scoop-windows
27+
28+
2029
runs-on: ${{ matrix.os }}
21-
timeout-minutes: 30
30+
timeout-minutes: 60
31+
2232
env:
2333
KSCRIPT_VERSION: ${{ github.event.inputs.kscript_version }}
2434

2535
steps:
26-
- uses: actions/checkout@v2
2736
- uses: actions/setup-java@v3
2837
with:
2938
distribution: 'zulu'
3039
java-version: '11'
3140
- uses: fwilhe2/setup-kotlin@main
3241
with:
33-
version: 1.6.21
42+
version: 1.7.21
3443

3544
- name: Prerequisites for ${{ runner.os }}
3645
shell: bash
@@ -41,36 +50,26 @@ jobs:
4150
cp /c/msys64/usr/bin/bash.exe /c/Windows/System32/bash.exe
4251
fi
4352
44-
- name: Install sdkman
53+
# for Windows by default it runs MSYS
54+
- name: Check SdkMan for ${{ runner.os }}
55+
if: matrix.variant == 'sdkman'
4556
shell: bash
4657
run: |
4758
bash -c "curl -s "https://get.sdkman.io" | bash"
4859
source "$HOME/.sdkman/bin/sdkman-init.sh"
49-
50-
- name: Test installers for ${{ runner.os }}
51-
shell: bash
52-
run: |
53-
echo "Bash path: $(which bash)"
5460
55-
# sdkman
56-
source "$HOME/.sdkman/bin/sdkman-init.sh"
5761
sdk install kscript ${{ env.KSCRIPT_VERSION }}
5862
kscript --help
5963
kscript -d "println(1+1)"
6064
sdk uninstall kscript ${{ env.KSCRIPT_VERSION }}
61-
62-
if [ "$RUNNER_OS" == "Windows" ]; then
63-
true
64-
elif [ "$RUNNER_OS" == "Linux" ]; then
65-
true
66-
elif [ "$RUNNER_OS" == "macOS" ]; then
67-
# brew
68-
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
69-
brew install holgerbrandl/tap/kscript
70-
kscript --help
71-
kscript -d "println(1+1)"
72-
brew uninstall holgerbrandl/tap/kscript
73-
else
74-
echo "Unknown OS"
75-
exit 1
76-
fi
65+
66+
- name: Check brew for ${{ runner.os }}
67+
if: matrix.variant == 'brew'
68+
shell: bash
69+
run: |
70+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
71+
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
72+
brew install kscripting/tap/kscript
73+
kscript --help
74+
kscript -d "println(1+1)"
75+
brew uninstall kscripting/tap/kscript

.github/workflows/release.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ build/
33
target/
44
out/
55

6-
# Cache of project
7-
.gradletasknamecache
8-
96
*.iml
107
.idea
118

12-
kscript.jar
9+
kscript.jar

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2020 Holger Brandl
3+
Copyright (c) 2022 Holger Brandl, Marcin Kuszczak
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)