Giter Club home page Giter Club logo

asdf-kotlin's Introduction

asdf-kotlin Build

kotlin (and kotlin-native if available) plugin for asdf version manager

Contents

Dependencies

Install

Plugin:

asdf plugin add kotlin
# or
asdf plugin add kotlin https://github.com/asdf-community/asdf-kotlin.git

kotlin:

# Show all installable versions
asdf list-all kotlin

# Install specific version
asdf install kotlin latest

# Set a version globally (on your ~/.tool-versions file)
asdf global kotlin latest

# Now kotlin commands are available
kotlin -help

Check the asdf readme for instructions on how to install & manage versions of kotlin.

Contributing

Contributions of any kind welcome! See the contributing guide.

Thanks goes to these contributors!

Issues

  • Doesn't check if java is installed

License

MIT License

Tests

Github Actions

Note: See workflows

  • It tests installing a version of kotlin without kotlin native (Version 1.0.3) on mac and linux
  • It tests installing a version of kotlin with kotlin native (Version 1.3.21) on mac and linux
  • It tests installing a version of kotlin with new kotlin native naming (Version 1.4.30-RC) on mac and linux
  • It tests installing a version of kotling with new kotlin native naming that includes arch (Version 1.5.30-M1) on mac and linux
  • It tests installing latest version of kotlin on mac and linux

Locally with Docker Compose

Note: Only tests linux (Ubuntu 22.04) and takes a while since it builds on every run

  • cd /path/to/this/repo

  • docker compose up --force-recreate --abort-on-container-exit

    Creating asdf-kotlin-linux-test ... done
    Attaching to asdf-kotlin-linux-test
    asdf-kotlin-linux-test | Cloning into '/home/build/.asdf'...
    ...
    asdf-kotlin-linux-test |   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
    asdf-kotlin-linux-test |                                  Dload  Upload   Total   Spent    Left  Speed
    100   621    0   621    0     0   1673      0 --:--:-- --:--:-- --:--:--  1673
    100 75.5M  100 75.5M    0     0  11.1M      0  0:00:06  0:00:06 --:--:-- 13.6M
    asdf-kotlin-linux-test | Setting kotlin 1.0.3 as the default value in ~/.tool-versions
    asdf-kotlin-linux-test | Confirming version 1.0.3
    asdf-kotlin-linux-test | Kotlin version 1.0.3 (JRE 11.0.1+13)
    asdf-kotlin-linux-test | Setting kotlin 1.3.21 as the default value in ~/.tool-versions
    asdf-kotlin-linux-test | Confirming version 1.3.21
    asdf-kotlin-linux-test | Kotlin version 1.3.21-release-158 (JRE 11.0.1+13)
    asdf-kotlin-linux-test | info: kotlinc-native 1.3.21 (JRE 11.0.1+13)
    asdf-kotlin-linux-test exited with code 0

asdf-kotlin's People

Contributors

alxndrhi avatar dependabot[bot] avatar esensar avatar github-actions[bot] avatar homburg avatar joschi avatar missingcharacter avatar nickveys avatar renovate[bot] avatar smorimoto avatar sobafuchs avatar squarism avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

asdf-kotlin's Issues

[BUG] Installing Kotlin/Native doesn't work starting with Kotlin 1.4.20

Describe the bug

Installing Kotlin/Native doesn't work with asdf-kotlin starting with Kotlin 1.4.20 because the filenames for the pre-built Kotlin/Native artifacts changed.

Additionally, the pattern used in asdf kotlin install [...] doesn't take version suffixes such as -M[0-9] or -RC into account.

To Reproduce

Steps to reproduce the behavior:

  1. asdf plugin-add kotlin
  2. asdf install kotlin 1.4.30-RC
  3. Kotlin/Native 1.4.30-RC is not being downloaded and installed by asdf

Expected behavior

# asdf plugin-add kotlin
# asdf install kotlin 1.4.30-RC
# $HOME/.asdf/installs/kotlin/1.4.30-RC/kotlin-native/bin/kotlinc-native -version
info: kotlinc-native 1.4.30-RC-214 (JRE 11.0.9.1+1-LTS)
Kotlin/Native: 1.4.30-rc1-14

Screenshots

Download artifacts of Kotlin 1.4.10
Download artifacts of Kotlin 1.4.10
Download artifacts of Kotlin 1.4.20
Download artifacts of Kotlin 1.4.20
Download artifacts of Kotlin 1.4.30-RC
Download artifacts of Kotlin 1.4.30-RC

I get 404 when I try to install kotlin

I get this error when I try to install kotlin using the plugin:

asdf install kotlin 1.3.20-eap-52
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   622    0   622    0     0   1143      0 --:--:-- --:--:-- --:--:--  1145
100 36.4M  100 36.4M    0     0   325k      0  0:01:54  0:01:54 --:--:--  426k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
curl: (22) The requested URL returned error: 404 Not Found

After that it says that Kotlin is installed when it isn't

Kotlin native portion of download failing

Describe the bug

For versions 1.9.21 and up, the plugin is producing an error on download.

Steps to reproduce

When running asdf install with the following .tool-versions file:

