Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:
workflow_dispatch:
env:
KTC_PLUGINS_VERSION: 0.3.0
KTC_PLUGINS_VERSION: 0.3.1
permissions:
contents: read
jobs:
Expand Down
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ separately from tagged releases.

## [Unreleased]

## [0.3.1] - 2026-10-18

### Fixed

- Windows wrapper bootstrap clears the inherited `PSModulePath` before starting
Windows PowerShell, so launches from PowerShell 7 can resolve `Get-FileHash`
and verify the downloaded or cached executable. The change is local to the wrapper.
- Windows wrapper tests run through both `cmd.exe` and `pwsh`, covering cached
launches, argument forwarding, empty-cache downloads, concurrent bootstrap and
corrupt-download rejection.

### Compatibility

- CLI commands, plugin manifests and lockfiles are unchanged. Update both consumer
launchers to receive the Windows bootstrap fix.

## [0.3.0] - 2026-10-08

### Changed
Expand Down Expand Up @@ -97,7 +113,8 @@ separately from tagged releases.
- Unix and Windows launchers with pinned SHA-256 verification, native release
binaries, checksums and CI checks across all four runtime targets.

[Unreleased]: https://github.com/Heapy/ktc-plugins/compare/v0.3.0...HEAD
[Unreleased]: https://github.com/Heapy/ktc-plugins/compare/v0.3.1...HEAD
[0.3.1]: https://github.com/Heapy/ktc-plugins/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/Heapy/ktc-plugins/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/Heapy/ktc-plugins/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/Heapy/ktc-plugins/releases/tag/v0.1.0
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ installs a self-contained plugin module, and registers it in your project.

See [CHANGELOG.md](CHANGELOG.md) for release history and compatibility notes.

## Get version 0.3.0
## Get version 0.3.1

