Difference between revisions of "Quick Start/en"

From Ciliz|W4
(Created page with "# Start VSCode and install Remote WSL extension # Connect to Debian WSL # Open SDK workspace # Install All recomemended extensions # Reload IDE and work with code")
 
 
(34 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<languages />
+
W4 SDK DEMO Launch Procedure.
Working with the engine on the example of running and debugging Soccer application.
 
 
== Setup environment == <!--T:2-->
 
== Setup environment == <!--T:2-->
The project uses OS Debian. Before you begin, you must complete the following steps (or make sure they are completed).
+
The project uses Debian OS, if it is already installed, you can go directly to the ''Debian environment settings'' section. For MS Windows, you must follow these steps (or make sure they are completed).
=== Windows ===
 
==== Install Windows Terminal ====
 
''Не обязательно использовать именно Windows Terminal, если у вас установлен другой и вы знаете как с ним работать, можете пропустить этот раздел.''
 
  
# Загрузите установщик последней стабильной версии со [https://github.com/microsoft/terminal/releases страницы проекта] (ссылка на загрузку находится в раскрывающимся списке Assets под перечнем изменений).
+
=== Install Windows Terminal ===
# Установите приложение (установка Windows Terminal не имеет каких-либо особенностей).
+
https://paper-attachments.dropbox.com/s_0034A86D613416109E895A76DA7A4F66C33EEAB8671A5C439351EC00BAE5D5EC_1581002573663_.png
# Настройте Windows Terminal. Настройка производится через изменение settings.json. В общем случае он располагается в каталоге LocalAppData\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\ . [https://gist.github.com/donkaban/3e9275f87c81e6ef5dbeb98aa5b96ee5 Пример настроек].
+
 
Подробнее о настройке см. в [https://github.com/microsoft/terminal/blob/master/doc/user-docs/UsingJsonSettings.md документации Windows Terminal].
+
It is not obliged to use Windows Terminal if you prefer another tool skip this section.
 +
 
 +
# Download the latest stable version of the installer from [https://github.com/microsoft/terminal/releases the project page] (the download link is in the Assets drop-down list under the changelog)and install the application.
 +
# You can configure Windows Terminal by changing the settings.json file. In general, it is located in the directory LocalAppData\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\ or similar one.
 +
See [https://github.com/microsoft/terminal/blob/master/doc/user-docs/UsingJsonSettings.md the Windows Terminal documentation] for more information about customization.
 +
 
 +
 
 +
=== Install WSL ===
 +
To run a Debian image on Windows, use Windows Subsystem for Linux (WSL). It is recommended that you use WSL2, which requires Windows 10 build 18917 or later. If you have an old build of Windows 10, then you can work with WSL1. The difference is that on WSL1, some operations are much slower than on WSL2.
 +
 
 +
Follow these steps:
 +
* Check / Enable the WSL component. To do this, in [https://docs.microsoft.com/en-us/powershell/?view=powershell-7 PowerShell], run the command:
 +
  dism.exe / online / enable-feature / featurename: Microsoft-Windows-Subsystem-Linux / all / norestart
 +
* If you can use WSL2, then also use the Virtual Machine Platform component:
 +
  dism.exe / online / enable-feature / featurename: VirtualMachinePlatform / all / norestart
 +
* Reboot the system to complete the installation of components.
 +
 
 +
=== Install Debian WSL Image ===
 +
To add a Debian image, download and install the [https://www.microsoft.com/en-us/p/debian/9msvkqc78pk6?activetab=pivot:regionofsystemrequirementstab Debian application from the Microsoft Store].
 +
 
 +
If you use WSL2, initialize the distribution with the command (for WSL1 skip this item):
 +
wsl --set-version Debian 2
  
Терминал запускается как обычное приложение Windows (т.е. через меню Пуск).
 
==== Install WSL ====
 
Для запуска образа Debian под Windows используется Windows Subsystem for Linux (WSL). Рекомендуется использовать WSL2, для которой требуется Windows 10 build 18917 или более поздняя. Если у вас старая сборка Windows 10, то можно работать с WSL1. Разница в том, что на WSL1 некоторые операции выполняются значительно медленнее, чем на WSL2.
 
# Проверьте/Задействуйте компонент WSL. Для этого в PowerShell выполните команду: ''dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart''
 
# Для дальнейшей установки WSL2 задействуйте также компонент Virtual Machine Platform:
 
''dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart''
 
# Перезагрузите систему для завершения установки компонентов.
 
==== Install Debian WSL Image ====
 
Для того чтобы добавить образ Debian, загрузите приложение из  [https://www.microsoft.com/en-us/p/debian/9msvkqc78pk6?activetab=pivot:regionofsystemrequirementstab Microsoft Store].
 
Если используется WSL2, инициализируйте дистрибутив командой: ''wsl --set-version Debian 2''
 
=== Mac OS ===
 
???
 
=== Install Visual Studio Code ===
 
[https://code.visualstudio.com/ Загрузите и установите VSCode для вашей ОС].
 
 
== Debian environment settings ==
 
== Debian environment settings ==
Запустите Debian instance (например, через меню Windows Terminal).
+
If you are working from another OS, start Debian (for example, through the Windows Terminal menu).
При первом запуске необходимо задать имя пользователя и пароль для входа в систему.
+
At the first start, you will be asked to set a username and password for logging in.
Также рекомендуется установить последние обновления системы выполнив следующие команды:
+
 
 +
It is recommended to install the latest system updates by running the following commands:
 
  sudo apt-get update  
 
  sudo apt-get update  
 
  sudo apt-get upgrade
 
  sudo apt-get upgrade
 +
 +
=== Install Midnight Commander ===
 +
If you are not comfortable working with files from the command line, install Midnight Commander.
 +
sudo apt-get install mc
 +
 
=== Install Git ===
 
=== Install Git ===
Установите Git:
+
Install Git application:
 
  sudo apt-get install git
 
  sudo apt-get install git
 
=== Clone SDK ===
 
=== Clone SDK ===
Клонируйте репозиторий с SDK:
+
Before the first call to the repository required [https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html generate SSH key and add the public key in your account on Bitbucket]. The same key must be sent to the W4 team to gain access.
  git clone git@bitbucket.org:ciliz2/w4-sdk.git
+
 
 +
''Note. Instead of generating a new key, you can use the existing key by copying the public and private parts to the .ssh directory of the Debian user home directory and setting access permissions to the key file with the command'' chmod =600 ~/.ssh/id_rsa
 +
Clone the SDK repository:
 +
  git clone git@bitbucket.org:ciliz2/w4-sdk-demo.git
  
 
=== Install SDK prerequisites ===
 
=== Install SDK prerequisites ===
''Если ваш проект требует node web server, его также можно установить.''
+
To get started with the SDK, go to the directory:
Для начала работы с SDK выполните следующие команды:
+
  cd w4-sdk-demo
  cd w4-sdk
+
Run the command:
  ./w4-prereq --install
+
  ./w4 --prereq
 +
Reload Debian instance or subshell. Then run the command:
 
  npm -g install serve
 
  npm -g install serve
Перезагрузите Debian instance или subshell.
+
'' You may also need to install node web server if it is needed for your project. ''
 
== Build ==
 
== Build ==
Для сборки проекта выполните одну из следующих команд
+
''If you are using WSL1, the build process can take more time.''
''При использовании WSL1 процесс сборки может быть долгим.''
+
 
*Собрать дебаг версию: ./w4-build --build-debug
+
To build the project, use the following commands (when you are located in the directory ''w4-sdk-demo''):
*Собрать резизную версию: ./w4-build --build-release
+
* Delete the results of the previous assembly: '''./w4 --clean'''
*Собрать продакшн версию: ./w4-build --build-shiped
+
* Build the project (release version): '''./w4 --build'''
 +
 
 
== Test Run ==
 
== Test Run ==
Запустите локальный веб-сервер:
+
Start webserver:
  cd bin
+
  cd deploy
 
  serve -l 8080
 
  serve -l 8080
Проверьте игру через браузер, набрав в адресной строке ''http://localhost:8080/''
+
Check the game through the browser by typing in the address bar:
== VSCode as IDE ==
+
http://localhost:8080/
=== Initial setup ===
+
 
 +
== Edit source code ==
 +
Here is some general information on working with the SDK. More details about working with the code can be found on the [[SDK Experiments]] page.
 +
 
 +
You can use any convenient environment to work with the code. The following describes the installation and configuration of Visual Studio Code, as this solution allows you to directly work with code in Debian Instance, when launched from your OS.
 +
=== VSCode as IDE ===
 +
==== Install Visual Studio Code ====
 +
[https://code.visualstudio.com/ Download and install VSCode for your OS].
 +
==== Initial setup ====
 
# Start VSCode and install Remote WSL extension  
 
# Start VSCode and install Remote WSL extension  
 
# Connect to Debian WSL
 
# Connect to Debian WSL
# Open SDK workspace
+
# Open SDK workspace (specify the directory where the w4.code-workspace file is located in the cloned repository)
# Install All recomemended extensions
+
# Install All recommended extensions
 
# Reload IDE and work with code
 
# Reload IDE and work with code

Latest revision as of 08:41, 21 May 2020

W4 SDK DEMO Launch Procedure.

Setup environment

The project uses Debian OS, if it is already installed, you can go directly to the Debian environment settings section. For MS Windows, you must follow these steps (or make sure they are completed).

Install Windows Terminal

s_0034A86D613416109E895A76DA7A4F66C33EEAB8671A5C439351EC00BAE5D5EC_1581002573663_.png

It is not obliged to use Windows Terminal if you prefer another tool skip this section.

  1. Download the latest stable version of the installer from the project page (the download link is in the Assets drop-down list under the changelog)and install the application.
  2. You can configure Windows Terminal by changing the settings.json file. In general, it is located in the directory LocalAppData\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\ or similar one.

See the Windows Terminal documentation for more information about customization.


Install WSL

To run a Debian image on Windows, use Windows Subsystem for Linux (WSL). It is recommended that you use WSL2, which requires Windows 10 build 18917 or later. If you have an old build of Windows 10, then you can work with WSL1. The difference is that on WSL1, some operations are much slower than on WSL2.

Follow these steps:

  • Check / Enable the WSL component. To do this, in PowerShell, run the command:
 dism.exe / online / enable-feature / featurename: Microsoft-Windows-Subsystem-Linux / all / norestart
  • If you can use WSL2, then also use the Virtual Machine Platform component:
 dism.exe / online / enable-feature / featurename: VirtualMachinePlatform / all / norestart
  • Reboot the system to complete the installation of components.

Install Debian WSL Image

To add a Debian image, download and install the Debian application from the Microsoft Store.

If you use WSL2, initialize the distribution with the command (for WSL1 skip this item):

wsl --set-version Debian 2

Debian environment settings

If you are working from another OS, start Debian (for example, through the Windows Terminal menu). At the first start, you will be asked to set a username and password for logging in.

It is recommended to install the latest system updates by running the following commands:

sudo apt-get update 
sudo apt-get upgrade

Install Midnight Commander

If you are not comfortable working with files from the command line, install Midnight Commander.

sudo apt-get install mc

Install Git

Install Git application:

sudo apt-get install git

Clone SDK

Before the first call to the repository required generate SSH key and add the public key in your account on Bitbucket. The same key must be sent to the W4 team to gain access.

Note. Instead of generating a new key, you can use the existing key by copying the public and private parts to the .ssh directory of the Debian user home directory and setting access permissions to the key file with the command chmod =600 ~/.ssh/id_rsa Clone the SDK repository:

git clone git@bitbucket.org:ciliz2/w4-sdk-demo.git

Install SDK prerequisites

To get started with the SDK, go to the directory:

cd w4-sdk-demo

Run the command:

./w4 --prereq

Reload Debian instance or subshell. Then run the command:

npm -g install serve

You may also need to install node web server if it is needed for your project.

Build

If you are using WSL1, the build process can take more time.

To build the project, use the following commands (when you are located in the directory w4-sdk-demo):

  • Delete the results of the previous assembly: ./w4 --clean
  • Build the project (release version): ./w4 --build

Test Run

Start webserver:

cd deploy
serve -l 8080

Check the game through the browser by typing in the address bar:

http://localhost:8080/

Edit source code

Here is some general information on working with the SDK. More details about working with the code can be found on the SDK Experiments page.

You can use any convenient environment to work with the code. The following describes the installation and configuration of Visual Studio Code, as this solution allows you to directly work with code in Debian Instance, when launched from your OS.

VSCode as IDE

Install Visual Studio Code

Download and install VSCode for your OS.

Initial setup

  1. Start VSCode and install Remote WSL extension
  2. Connect to Debian WSL
  3. Open SDK workspace (specify the directory where the w4.code-workspace file is located in the cloned repository)
  4. Install All recommended extensions
  5. Reload IDE and work with code