Skip to content

Commit

Permalink
Kscript 4.1 (#354)
Browse files Browse the repository at this point in the history
* Cleanup of env variables
* Fixed indentation and generation of Gradle files for IntelliJ
* Re-enabled idea tests
* Improved runConfiguration
* Support for idea project creation: correct handling for duplicated file names.
* IntelliJ support fixed
* Formatting of wrapper for scripts.
* Fix for OsType comparison logic (#357)
* build: installation tester
* build: update installer.yml
* build: added ability to start GitHub action build manually.
* bugfix: fix for OSTYPE linux-musl which is reported on Alpine Linux.
* make KOTLIN_HOME required
* feature: osHandler for operations outside of Java ecosystem
* feature: added nicer debug information
* refactor: split of config to smaller pieces
* test: split building and cleaning (faster builds for most cases)
* cleanup: overall cleanups
* feature: Migrated kscript to os independent paths (OsPath)
* feature: KScript seems to work on a plain Windows console.
* Fix #335: Get --package working with Gradle 7 by replacing the capsule plugin (#370)
* Fix #335: Remove the need for the  Gradle capsule plugin.
* Additional fixes for packaging (better cache support)
* Improved Templates.kt
* Added Kotlin integration tests for packaging and simple tests
* Added suites for different OSes
* Renamed MAC to MACOS constant.
* Fixed error in StreamGobbler in ProcessRunner
* Added empty source case handling
* Better implementation of OsPath.leaf and OsPath.root
* Added integration tests
* Improved testing tools (matchers)
* Cleanup, bug fixes and small improvements.
* Removed old test suite in bash
* Updated TestsReadme.md
* Replace .kscript dir with OS-specific dirs (#323) (#374)
* Refactoring to allow deprecation.
* Deprecation of old features (annotations based on comments)
* Deprecation report
* Updated doc.

Co-authored-by: holgerbrandl@gmail.com <holgerbrandl@users.noreply.github.com>
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
Co-authored-by: meztihn <6940823+meztihn@users.noreply.github.com
  • Loading branch information
3 people authored Aug 26, 2022
1 parent 30f994b commit ae3ae84
Show file tree
Hide file tree
Showing 120 changed files with 3,872 additions and 1,630 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# https://techblog.dorogin.com/case-of-windows-line-ending-in-bash-script-7236f056abe
* text=auto
*.sh text eol=lf
*.bat text eol=crlf


# Use linux file endings for kts scripts because some of them contain shebangs and are thus partially interpreted by bash
Expand All @@ -11,4 +12,3 @@
kscript text eol=lf
gradlew text eol=lf
mydsl text eol=lf

93 changes: 60 additions & 33 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,71 +14,98 @@ jobs:
matrix:
os:
- ubuntu-20.04
- macos-10.15
- macos-12
- windows-2022
variant:
- posix
include:
- os: windows-2022
variant: cygwin
- os: windows-2022
variant: cmd
runs-on: ${{ matrix.os }}
timeout-minutes: 30
timeout-minutes: 60

steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v3
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- uses: fwilhe2/setup-kotlin@main

- name: Setup Kotlin
uses: fwilhe2/setup-kotlin@main
with:
version: 1.6.21

- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-version: wrapper

- name: Install dependencies for ${{ runner.os }}
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
choco install zip
# Overwrite the WSL bash.exe
cp /c/msys64/usr/bin/bash.exe /c/Windows/System32/bash.exe
# cp /c/msys64/usr/bin/bash.exe /c/Windows/System32/bash.exe
mv /c/Windows/System32/bash.exe /c/Windows/System32/wsl-bash.exe
fi
- name: Run tests
timeout-minutes: 10
- name: Run tests for Posix (and MSYS on Windows)
if: matrix.variant == 'posix'
shell: bash
run: |
# For Windows this action is running MSYS Os type
echo "OsType: $OSTYPE"
export PATH=./build/libs:${PATH}
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
gradle clean assemble test || { echo 'Compilation or Unit tests failed' ; exit 1; }
if [[ "$OSTYPE" == "linux"* ]]; then
echo "Linux test..."
./test/test_suite.sh
gradle -DosType=$OSTYPE -DincludeTags='posix | linux' integration
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "MacOs test..."
./gradlew clean build
echo "kscript path: $(which kscript)"
kscript --help
kscript -d "println(1+1)"
gradle -DosType=$OSTYPE -DincludeTags='posix | macos' integration
elif [[ "$OSTYPE" == "cygwin" ]]; then
echo "Cygwin test..."
./gradlew clean build
echo "kscript path: $(which kscript)"
kscript --help
kscript -d "println(1+1)"
gradle -DosType=$OSTYPE -DincludeTags='posix | cygwin' integration
elif [[ "$OSTYPE" == "msys" ]]; then
echo "MSys test..."
./gradlew clean build
echo "kscript path: $(which kscript)"
kscript --help
kscript -d "println(1+1)"
elif [[ "$OSTYPE" == "win32" ]]; then
echo "Windows test..."
./gradlew clean build
echo "kscript path: $(which kscript)"
kscript --help
kscript -d "println(1+1)"
gradle -DosType=$OSTYPE -DincludeTags='posix | msys' integration
elif [[ "$OSTYPE" == "freebsd"* ]]; then
echo "FreeBsd test..."
./gradlew clean build
echo "kscript path: $(which kscript)"
kscript --help
kscript -d "println(1+1)"
gradle -DosType=$OSTYPE -DincludeTags='posix' integration
else
echo "Unknown OS"
exit 1
fi
- name: Run tests specific for Windows (cmd shell)
if: matrix.variant == 'cmd'
shell: cmd
run: |
echo "Windows test..."
gradle clean assemble test
if %errorlevel% neq 0 exit /b %errorlevel%
gradle -DosType=windows -DincludeTags="windows" integration
- name: Install Cygwin (only Windows)
if: matrix.variant == 'cygwin'
uses: egor-tensin/setup-cygwin@v3

- name: Run tests specific for Cygwin
if: matrix.variant == 'cygwin'
shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
run: |
echo $OSTYPE
echo "Cygwin test..."
echo "Changing directory to $GITHUB_WORKSPACE ..."
cd $GITHUB_WORKSPACE
gradle clean assemble test || { echo 'Compilation or Unit tests failed' ; exit 1; }
gradle -DosType=$OSTYPE -DincludeTags='posix | cygwin' integration
7 changes: 3 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Created with https://github.com/marketplace/actions/create-a-release

name: release

on:
push:
# Sequence of patterns matched against refs/tags
Expand All @@ -8,12 +10,9 @@ on:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

name: Create Release


jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -38,4 +37,4 @@ jobs:
body: |
See [CHANGES.md](https://github.com/holgerbrandl/kscript/blob/master/NEWS.md) for new features, bug-fixes and changes.
draft: false
prerelease: false
prerelease: false
34 changes: 25 additions & 9 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changes

## 4.1.0 - TO BE RELEASED
## 4.1.0

Breaking changes

Expand All @@ -9,14 +9,30 @@ Breaking changes
KSCRIPT_IDEA_COMMAND -> KSCRIPT_COMMAND_IDEA
KSCRIPT_GRADLE_COMMAND -> KSCRIPT_COMMAND_GRADLE

Major Enhancements

* Initial Windows support
* Fix for resolution of dependencies

Minor Enhancements

## 4.0.2
Enhancements

* Windows support and proper Cygwin and MSys support
* File argument for specific OS should be in format of that OS (eg. Cygwin: kscript /cygdrive/c/file.kts)
* Multiplatform tests for different OS-es using Github actions
* Ability to use configuration file for kscript (thanks to [meztihn](https://github.com/meztihn))
* kscript follows XDG Spec (Issue #323) (thanks to [meztihn](https://github.com/meztihn))
* Packaging scripts works again (thanks to [Vsajip](https://github.com/vsajip))
* When creating IntelliJ project 'gradle' and 'idea' do not have to be in path
* Integration tests rewritten from bash to JUnit
* Replacements for (current annotations are deprecated):
* @MavenRepository -> @Repository
* @KotlinOpts -> @KotlinOptions
* @CompilerOpts -> @CompilerOptions
* Deprecation of comment based annotations
* Report for deprecated features (--report option)

Bugfixes
* Fix for dependency resolution
* Fix for creation of Gradle files and their indentation
* Fix for handling potentially duplicated file names in Idea projects
* Fix for Idea runtime configuration

## 4.0.x (last 4.0.3)

Released 2022-05-18

Expand Down
Loading

0 comments on commit ae3ae84

Please sign in to comment.