kotlin 1.9.24

The following error occurs
image

Same behaviour occurs when running: asdf install kotlin 1.9.24

Failed to install kotlin 1.9.23 in bash 5.x on Apple M1 w/macos 14.2.1

Describe the bug

asdf install with kotlin 1.9.23 fails on macos in bash

Steps to reproduce

$ asdf --version
v0.13.1-0586b37

$ cat .tool-versions
kotlin 1.9.23

$ asdf install
* Downloading kotlin release 1.9.23...
* Downloading kotlin-native for release 1.9.23...
curl: (3) URL rejected: Malformed input to a URL function
asdf-kotlin: Could not download https://github.com/JetBrains/kotlin/releases/download/v1.9.23/kotlin-native-macos-aarch64-1.9.23.tar.gz
/JetBrains/kotlin/releases/download/v1.9.23/kotlin-native-macos-aarch64-1.9.23.tar.gz.sha256

Expected behavior

worky

Screenshots

Additional context

$ uname -a
Darwin zeus.lan 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000 arm64
$ bash --version
GNU bash, version 5.2.26(1)-release (aarch64-apple-darwin23.2.0)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

image

Fail to "asdf install" on ubuntu 22.04

Describe the bug

The plugin fails to install any kotlin.

ubuntu@ubuntu ~/w/tmp ❯❯❯ asdf install kotlin latest
* Downloading kotlin release 1.9.22...
curl: (22) The requested URL returned error: 416
asdf-kotlin: Could not download https://github.com/JetBrains/kotlin/releases/download/v1.9.22/kotlin-compiler-1.9.22.zip

Steps to reproduce

There is one step to reproduce.

asdf install kotlin latest

Expected behavior

Installation will be completed.

Additional context

FYI: Here is my environment.

ubuntu@ubuntu ~/w/tmp ❯❯❯ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:        22.04
Codename:       jammy

ubuntu@ubuntu ~/w/tmp ❯❯❯ asdf info
OS:
Linux ubuntu 5.15.0-1044-raspi #47-Ubuntu SMP PREEMPT Tue Nov 21 11:33:46 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

SHELL:
zsh 5.8.1 (aarch64-unknown-linux-gnu)

BASH VERSION:
5.1.16(1)-release

ASDF VERSION:
v0.14.0-ccdd47d

ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=/home/ubuntu/.asdf
ASDF_DIR=/home/ubuntu/.asdf
ASDF_CONFIG_FILE=/home/ubuntu/.asdfrc

ASDF INSTALLED PLUGINS:
java                         https://github.com/halcyon/asdf-java.git master fc28b48
kotlin                       https://github.com/asdf-community/asdf-kotlin.git master 6371efd

Setting IFS in exec-env breaks asdf-direnv logging

Hi,

I am using ASDF with both the asdf-direnv plugin and this asdf-kotlin plugin.
I recently encountered an issue where the default logging of direnv was being broken up by many newlines after sourcing the asdf-kotlin environment.

After a short investigation, I figured out that the following line was the culprit for this behaviour:

IFS=$'\n\t'

This ends up being problematic, because the exec-env script is being sourced by direnv in a loop, when using the asdf-direnv integration.
You can see that when looking at an environment definition example:

log_status using asdf kotlin 1.6.10
PATH_add /Users/<user>/.asdf/installs/kotlin/1.6.10/kotlin-native/bin
PATH_add /Users/<user>/.asdf/installs/kotlin/1.6.10/kotlinc/bin
ASDF_INSTALL_TYPE='version' ASDF_INSTALL_VERSION='1.6.10' \
    ASDF_INSTALL_PATH='/Users/<user>/.asdf/installs/kotlin/1.6.10' \
    source_env /Users/<user>/.asdf/plugins/kotlin/bin/exec-env
...

This script is being sourced by the source_env function, after which it breaks all invocations of the log_status and log_error functions.

That is because they both use msg=$* to concatenate their arguments into a single string for printing, and removing the space-character from IFS breaks that expected functionality.

I understand migrating all scripts to Strict Bash conventions, but I would propose one of the following steps:

  1. Remove this line, as it is not effectively being used in this script
  2. Reset IFS back to its original value after the script has executed
  3. Wrap everything in a function and manage the modifications to IFS as a local variable

An example of how 3 would look:

#!/usr/bin/env bash
set -eo pipefail

export_kotlin_home() {
    local IFS=$'\n\t'
    if [[ -z ${KOTLIN_HOME:-""} ]]; then
      export KOTLIN_HOME=${ASDF_INSTALL_PATH}/kotlinc
    fi
}

export_kotlin_home

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

asdf
.tool-versions
  • shellcheck 0.10.0
  • shfmt 3.8.0
docker-compose
docker-compose.yml
dockerfile
Dockerfile
  • ubuntu noble-20240530
github-actions
.github/workflows/build.yml
  • asdf-vm/actions v3
  • actions/setup-java v4
  • actions/checkout v4
.github/workflows/pre-commit.yml
  • actions/checkout v4
  • asdf-vm/actions v3
  • actions/setup-python v5
  • azure/setup-helm v4
  • pre-commit/action v3.0.1

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.