Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite Haxe Manager in Haxe, multi platform #12

Merged
merged 75 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
63f6926
[build] add haxe 569e52e binaries (linux, mac)
kLabz Apr 15, 2024
e1810ec
Rewrite hx-select in Haxe
kLabz Apr 15, 2024
8427d8c
Use current/std as current std to avoid issues
kLabz Apr 15, 2024
e7a4d7f
Create current dir if needed
kLabz Apr 15, 2024
ebe249f
Use bash instead of sh for weak distro
kLabz Apr 15, 2024
f0c3e40
[CI] check how far windows is
kLabz Apr 15, 2024
e166afb
Add windows binaries
kLabz Apr 15, 2024
256dba5
[ci] not downloading defaults atm...
kLabz Apr 15, 2024
bb2a2d1
Try with a bat file
kLabz Apr 15, 2024
d0ec543
[ci] simplify testing for windows..
kLabz Apr 15, 2024
1230dd2
[CI] Come on, windows...
kLabz Apr 15, 2024
ec9bf85
WIP haxe-download
kLabz Apr 15, 2024
f1c0371
[CI] make things a bit more verbose
kLabz Apr 15, 2024
12bd160
[CI] try without bat files
kLabz Apr 15, 2024
e90d4bc
Revert "[CI] try without bat files"
kLabz Apr 15, 2024
a8b7147
WIP download.. getting eval ssl failure locally :/
kLabz Apr 15, 2024
2e6da42
[CI] sacrifice windows for now
kLabz Apr 15, 2024
d2bc4d7
Prepare for std patch
kLabz Apr 19, 2024
604baa9
Patch std
kLabz Apr 19, 2024
10e49b8
[hx-download] download releases
kLabz Apr 19, 2024
54307f2
Update prebuilt tools
kLabz Apr 19, 2024
254588a
Add format lib
kLabz Apr 19, 2024
07f254f
[hx-download] extract tar releases
kLabz Apr 19, 2024
022cd0b
Update prebuilt tools
kLabz Apr 19, 2024
c2b6a9f
[hx-download] extract tar releases and add symlink
kLabz Apr 19, 2024
0d51b5d
Update prebuilt tools
kLabz Apr 19, 2024
24eb536
[hx-download] resolve nightlies from short hash, prepare for windows …
kLabz Apr 19, 2024
d9288fe
Fix .gitignore
kLabz Apr 19, 2024
3c6c6a5
Update prebuilt tools
kLabz Apr 19, 2024
154ee18
Fix zip
kLabz Apr 19, 2024
4605031
isDirectory for symlinks isn't exactly safe..
kLabz Apr 19, 2024
01602b3
Multi-platform install process
kLabz Apr 19, 2024
47cd152
[hx-download] optimize tar.gz extract
kLabz Apr 20, 2024
8d5b09c
Build hxb as part of install script
kLabz Apr 20, 2024
bcfe799
Symlink the whole current folder
kLabz Apr 20, 2024
a40f2ec
Add hx-nightlies (will be deprecated with new version anyway)
kLabz Apr 20, 2024
1276b0c
Debug hx-select on unix
kLabz Apr 20, 2024
68df506
Cleanup a bit
kLabz Apr 20, 2024
0ec5bcf
Bit of refactoring
kLabz Apr 20, 2024
8566498
Auto resolve alias to haxe version string
kLabz Apr 20, 2024
a89cd49
Prepare for eval port of fzf selector
kLabz Apr 20, 2024
006afb1
Include ansi and fuzzaldrin libs
kLabz Apr 20, 2024
46bff54
[ansi] unix line endings + Std.is warning
kLabz Apr 20, 2024
8ffa773
Rewrite hx in Haxe too
kLabz Apr 21, 2024
0d3b862
[ci] nodejs warnings
kLabz Apr 21, 2024
21bc55e
[hx] fzf: actually apply selected version
kLabz Apr 21, 2024
f711e0e
Add hx current, hx current --name, hx current --full
kLabz Apr 21, 2024
12ba28b
[ci] don't try unsupported commands
kLabz Apr 21, 2024
54e542d
Rework --help a bit
kLabz Apr 21, 2024
72fcc3c
Add hx list
kLabz Apr 21, 2024
b5595d6
[extra] remove hx-nightlies
kLabz Apr 21, 2024
e6461d9
[fzf] sort filtered results
kLabz Apr 21, 2024
9f2cc03
[fzf] highlighted results
kLabz Apr 21, 2024
7fa4e92
[fzf] implement ctrl+w, ctrl+left, ctrl+right
kLabz Apr 22, 2024
6a2806a
Update comments
kLabz Apr 22, 2024
93f21b7
[fzf] don't loop when navigating up/down
kLabz Apr 22, 2024
6dde60e
[fzf] add support for ctrl+n, ctrl+p
kLabz Apr 22, 2024
71a08f6
[hx-select] display full current version
kLabz Apr 22, 2024
3074d70
[hx select] temp help message
kLabz Apr 22, 2024
ff7d9b5
[fzf] scroll
kLabz Apr 22, 2024
11bd385
[fzf] scroll indicator + avoid cursor flicker
kLabz Apr 22, 2024
4462a04
Help messages
kLabz Apr 22, 2024
bb004bd
Move ANSI.hx to its own package
kLabz Apr 22, 2024
13fd73e
[libs] Add licenses and information about included libs
kLabz Apr 22, 2024
481bb7b
Add SemVer from haxelib
kLabz Apr 23, 2024
b6eef6a
Remove SemVer.toValidatable() (module not included)
kLabz Apr 23, 2024
b9508c6
Add preview to valid-looking SemVer
kLabz Apr 23, 2024
e2bed78
[hx download] only try downloading valid semver releases
kLabz Apr 23, 2024
cfeb700
[ci] display more
kLabz Apr 23, 2024
0983a21
Move things around
kLabz Apr 23, 2024
f559404
Remove hx-download and hx-select
kLabz Apr 23, 2024
a494d0b
Update README and extra tools
kLabz Apr 23, 2024
eb64e2b
Add hx install
kLabz Apr 23, 2024
c6d97c1
Cleanup from removing hx-download and hx-select
kLabz Apr 23, 2024
4e58da0
Replace hxfzf extra with hx list-modules
kLabz Apr 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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