Skip to content

Commit 0382c17

Browse files
authored
Rewrite Haxe Manager in Haxe, multi platform (#12)
1 parent d7d0514 commit 0382c17

File tree

7,717 files changed

+551280
-382
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

7,717 files changed

+551280
-382
lines changed

.github/workflows/main.yml

+111-14
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22
on: push
33

44
jobs:
5-
build:
5+
test-unix:
66
strategy:
77
fail-fast: false
88
matrix:
@@ -11,35 +11,132 @@ jobs:
1111
- ubuntu-latest
1212
runs-on: ${{ matrix.os }}
1313
env:
14-
HAXE_STD_PATH: "${{ github.workspace }}/std"
14+
HAXE_STD_PATH: "${{ github.workspace }}/current/std"
1515
steps:
1616
- uses: actions/checkout@main
1717

18-
- name: Install haxe-manager
19-
run: |
20-
sh ./install.sh
21-
2218
- name: Add to PATH
2319
run: |
2420
echo "${GITHUB_WORKSPACE}/bin" >> $GITHUB_PATH
2521
22+
- name: Install haxe-manager
23+
run: |
24+
./install.sh
25+
haxe --version
26+
2627
- name: Check env
2728
run: |
28-
echo $PATH
29-
echo $GITHUB_PATH
30-
echo $HAXE_STD_PATH
29+
echo "PATH=${PATH}"
30+
echo "GITHUB_PATH=${GITHUB_PATH}"
31+
echo "HAXE_STD_PATH=${HAXE_STD_PATH}"
32+
33+
- name: Help messages
34+
run: |
35+
echo "hx --help"
36+
hx --help
37+
echo ""
38+
echo "hx --help download"
39+
hx --help download
40+
echo ""
41+
echo "hx --help select"
42+
hx --help select
3143
3244
- name: Check base usage
3345
run: |
46+
echo "Download latest nightly"
47+
hx download latest
48+
echo "Download release"
49+
hx download 4.3.4
50+
echo "Download short hash nightly"
51+
hx download nightly 569e52e
52+
echo "Download short hash nightly (already downloaded)"
53+
hx download nightly 569e52e alias
54+
echo "Check Haxe version"
55+
haxe --version
56+
echo "Switch to dev"
57+
hx select dev
58+
echo "Check Haxe version"
3459
haxe --version
35-
hx 4.2.5
36-
hx-download latest
37-
hx dev
60+
echo "Switch to 4.3.4"
61+
hx 4.3.4
62+
echo "Check Haxe version"
63+
haxe --version
64+
echo "Switch to dev"
65+
hx select dev
66+
echo "Check Haxe version"
67+
haxe --version
68+
echo "Check hx current (normal, --name, --full)"
69+
hx current
70+
hx current --name
71+
hx current --full
3872
3973
- name: Install extra tools
4074
run: |
4175
sh ./extra/install-all.sh
4276
ls -Al bin/
4377
44-
- name: Check list-haxe-versions
45-
run: list-haxe-versions
78+
test-windows:
79+
strategy:
80+
fail-fast: false
81+
matrix:
82+
os:
83+
- windows-latest
84+
runs-on: ${{ matrix.os }}
85+
env:
86+
HAXE_STD_PATH: "${{ github.workspace }}/current/std"
87+
steps:
88+
- uses: actions/checkout@main
89+
90+
- name: Add to PATH
91+
run: |
92+
echo "${env:GITHUB_WORKSPACE}/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
93+
94+
- name: Install haxe-manager
95+
run: |
96+
./install.bat
97+
haxe --version
98+
99+
- name: Check env
100+
run: |
101+
echo "PATH=${env:PATH}"
102+
echo "GITHUB_PATH=${env:GITHUB_PATH}"
103+
echo "HAXE_STD_PATH=${env:HAXE_STD_PATH}"
104+
105+
- name: Help messages
106+
run: |
107+
echo "hx --help"
108+
hx --help
109+
echo ""
110+
echo "hx --help download"
111+
hx --help download
112+
echo ""
113+
echo "hx --help select"
114+
hx --help select
115+
116+
- name: Check base usage
117+
run: |
118+
echo "Download latest nightly"
119+
hx download latest
120+
echo "Download release"
121+
hx download 4.3.4
122+
echo "Download short hash nightly"
123+
hx download nightly 569e52e
124+
echo "Download short hash nightly (already downloaded)"
125+
hx download nightly 569e52e alias
126+
echo "Check Haxe version"
127+
haxe --version
128+
echo "Switch to dev"
129+
hx select dev
130+
echo "Check Haxe version"
131+
haxe --version
132+
echo "Switch to 4.3.4"
133+
hx 4.3.4
134+
echo "Check Haxe version"
135+
haxe --version
136+
echo "Switch to dev"
137+
hx select dev
138+
echo "Check Haxe version"
139+
haxe --version
140+
echo "Check hx current"
141+
hx current
142+

.gitignore

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
**/node_modules/*
2-
**/package-lock.json
31
releases/
42
versions/
53
builds/
6-
std
7-
bin/*
8-
!bin/hx
9-
!bin/hx-download
10-
!bin/hx-select
4+
current
5+
data/
6+
bin/
7+
build/*.hxb

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.SILENT:
2+
3+
build-tools:
4+
extra/build-tools.sh

README.md

+44-19
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,75 @@
11
# Haxe Manager
22

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

6-
Run `install.sh` and update `PATH` / `HAXE_STD_PATH` as requested.
6+
Run `install.sh` (`install.bat` on Windows) and update `PATH` / `HAXE_STD_PATH` as
7+
requested.
78

89
## Select a version
910

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

12-
You can also skip the version picker by using directly `hx 4.3.0` (or any other
13-
version/alias you have installed).
14+
You can also skip the version picker by using directly `hx 4.3.0` or `hx select
15+
4.3.0` (or any other version/alias you have installed).
1416

1517
## Installing / updating versions
1618

17-
Use `hx-download` tool to download haxe versions:
19+
Use `hx download` tool to download haxe versions:
1820

1921
```
20-
Usage: hx-download <VERSION> [AS_NAME]
22+
Usage: hx download <VERSION> [AS_NAME]
2123
Download official release VERSION (e.g., 4.3.0)
2224
Save as AS_NAME if provided or use version number
2325
24-
or: hx-download latest [AS_NAME]
26+
or: hx download latest [AS_NAME]
2527
Download latest nightly
2628
Save as AS_NAME if provided or use version number (with revision)
2729
28-
or: hx-download nightly <VERSION> [AS_NAME]
30+
or: hx download nightly <VERSION> [AS_NAME]
31+
or: hx download aws <VERSION> [AS_NAME]
2932
Download specific nightly VERSION (e.g., 2023-01-22_development_dd5e467)
3033
Save as AS_NAME if provided or use version number (with revision)
34+
Note: short hash VERSION is also supported for development nightlies (e.g. dd5e467)
3135
```
3236

33-
## Included tools
37+
### Installing archive
3438

35-
`extra/` folder contains optional tools you can install individually with their
36-
`install.sh` script or all at once with `install-all.sh`.
39+
If you already have an archive available (a nightly from a branch other than
40+
`development`, for example), you can install it with:
41+
42+
`hx install my_haxe_release.tar.gz [AS_NAME]`
43+
44+
## List available versions
45+
46+
Use `hx list` to get a list of all haxe versions available throught your (local)
47+
haxe-manager.
48+
49+
## Display currently selected version
50+
51+
Use `hx current` to display currently selected Haxe version string (equivalent
52+
to running `haxe --version`).
53+
54+
On Unix, you can also run:
55+
- `hx current --name` to get the name under which that version is installed
56+
- `hx current --full` to get both name and version string (`[NAME] ([VERSION])`)
3757

38-
### `hxfzf`
58+
## List all Haxe modules for current hxml
3959

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

43-
Usage: `hxfzf [compile.hxml]` (will default to `build.hxml`)
63+
Usage: `hx list-modules [compile.hxml]` (will default to `build.hxml`)
64+
65+
66+
## Included tools
67+
68+
`extra/` folder contains optional tools you can install individually with their
69+
`install.sh` script or all at once with `install-all.sh`.
70+
71+
Note that those have been written when Haxe Manager was unix only and probably
72+
can't work at all on Windows.
4473

4574
### `++haxe`
4675

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

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

76-
### `list-haxe-versions`
77-
78-
Get a list of all haxe versions available throught your (local) haxe-manager.
79-
80105
### `rofi-haxe`
81106

82107
[rofi](https://github.com/davatorium/rofi) wrapper to `hx` command, to graphically select a Haxe version.

bin/hx

-21
This file was deleted.

0 commit comments

Comments
 (0)