2019-11-23 20:27:39 +08:00
|
|
|
How to Use bindings-generator
|
|
|
|
==================
|
|
|
|
|
|
|
|
On Windows:
|
|
|
|
------------
|
|
|
|
|
2023-02-14 23:10:28 +08:00
|
|
|
* Make sure that you have installed `android-ndk-r19c` or later.
|
|
|
|
* Install python3.7+(64bit) from https://www.python.org with `Add to 'PATH'` install option.
|
2021-04-22 22:01:47 +08:00
|
|
|
* Install python dependices by pip.
|
|
|
|
<pre>
|
2023-02-14 23:10:28 +08:00
|
|
|
pip install PyYAML Cheetah3
|
2021-04-22 22:01:47 +08:00
|
|
|
</pre>
|
|
|
|
* Go to "tools/tolua" folder, and run "genbindings.py". The generated codes will be under "cocos\scripting\auto-generated\lua-bindings".
|
2019-11-23 20:27:39 +08:00
|
|
|
|
|
|
|
On MAC:
|
|
|
|
----------
|
|
|
|
|
2023-02-14 23:10:28 +08:00
|
|
|
* Use [Homebrew](http://brew.sh/) to install the python and use pip install the python dependencies.
|
2019-11-23 20:27:39 +08:00
|
|
|
<pre>
|
2023-02-14 23:10:28 +08:00
|
|
|
brew install python3
|
2019-11-23 20:27:39 +08:00
|
|
|
</pre>
|
|
|
|
|
2023-02-14 23:10:28 +08:00
|
|
|
* Install python dependices by pip3.
|
2019-11-23 20:27:39 +08:00
|
|
|
<pre>
|
2023-02-14 23:10:28 +08:00
|
|
|
pip3 install PyYAML Cheetah3
|
2019-11-23 20:27:39 +08:00
|
|
|
</pre>
|
|
|
|
|
2023-02-14 23:10:28 +08:00
|
|
|
* Download NDK 64bit r19c or later from [Android Ndk](https://developer.android.com/ndk/downloads/index.html)
|
2019-11-23 20:27:39 +08:00
|
|
|
* Run
|
|
|
|
<pre>
|
2023-02-14 23:10:28 +08:00
|
|
|
export ANDROID_NDK=/path/to/android-ndk-19c
|
2019-11-23 20:27:39 +08:00
|
|
|
./genbindings.py
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
|
2023-02-14 23:10:28 +08:00
|
|
|
On Ubuntu Linux 22.04 64bit
|
2019-11-23 20:27:39 +08:00
|
|
|
------------
|
|
|
|
|
|
|
|
* Install python
|
|
|
|
<pre>
|
2023-02-14 23:10:28 +08:00
|
|
|
sudo apt-get install python3
|
2019-11-23 20:27:39 +08:00
|
|
|
</pre>
|
|
|
|
* Install python dependices by pip.
|
|
|
|
<pre>
|
2023-02-14 23:10:28 +08:00
|
|
|
sudo apt-get install python3-pip
|
|
|
|
sudo pip3 install PyYAML Cheetah3
|
2019-11-23 20:27:39 +08:00
|
|
|
</pre>
|
2023-02-14 23:10:28 +08:00
|
|
|
* Download NDK 64bit r19c or later from [Android Ndk](https://developer.android.com/ndk/downloads/index.html)
|
2021-04-22 22:01:47 +08:00
|
|
|
* Go to "tools/tolua", Run
|
2019-11-23 20:27:39 +08:00
|
|
|
<pre>
|
2023-02-14 23:10:28 +08:00
|
|
|
export ANDROID_NDK=/path/to/android-ndk-r19c
|
|
|
|
python3 ./genbindings.py
|
2019-11-23 20:27:39 +08:00
|
|
|
</pre>
|