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
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ on:
- '.github/workflows/publish.yml'
- '.github/workflows/debian.yml'
- '.github/workflows/source-tidy.yml'
- 'tools/cmdline/make-pkg.ps1'
pull_request:
types: [opened, synchronize, reopened]
paths-ignore:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/genbindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
- '**/*.md.in'
- 'docs/**'
- '.github/workflows/publish.yml'
- 'tools/cmdline/make-pkg.ps1'
- '.github/workflows/debian.yml'

workflow_dispatch:
Expand All @@ -27,7 +26,7 @@ jobs:
python-version: '3.12.10' # python-3.12 is last release that support axmol traditional binding generator

- name: Genbindings
run: tools\cmdline\genbindings.ps1
run: tools\cmdline\plugins\genbindings.ps1

- name: Create pull request
if: ${{ env.BINDING_NO_CHANGES != 'true' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
axmol -xc '-DAX_WITH_LZ4=ON,-DAX_WITH_CARES=ON,-DAX_WITH_YAML_CPP=ON,-DAX_WITH_KCP=ON' -c
$input_commitish = "${{ github.event.inputs.commitish }}"
if (!$input_commitish) { $input_commitish = $(git -C $AX_ROOT branch --show-current) }
./tools/cmdline/publish.ps1 -version "${{ steps.check_ver.outputs.release_ver }}" -commitish $input_commitish
./tools/cmdline/plugins/publish.ps1 -version "${{ steps.check_ver.outputs.release_ver }}" -commitish $input_commitish
echo "commitish=$input_commitish" >> ${env:GITHUB_OUTPUT}

- name: Publish to github release page
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/source-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ jobs:
- name: Lint Axmol source files (UTF-8 BOM & cstd headers)
if: ${{ steps.pp.outputs.should_run == 'true' }}
shell: pwsh
run: ./tools/cmdline/source-lint.ps1
run: ./tools/cmdline/plugins/source-lint.ps1

- name: Install llvm clang-format
if: ${{ steps.pp.outputs.should_run == 'true' }}
Expand All @@ -159,7 +159,7 @@ jobs:
if: ${{ steps.pp.outputs.should_run == 'true' }}
shell: pwsh
run: |
./tools/cmdline/clang-format.ps1 -ver $env:LLVM_VER
./tools/cmdline/plugins/clang-format.ps1 -ver $env:LLVM_VER

# check_only mode
- name: Check for uncommitted changes
Expand Down
66 changes: 64 additions & 2 deletions tools/cmdline/axmol.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ Available commands:
build Compile projects to binary.
deploy Compile and deploy a project to a device/simulator.
run Compiles, deploy and run project on the target.
source-lint Lint axmol source files (UTF-8 BOM & cstd headers).
clang-format Format source files using clang-format.
genbindings Generate Lua bindings for axmol engine.
build-docs Build axmol documentation.
publish Publish axmol release.

Available arguments:
-h Show this help information.
Expand Down Expand Up @@ -83,7 +88,7 @@ if ($IsMacOS) {
function axmol_build() {
$sub_args = $args
println $sub_args
$build_script = Join-Path $PSScriptRoot 'build.ps1'
$build_script = Join-Path $PSScriptRoot 'plugins/build.ps1'
if ("$args".Contains('-d')) {
# have proj dir
. $build_script @sub_args
Expand Down Expand Up @@ -250,7 +255,7 @@ function axmol_run() {

$builtinPlugins = @{
new = @{
proc = (Join-Path $PSScriptRoot 'axmol_new.ps1');
proc = (Join-Path $PSScriptRoot 'plugins/axmol_new.ps1');
usage = @"
usage: axmol new -p dev.axmol.hellocpp -d path/to/project -l cpp --portrait <ProjectName>
Creates a new project.
Expand Down Expand Up @@ -352,6 +357,63 @@ options:
-c: no build, only generate native project files (vs .sln, xcodeproj)
-d: specify project dir to compile, i.e. -d /path/your/project/
-f: force generate native project files. Useful if no changes are detected, such as with resource updates.
"@
};
'source-lint' = @{
proc = (Join-Path $PSScriptRoot 'plugins/source-lint.ps1');
usage = @"
usage: axmol source-lint

Lint axmol source files (UTF-8 BOM & cstd headers).

options:
-h Show this help message.
"@
};
'clang-format' = @{
proc = (Join-Path $PSScriptRoot 'plugins/clang-format.ps1');
usage = @"
usage: axmol clang-format -ver <llvm-version>

Format source files using clang-format.

options:
-h Show this help message.
-ver LLVM/clang-format version to use.
"@
};
genbindings = @{
proc = (Join-Path $PSScriptRoot 'plugins/genbindings.ps1');
usage = @"
usage: axmol genbindings

Generate Lua bindings for axmol engine.

options:
-h Show this help message.
"@
};
'build-docs' = @{
proc = (Join-Path $PSScriptRoot 'plugins/build-docs.ps1');
usage = @"
usage: axmol build-docs

Build axmol documentation.

options:
-h Show this help message.
"@
};
publish = @{
proc = (Join-Path $PSScriptRoot 'plugins/publish.ps1');
usage = @"
usage: axmol publish -version <ver>

Publish axmol release.

options:
-h Show this help message.
-version Release version to publish.
"@
}
}
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $isWin = $IsWindows -or ("$env:OS" -eq 'Windows_NT')

$pwsh_ver = $PSVersionTable.PSVersion.ToString()

$AX_ROOT = (Resolve-Path $PSScriptRoot/../..)
$AX_ROOT = (Resolve-Path $PSScriptRoot/../../..)

$git_prog = (Get-Command 'git' -ErrorAction SilentlyContinue).Source
if (!$git_prog) {
Expand Down
4 changes: 2 additions & 2 deletions tools/cmdline/build.ps1 → tools/cmdline/plugins/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ if ($options.xc -isnot [array]) {
[array]$options.xc = (translate_array_opt $options.xc)
}

$AX_ROOT = (Resolve-Path $PSScriptRoot/../..).Path
$AX_ROOT = (Resolve-Path $PSScriptRoot/../../..).Path
$workDir = $(Get-Location).Path
if (Test-Path (Join-Path $AX_ROOT 'axmol/axmolver.h.in') -PathType Leaf) {
$env:AX_ROOT = $AX_ROOT
Expand Down Expand Up @@ -196,7 +196,7 @@ else {
# android gradle
# engine ci
if ($is_axmol_engine) {
$options.xc += "-PKEY_STORE_FILE=$AX_ROOT/tools/cmdline/axmol-ci.jks", '-PKEY_STORE_PASSWORD=axmol-ci', '-PKEY_ALIAS=axmol-ci', '-PKEY_PASSWORD=axmol-ci'
$options.xc += "-PKEY_STORE_FILE=$AX_ROOT/tools/cmdline/plugins/axmol-ci.jks", '-PKEY_STORE_PASSWORD=axmol-ci', '-PKEY_ALIAS=axmol-ci', '-PKEY_PASSWORD=axmol-ci'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ else {

&$tool_cmd --version

$AX_ROOT = $(Resolve-Path $PSScriptRoot/../..).Path
$AX_ROOT = $(Resolve-Path $PSScriptRoot/../../..).Path
Push-Location $AX_ROOT

$sourceDirs = @('./axmol', './extensions', './tests', './templates')
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

$ErrorActionPreference = 'Stop'

$AX_ROOT = Resolve-Path "$PSScriptRoot/../.."
$AX_ROOT = Resolve-Path "$PSScriptRoot/../../.."

$SearchDirs = @(
(Join-Path $AX_ROOT "axmol"),
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ param(
$stage = 3
)

$AX_ROOT = (Resolve-Path $PSScriptRoot/../..).Path
$AX_ROOT = (Resolve-Path $PSScriptRoot/../../..).Path

$succeed = $true
if (($stage -band 1)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ param(
$commitish = $null
)

$AX_ROOT = (Resolve-Path $PSScriptRoot/../..).Path
$AX_ROOT = (Resolve-Path $PSScriptRoot/../../..).Path
if ($commitish) {
echo "Creating package from revision: $commitish"
git -C $AX_ROOT checkout $commitish
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

$ErrorActionPreference = 'Stop'

$AX_ROOT = Resolve-Path "$PSScriptRoot/../.."
$AX_ROOT = Resolve-Path "$PSScriptRoot/../../.."

# ============================================================
# Check 1: Forbidden C++ wrapper C headers
Expand Down
2 changes: 1 addition & 1 deletion tools/tolua/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
How to Use bindings-generator
==================

In the current release, the `tools/cmdline/genbindings.ps1` serves as a compromise solution: the script invokes the existing genbindings.py (tested with Python 3.12.x on Windows) and performs a cleanup step to remove duplicated empty lines in generated C++ Lua binding sources.
In the current release, the `tools/cmdline/plugins/genbindings.ps1` serves as a compromise solution: the script invokes the existing genbindings.py (tested with Python 3.12.x on Windows) and performs a cleanup step to remove duplicated empty lines in generated C++ Lua binding sources.
For v3, we plan to fully re‑implement the Lua binding generator in PowerShell, eliminating the Python dependency and providing a native, streamlined workflow.