Skip to content

Commit c455964

Browse files
authored
Merge pull request EvilBeaver#1669 from johnnyshut/docs/update-202604
docs: актуализация документации проекта (.NET 8, корректные пути, дописанные разделы)
2 parents 49387e2 + f8af9ef commit c455964

4 files changed

Lines changed: 499 additions & 264 deletions

File tree

README-EN.md

Lines changed: 65 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,50 +57,97 @@ The OneScript distribution already includes a set of the most commonly used pack
5757

5858
## Preparation
5959

60-
Links to distributions are provided below, however, please note that links may change over time and their relevance is not guaranteed. You need dotnet SDK and C++ compiler, which can be downloaded from anywhere you can find.
60+
To build the project you need:
6161

62-
* Install [MS BuildTools](https://visualstudio.microsoft.com/ru/thank-you-downloading-visual-studio/?sku=buildtools&rel=16), when installing enable targeting for .net6, .net4.8, install C++ compiler.
62+
* [.NET SDK 8.0](https://dotnet.microsoft.com/download/dotnet/8.0) (the project's target framework is `net8.0`).
63+
* A C++ compiler — only required to build the native bridge `ScriptEngine.NativeApi` (support for native add-ins compatible with the 1C NativeApi). On Windows the easiest way to get one is to install [MS Build Tools](https://visualstudio.microsoft.com/visual-studio-build-tools/) or Visual Studio with the "Desktop development with C++" workload. If a C++ compiler is not available, see the `NoCppCompiler` parameter below.
64+
65+
> Distribution links may change over time, their relevance is not guaranteed.
6366
6467
## Build
6568

66-
Launch Developer Command Prompt (will appear in the Start menu after installing MSBuildTools or Visual Studio). Navigate to the OneScript repository directory. The following are commands in the Developer Command Prompt console.
67-
Build is performed using msbuild. Targets:
69+
The build is driven by MSBuild via the `Build.csproj` script in the repository root. Commands can be run with `msbuild` (Developer Command Prompt installed together with MS Build Tools/Visual Studio) or with `dotnet msbuild` (cross-platform).
70+
71+
Main targets:
6872

69-
* CleanAll - clean previous build results
70-
* BuildAll - prepare files for distribution
71-
* MakeCPP;MakeFDD;MakeSCD;BuildDebugger - separate build targets for preparing different types of distributions
72-
* PrepareDistributionFiles - build full distribution packages (including libraries)
73-
* PackDistributions - prepare ZIP archives for distribution
74-
* CreateNuget - create packages for publishing to NuGet
73+
* `CleanAll` — clean previous build results;
74+
* `BuildAll` — build binary files for distribution (FDD, SCD, debugger; native components are also built when a C++ compiler is available);
75+
* `MakeCPP`, `MakeFDD`, `MakeSCD`, `BuildDebugger` — individual targets that build specific parts of the distribution;
76+
* `GatherLibrary` — download and stage the base set of libraries (`opm`, `asserts`, `logos`, `fs`, `tempfiles`, `cli`);
77+
* `PrepareDistributionFiles` — build full distribution contents (including libraries and documentation);
78+
* `PackDistributions` — pack the distribution contents into ZIP archives for all supported platforms;
79+
* `BuildDocumentation` — generate the platform reference (markdown + json);
80+
* `CreateNuget` / `PublishNuget` — build and publish NuGet packages;
81+
* `Test` (`UnitTests`, `ScriptedTests`) — run unit and acceptance (BSL) tests.
7582

7683
**Build parameters**
7784

78-
* VersionPrefix - release number prefix, its main part, for example, 2.0.0
79-
* VersionSuffix - version suffix, which usually acts as an arbitrary versioning suffix according to semver, for example, beta-786 (optional)
80-
* NoCppCompiler - if True - C++ compiler is not installed, C++ components (NativeApi support) will not be added to the build
85+
* `VersionPrefix` — main part of the release number, for example `2.0.0` (defaults to `2.0.0`);
86+
* `VersionSuffix` — optional SemVer suffix, for example `beta-786`;
87+
* `NoCppCompiler` — when set to `True`, native C++ components (NativeApi) are not built and not included in the distribution (use it when no C++ compiler is installed);
88+
* `Configuration` — build configuration, defaults to `Release`. For a debug build on Linux use `LinuxDebug`.
8189

82-
All distribution files will be placed in the `built` directory at the root of the 1Script repository
90+
All build artifacts are placed in the `built` directory at the repository root.
8391

8492
### Building distribution contents in a separate directory
8593

8694
```bat
87-
msbuild Build.csproj /t:CleanAll;PrepareDistributionFiles
95+
dotnet msbuild Build.csproj /t:CleanAll;PrepareDistributionFiles
8896
```
8997

9098
### Building with manual version specification
9199

92100
```bat
93-
msbuild Build.csproj /t:CleanAll;PrepareDistributionFiles /p:VersionPrefix=2.0.0
101+
dotnet msbuild Build.csproj /t:CleanAll;PrepareDistributionFiles /p:VersionPrefix=2.0.0
94102
```
95103

96104
### Building ZIP distributions
97105

98106
```bat
99-
msbuild Build.csproj /t:CleanAll;PrepareDistributionFiles;PackDistributions /p:VersionPrefix=2.0.0 /p:VersionSuffix=preview223
107+
dotnet msbuild Build.csproj /t:CleanAll;PrepareDistributionFiles;PackDistributions /p:VersionPrefix=2.0.0 /p:VersionSuffix=preview223
108+
```
109+
110+
### Building without C++ components (no NativeApi)
111+
112+
```bat
113+
dotnet msbuild Build.csproj /t:CleanAll;PrepareDistributionFiles /p:NoCppCompiler=True
100114
```
101115

102116
### Documentation generation
103117

104118
```bat
105-
msbuild Build.csproj /t:BuildDocumentation
119+
dotnet msbuild Build.csproj /t:BuildDocumentation
106120
```
121+
122+
# Testing
123+
124+
The project has two layers of tests:
125+
126+
* **C# unit tests** — located in `src/Tests/*` (xUnit/NUnit). Run them via `dotnet test` in the corresponding test project directory or all at once:
127+
```bat
128+
dotnet msbuild Build.csproj /t:UnitTests
129+
```
130+
* **BSL acceptance tests** — located in the `tests/` directory and executed by `testrunner.os` against a freshly built `oscript`. The repository includes wrapper scripts:
131+
```bat
132+
rem Windows
133+
tests\run-bsl-tests.cmd src\oscript\bin\Debug\net8.0\oscript.exe
134+
```
135+
136+
```bash
137+
# Linux/macOS
138+
tests/run-bsl-tests.sh src/oscript/bin/Debug/net8.0/oscript
139+
```
140+
141+
Before running the acceptance tests, build `oscript`:
142+
```bat
143+
dotnet build src/oscript/oscript.csproj
144+
```
145+
146+
# Developer documentation
147+
148+
If you want to contribute to the project, take a look at the additional documents in the [`docs/`](docs/) directory:
149+
150+
* [`docs/developer_docs.md`](docs/developer_docs.md) — project architecture, solution layout and guided tour of the source code.
151+
* [`docs/contexts.md`](docs/contexts.md) — a practical guide to adding BSL contexts, methods, properties and global functions.
152+
* [`CODESTYLE.md`](CODESTYLE.md) — C# code style requirements.
153+

README.md

Lines changed: 65 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -57,50 +57,96 @@ OneScript позволяет создавать и выполнять текст
5757

5858
## Подготовка
5959

60-
Ниже приведены ссылки на дистрибутивы, однако, учтите, что ссылки могут меняться со временем и их актуальность не гарантируется. Нужен dotnet SDK и компилятор C++, скачать можно из любого места, которое нагуглится.
60+
Для сборки потребуется:
6161

62-
* Установить [MS BuildTools](https://visualstudio.microsoft.com/ru/thank-you-downloading-visual-studio/?sku=buildtools&rel=16), при установке включить таргетинг на .net6, .net4.8, установить компилятор C++.
62+
* [.NET SDK 8.0](https://dotnet.microsoft.com/download/dotnet/8.0) (целевой фреймворк проекта — `net8.0`).
63+
* Компилятор C++ — нужен только для сборки нативного моста `ScriptEngine.NativeApi` (поддержка внешних компонент стандарта 1С NativeApi). На Windows проще всего получить его, поставив [MS Build Tools](https://visualstudio.microsoft.com/visual-studio-build-tools/) или Visual Studio с компонентом «Разработка классических приложений на C++». Если C++ компилятора нет, см. параметр `NoCppCompiler` ниже.
64+
65+
> Ссылки на дистрибутивы могут меняться со временем, их актуальность не гарантируется.
6366
6467
## Сборка
6568

66-
Запустить Developer Command Prompt (появится в меню Пуск после установки MSBuildTools или Visual Studio). Перейти в каталог репозитория OneScript. Далее приведены команды в консоли Developer Command Prompt
67-
Сборка выполняется с помощью msbuild. Таргеты:
69+
Сборка выполняется с помощью MSBuild и сценария `Build.csproj` в корне репозитория. Команды можно запускать как через `msbuild` (Developer Command Prompt после установки MS Build Tools/Visual Studio), так и через `dotnet msbuild` (кросс-платформенно).
70+
71+
Основные таргеты:
6872

69-
* CleanAll - очистка результатов предыдущих сборок
70-
* BuildAll - подготовить файлы для поставки
71-
* MakeCPP;MakeFDD;MakeSCD;BuildDebugger - отдельные таргеты сборки для подготовки разных типов поставки
72-
* PrepareDistributionFiles - сборка полных пакетов поставки (включая библиотеки)
73-
* PackDistributions - подготовка ZIP архивов поставки
74-
* CreateNuget - создать пакеты для публикации в NuGet
73+
* `CleanAll` — очистка результатов предыдущих сборок;
74+
* `BuildAll` — собрать бинарные файлы для поставки (FDD, SCD, отладчик; при наличии C++ — нативные компоненты);
75+
* `MakeCPP`, `MakeFDD`, `MakeSCD`, `BuildDebugger` — отдельные таргеты сборки разных частей поставки;
76+
* `GatherLibrary` — скачать и сложить базовый набор библиотек (`opm`, `asserts`, `logos`, `fs`, `tempfiles`, `cli`);
77+
* `PrepareDistributionFiles` — собрать полные содержимые дистрибутивов (вкл. библиотеки и документацию);
78+
* `PackDistributions` — упаковать содержимое в ZIP-архивы под все поддерживаемые платформы;
79+
* `BuildDocumentation` — сгенерировать справку по платформе (markdown + json);
80+
* `CreateNuget` / `PublishNuget` — собрать и опубликовать NuGet-пакеты;
81+
* `Test` (`UnitTests`, `ScriptedTests`) — прогнать модульные и приёмочные (BSL) тесты.
7582

7683
**Параметры сборки**
7784

78-
* VersionPrefix - префикс номера релиза, его основная часть, например, 2.0.0
79-
* VersionSuffix - суффикс номера, который обычно выступает в качестве произвольного суффикса версионирования по semver, например, beta-786 (необязателен)
80-
* NoCppCompiler - если True - не установлен компилятор C++, в сборку не будут добавлены компоненты C++ (поддержка NativeApi)
85+
* `VersionPrefix` — основная часть номера релиза, например `2.0.0` (по умолчанию `2.0.0`);
86+
* `VersionSuffix` — необязательный suffix по SemVer, например `beta-786`;
87+
* `NoCppCompiler` — если `True`, нативные компоненты C++ (NativeApi) не собираются и не включаются в дистрибутив (используйте, если компилятор C++ не установлен);
88+
* `Configuration` — конфигурация сборки, по умолчанию `Release`. Для отладочной сборки на Linux используется `LinuxDebug`.
8189

82-
Все поставляемые файлы будут размещены в каталоге `built` в корне репозитория 1Script
90+
Все артефакты сборки размещаются в каталоге `built` в корне репозитория.
8391

8492
### Сборка содержимого дистрибутивов в отдельном каталоге
8593

8694
```bat
87-
msbuild Build.csproj /t:CleanAll;PrepareDistributionFiles
95+
dotnet msbuild Build.csproj /t:CleanAll;PrepareDistributionFiles
8896
```
8997

9098
### Сборка с ручным указанием версии
9199

92100
```bat
93-
msbuild Build.csproj /t:CleanAll;PrepareDistributionFiles /p:VersionPrefix=2.0.0
101+
dotnet msbuild Build.csproj /t:CleanAll;PrepareDistributionFiles /p:VersionPrefix=2.0.0
94102
```
95103

96104
### Сборка ZIP-дистрибутивов
97105

98106
```bat
99-
msbuild Build.csproj /t:CleanAll;PrepareDistributionFiles;PackDistributions /p:VersionPrefix=2.0.0 /p:VersionSuffix=preview223
107+
dotnet msbuild Build.csproj /t:CleanAll;PrepareDistributionFiles;PackDistributions /p:VersionPrefix=2.0.0 /p:VersionSuffix=preview223
108+
```
109+
110+
### Сборка без C++-компонент (без NativeApi)
111+
112+
```bat
113+
dotnet msbuild Build.csproj /t:CleanAll;PrepareDistributionFiles /p:NoCppCompiler=True
100114
```
101115

102116
### Генерация документации
103117

104118
```bat
105-
msbuild Build.csproj /t:BuildDocumentation
106-
```
119+
dotnet msbuild Build.csproj /t:BuildDocumentation
120+
```
121+
122+
# Тестирование
123+
124+
В проекте есть два уровня тестов:
125+
126+
* **Модульные тесты на C#** — расположены в `src/Tests/*` (xUnit/NUnit), запускаются через `dotnet test` в каталоге соответствующего тестового проекта или одной командой:
127+
```bat
128+
dotnet msbuild Build.csproj /t:UnitTests
129+
```
130+
* **Приёмочные тесты на BSL** — расположены в каталоге `tests/` и запускаются через `testrunner.os` на свежесобранном `oscript`. Для удобства в репозитории есть скрипты-обёртки:
131+
```bat
132+
rem Windows
133+
tests\run-bsl-tests.cmd src\oscript\bin\Debug\net8.0\oscript.exe
134+
```
135+
136+
```bash
137+
# Linux/macOS
138+
tests/run-bsl-tests.sh src/oscript/bin/Debug/net8.0/oscript
139+
```
140+
141+
Перед запуском приёмочных тестов нужно собрать `oscript`:
142+
```bat
143+
dotnet build src/oscript/oscript.csproj
144+
```
145+
146+
# Документация для разработчиков
147+
148+
Если вы хотите контрибьютить в проект, познакомьтесь с дополнительными документами в каталоге [`docs/`](docs/):
149+
150+
* [`docs/developer_docs.md`](docs/developer_docs.md) — архитектура проекта, состав решения и навигация по исходному коду.
151+
* [`docs/contexts.md`](docs/contexts.md) — практическое руководство по добавлению BSL-контекстов, методов, свойств и глобальных функций.
152+
* [`CODESTYLE.md`](CODESTYLE.md) — требования к стилю кода на C#.

0 commit comments

Comments
 (0)