Skip to content

Commit

Permalink
Rewrite Haxe Manager in Haxe, multi platform (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz authored Apr 23, 2024
1 parent d7d0514 commit 0382c17
Show file tree
Hide file tree
Showing 7,717 changed files with 551,280 additions and 382 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
125 changes: 111 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI
on: push

jobs:
build:
test-unix:
strategy:
fail-fast: false
matrix:
Expand All @@ -11,35 +11,132 @@ jobs:
- ubuntu-latest
runs-on: ${{ matrix.os }}
env:
HAXE_STD_PATH: "${{ github.workspace }}/std"
HAXE_STD_PATH: "${{ github.workspace }}/current/std"
steps:
- uses: actions/checkout@main

- name: Install haxe-manager
run: |
sh ./install.sh
- name: Add to PATH
run: |
echo "${GITHUB_WORKSPACE}/bin" >> $GITHUB_PATH
- name: Install haxe-manager
run: |
./install.sh
haxe --version
- name: Check env
run: |
echo $PATH
echo $GITHUB_PATH
echo $HAXE_STD_PATH
echo "PATH=${PATH}"
echo "GITHUB_PATH=${GITHUB_PATH}"
echo "HAXE_STD_PATH=${HAXE_STD_PATH}"
- name: Help messages
run: |
echo "hx --help"
hx --help
echo ""
echo "hx --help download"
hx --help download
echo ""
echo "hx --help select"
hx --help select
- name: Check base usage
run: |
echo "Download latest nightly"
hx download latest
echo "Download release"
hx download 4.3.4
echo "Download short hash nightly"
hx download nightly 569e52e
echo "Download short hash nightly (already downloaded)"
hx download nightly 569e52e alias
echo "Check Haxe version"
haxe --version
echo "Switch to dev"
hx select dev
echo "Check Haxe version"
haxe --version
hx 4.2.5
hx-download latest
hx dev
echo "Switch to 4.3.4"
hx 4.3.4
echo "Check Haxe version"
haxe --version
echo "Switch to dev"
hx select dev
echo "Check Haxe version"
haxe --version
echo "Check hx current (normal, --name, --full)"
hx current
hx current --name
hx current --full
- name: Install extra tools
run: |
sh ./extra/install-all.sh
ls -Al bin/
- name: Check list-haxe-versions
run: list-haxe-versions
test-windows:
strategy:
fail-fast: false
matrix:
os:
- windows-latest
runs-on: ${{ matrix.os }}
env:
HAXE_STD_PATH: "${{ github.workspace }}/current/std"
steps:
- uses: actions/checkout@main

- name: Add to PATH
run: |
echo "${env:GITHUB_WORKSPACE}/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Install haxe-manager
run: |
./install.bat
haxe --version
- name: Check env
run: |
echo "PATH=${env:PATH}"
echo "GITHUB_PATH=${env:GITHUB_PATH}"
echo "HAXE_STD_PATH=${env:HAXE_STD_PATH}"
- name: Help messages
run: |
echo "hx --help"
hx --help
echo ""
echo "hx --help download"
hx --help download
echo ""
echo "hx --help select"
hx --help select
- name: Check base usage
run: |
echo "Download latest nightly"
hx download latest
echo "Download release"
hx download 4.3.4
echo "Download short hash nightly"
hx download nightly 569e52e
echo "Download short hash nightly (already downloaded)"
hx download nightly 569e52e alias
echo "Check Haxe version"
haxe --version
echo "Switch to dev"
hx select dev
echo "Check Haxe version"
haxe --version
echo "Switch to 4.3.4"
hx 4.3.4
echo "Check Haxe version"
haxe --version
echo "Switch to dev"
hx select dev
echo "Check Haxe version"
haxe --version
echo "Check hx current"
hx current
11 changes: 4 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
**/node_modules/*
**/package-lock.json
releases/
versions/
builds/
std
bin/*
!bin/hx
!bin/hx-download
!bin/hx-select
current
data/
bin/
build/*.hxb
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.SILENT:

build-tools:
extra/build-tools.sh
63 changes: 44 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,75 @@
# Haxe Manager

Easily download and switch haxe versions on UNIX (currently tested on
`ubuntu-latest` and `macos-latest` via github actions).
Easily download and switch haxe versions (currently tested on
`ubuntu-latest`, `macos-latest` and `windows-latest` via github actions).

Run `install.sh` and update `PATH` / `HAXE_STD_PATH` as requested.
Run `install.sh` (`install.bat` on Windows) and update `PATH` / `HAXE_STD_PATH` as
requested.

## Select a version

Run `hx` to display the haxe version switch (using [`fzf`](https://github.com/junegunn/fzf)).
Run `hx` to display the haxe version switch (using a Haxe port of [`fzf`](https://github.com/junegunn/fzf)
picker).

You can also skip the version picker by using directly `hx 4.3.0` (or any other
version/alias you have installed).
You can also skip the version picker by using directly `hx 4.3.0` or `hx select
4.3.0` (or any other version/alias you have installed).

## Installing / updating versions

Use `hx-download` tool to download haxe versions:
Use `hx download` tool to download haxe versions:

```
Usage: hx-download <VERSION> [AS_NAME]
Usage: hx download <VERSION> [AS_NAME]
Download official release VERSION (e.g., 4.3.0)
Save as AS_NAME if provided or use version number
or: hx-download latest [AS_NAME]
or: hx download latest [AS_NAME]
Download latest nightly
Save as AS_NAME if provided or use version number (with revision)
or: hx-download nightly <VERSION> [AS_NAME]
or: hx download nightly <VERSION> [AS_NAME]
or: hx download aws <VERSION> [AS_NAME]
Download specific nightly VERSION (e.g., 2023-01-22_development_dd5e467)
Save as AS_NAME if provided or use version number (with revision)
Note: short hash VERSION is also supported for development nightlies (e.g. dd5e467)
```

## Included tools
### Installing archive

`extra/` folder contains optional tools you can install individually with their
`install.sh` script or all at once with `install-all.sh`.
If you already have an archive available (a nightly from a branch other than
`development`, for example), you can install it with:

`hx install my_haxe_release.tar.gz [AS_NAME]`

## List available versions

Use `hx list` to get a list of all haxe versions available throught your (local)
haxe-manager.

## Display currently selected version

Use `hx current` to display currently selected Haxe version string (equivalent
to running `haxe --version`).

On Unix, you can also run:
- `hx current --name` to get the name under which that version is installed
- `hx current --full` to get both name and version string (`[NAME] ([VERSION])`)

### `hxfzf`
## List all Haxe modules for current hxml

Prints a list of all `.hx` files in all your classpath, to be passed to `fzf`
or other tools.

Usage: `hxfzf [compile.hxml]` (will default to `build.hxml`)
Usage: `hx list-modules [compile.hxml]` (will default to `build.hxml`)


## Included tools

`extra/` folder contains optional tools you can install individually with their
`install.sh` script or all at once with `install-all.sh`.

Note that those have been written when Haxe Manager was unix only and probably
can't work at all on Windows.

### `++haxe`

Expand Down Expand Up @@ -73,10 +102,6 @@ the path to your repository if you're executing from somewhere else)

Update your local (git) copy of haxe-manager.

### `list-haxe-versions`

Get a list of all haxe versions available throught your (local) haxe-manager.

### `rofi-haxe`

[rofi](https://github.com/davatorium/rofi) wrapper to `hx` command, to graphically select a Haxe version.
Expand Down
21 changes: 0 additions & 21 deletions bin/hx

This file was deleted.

Loading

0 comments on commit 0382c17

Please sign in to comment.