Download the generated launchers from the [0.3.0 release](https://github.com/Heapy/ktc-plugins/releases/tag/v0.3.0)
Download the generated launchers from the [0.3.1 release](https://github.com/Heapy/ktc-plugins/releases/tag/v0.3.1)
into your consumer project and commit them:

```sh
curl --fail --location --output ktc-plugins \
https://github.com/Heapy/ktc-plugins/releases/download/v0.3.0/ktc-plugins
https://github.com/Heapy/ktc-plugins/releases/download/v0.3.1/ktc-plugins
curl --fail --location --output ktc-plugins.bat \
https://github.com/Heapy/ktc-plugins/releases/download/v0.3.0/ktc-plugins.bat
https://github.com/Heapy/ktc-plugins/releases/download/v0.3.1/ktc-plugins.bat
chmod +x ktc-plugins
./ktc-plugins --help
```
Expand Down Expand Up @@ -154,8 +154,8 @@ The installer changes no Git index entries; commit vendored deletions yourself.
## Update project launchers

```sh
./ktc-plugins wrapper update --version 0.3.0 --dry-run
./ktc-plugins wrapper update --version 0.3.0
./ktc-plugins wrapper update --version 0.3.1 --dry-run
./ktc-plugins wrapper update --version 0.3.1
```

Choose an exact **published stable** version. The updater verifies GitHub asset digests,
Expand Down Expand Up @@ -364,10 +364,10 @@ merging remain unsupported. Installation does not execute plugin code; subsequen
./kotlin test -m core --platform jvm --platform macosArm64
./kotlin build -m cli-macos -m cli-linux -m cli-windows -v release
kotlinr scripts/stage-binaries.main.kts macosArm64 linuxX64 linuxArm64 mingwX64
kotlinr scripts/package-release.main.kts --version 0.3.0 \
kotlinr scripts/package-release.main.kts --version 0.3.1 \
--binaries build/binaries --output build/release
kotlinr scripts/smoke.main.kts build/binaries/ktc-plugins-0.3.0-macos-arm64
kotlinr scripts/test-wrappers.main.kts build/binaries/ktc-plugins-0.3.0-macos-arm64
kotlinr scripts/smoke.main.kts build/binaries/ktc-plugins-0.3.1-macos-arm64
kotlinr scripts/test-wrappers.main.kts build/binaries/ktc-plugins-0.3.1-macos-arm64
```

Cross-compilation requires a supported Toolchain compiler host. Build individual
Expand Down
2 changes: 1 addition & 1 deletion core/src/Cli.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.heapy.ktcplugins


const val VERSION = "0.3.0"
const val VERSION = "0.3.1"
private val usage = """
ktc-plugins $VERSION — install GitHub sources as local Kotlin Toolchain plugins

Expand Down
2 changes: 1 addition & 1 deletion ktc-plugins
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
set -eu
umask 077
version='0.3.0' # VERSION
version='0.3.1' # VERSION
fail() { printf '%s\n' "ktc-plugins: $*" >&2; exit 1; }
# Explicit development override; published wrappers always verify the pinned artifact.
if [ -n "${KTC_PLUGINS_BINARY:-}" ]; then
Expand Down
4 changes: 3 additions & 1 deletion ktc-plugins.bat
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
@echo off
setlocal DisableDelayedExpansion
set "ktc_version=0.3.0"
set "ktc_version=0.3.1"
if defined KTC_PLUGINS_BINARY goto run
if not defined KTC_PLUGINS_BINARY_CACHE set "KTC_PLUGINS_BINARY_CACHE=%LOCALAPPDATA%\ktc-plugins\binaries"
set "KTC_PLUGINS_BINARY=%KTC_PLUGINS_BINARY_CACHE%\%ktc_version%\windows-x64\ktc-plugins-%ktc_version%-windows-x64.exe"
set "KTC_PLUGINS_WRAPPER=%~f0"
rem Rebuild Windows PowerShell's module path when called through PowerShell 7.
set "PSModulePath="
powershell.exe -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command "$t=[IO.File]::ReadAllText($env:KTC_PLUGINS_WRAPPER); & ([scriptblock]::Create($t.Substring($t.LastIndexOf('# POWERSHELL')+12)))"
if errorlevel 1 exit /b 1
:run
Expand Down
14 changes: 12 additions & 2 deletions scripts/test-wrappers.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ val target = when {
System.getProperty("os.arch") in setOf("aarch64", "arm64") -> "linux-arm64"
else -> "linux-x64"
}
temporary("ktc wrapper test ") { tmp ->
for (shell in if (windows) listOf("cmd", "pwsh") else listOf("sh")) temporary("ktc $shell wrapper test ") { tmp ->
println("Testing wrapper from $shell")
val binaries = tmp.resolve("input").apply { mkdir() }
for (platform in listOf("macos-arm64", "linux-x64", "linux-arm64", "windows-x64")) {
binary.copyTo(binaries.resolve("ktc-plugins-$version-$platform" + if (platform == "windows-x64") ".exe" else ""))
Expand All @@ -87,7 +88,16 @@ temporary("ktc wrapper test ") { tmp ->
if (!windows) check(cachedBinary.setExecutable(true, false))
val environment = mutableMapOf<String, String?>("KTC_PLUGINS_BINARY_CACHE" to tmp.resolve("offline binary cache").path, "KTC_PLUGINS_BINARY" to null)
val wrapper = output.resolve(if (windows) "ktc-plugins.bat" else "ktc-plugins").path
fun run(vararg arguments: String) = command(tmp, if (windows) batch(wrapper, arguments.toList()) else listOf(wrapper) + arguments, environment)
fun run(vararg arguments: String): CommandResult {
val invocation = when (shell) {
"cmd" -> batch(wrapper, arguments.toList())
// Keep PowerShell 7's real environment when it starts the batch wrapper.
"pwsh" -> listOf("pwsh", "-NoLogo", "-NoProfile", "-NonInteractive", "-Command",
"& " + (listOf(wrapper) + arguments).joinToString(" ") { "'${it.replace("'", "''")}'" } + "; exit \$LASTEXITCODE")
else -> listOf(wrapper) + arguments
}
return command(tmp, invocation, environment)
}
fun concurrentVersions() {
java.util.concurrent.Executors.newFixedThreadPool(4).use { pool ->
val futures = (1..4).map { pool.submit<CommandResult> { run("--version") } }
Expand Down
Loading