Skip to content

Commit 89cdeef

Browse files
committed
Слияние с develop
2 parents 67edf3a + 69ec2b9 commit 89cdeef

File tree

416 files changed

+6112
-11469
lines changed

Some content is hidden

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

416 files changed

+6112
-11469
lines changed

.cursor/rules/langversion.mdc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
alwaysApply: true
3+
---
4+
5+
Проект использует .net 8.0 и LangVersion 8, поэтому при генерации кода не используй языковые фичи C#, которые отсутствуют в C# 8.

.cursor/rules/runbsltests.mdc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
description: When you need to run main tests
3+
alwaysApply: false
4+
---
5+
6+
Когда тебе потребуется запустить приемочные тесты всего проекта, убедиться что ничего не сломано, тебе потребуется запустить bsl тесты. Для этого используются готовые скрипты:
7+
8+
1. **ОБЯЗАТЕЛЬНО** собери консольное приложение oscript из исходников с последними изменениями:
9+
10+
```
11+
dotnet build src/oscript/oscript.csproj
12+
```
13+
14+
После сборки движок будет находиться здесь:
15+
- Windows: `src\oscript\bin\Debug\net8.0\oscript.exe`
16+
- Linux/macOS: `src/oscript/bin/Debug/net8.0/oscript`
17+
18+
**КРИТИЧЕСКИ ВАЖНО**: Тесты должны запускаться только на свежесобранном oscript, а не на версии из системы! Это гарантирует, что тесты валидируют актуальный код после внесённых изменений.
19+
20+
2. Запусти нужный скрипт, **ЯВНО** передав путь к свежесобранному движку:
21+
- Windows: `tests\run-bsl-tests.cmd src\oscript\bin\Debug\net8.0\oscript.exe`
22+
- Linux/macOS: `tests/run-bsl-tests.sh src/oscript/bin/Debug/net8.0/oscript`
23+
24+
**ВАЖНО**: Не полагайся на автоматический поиск oscript в PATH — всегда указывай путь к свежесобранному бинарнику первым параметром!
25+
26+
Оба скрипта автоматически:
27+
- Устанавливают путь к библиотекам OVM через переменную `OVM_LIB_PATH` (по умолчанию `%USERPROFILE%\AppData\Local\ovm\current\lib` для Windows и `$HOME/.local/share/ovm/current/lib` для Linux/macOS)
28+
- Настраивают `OSCRIPT_CONFIG=lib.system=<OVM_LIB_PATH>`, если эта переменная не была задана заранее
29+
- Переходят в каталог `tests` и выполняют `testrunner.os -runAll .`
30+
31+
3. Для запуска одного теста также используй свежесобранный oscript.exe: `<путь\к\собранному\oscript.exe> testrunner.os -run <имя файла теста.os>`.
32+
4. Всегда используй для запуска тестов новую консоль, не переиспользуй консоль от предыдущих запусков.
33+
5. Если ошибка запуска тестов связана с Component.dll или NativeApi (эти dll упоминаются в ошибках тестов), то такие тесты следует игнорировать и смотреть только на другие ошибки тестов.
34+
6. Ошибки теста http.os и "Тест_ДолженПроверитьЧтоПеремещениеФайлаРаботаетПоHTTP" следует игнорировать.

.github/workflows/copilot-setup-steps.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ jobs:
1717
# Setup steps for OneScript development environment
1818
steps:
1919
- name: Checkout code
20-
uses: actions/checkout@v5
20+
uses: actions/checkout@v6
2121

2222
- run: git config --global core.quotepath false
2323

24-
- uses: actions/setup-dotnet@v4
24+
- uses: actions/setup-dotnet@v5
2525
with:
26-
dotnet-version: '6.0.x'
26+
dotnet-version: '8.0.x'
2727

2828
- name: Установка OneScript
2929
uses: otymko/[email protected]

.github/workflows/rebase.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout the latest code
12-
uses: actions/checkout@v5
12+
uses: actions/checkout@v6
1313
with:
1414
token: ${{ secrets.GITHUB_TOKEN }}
1515
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo

.github/workflows/sonar.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
with:
1616
java-version: 17
1717
distribution: temurin
18-
- uses: actions/checkout@v5
18+
- uses: actions/checkout@v6
1919
with:
2020
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
2121
- name: Cache SonarQube packages

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"dotnet.defaultSolution": "src/1Script.sln"
3+
}

Build.csproj

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,9 @@
164164
</Target>
165165

166166
<Target Name="BuildWithCpp" DependsOnTargets="CleanAll;MakeCPP;MakeFDD;MakeSCD;BuildDebugger">
167-
<CallTarget Targets="CleanIntermediates"/>
168167
</Target>
169168

170169
<Target Name="BuildWithoutCpp" DependsOnTargets="CleanAll;MakeFDD;MakeSCD;BuildDebugger">
171-
<CallTarget Targets="CleanIntermediates"/>
172170
</Target>
173171

174172
<!-- Используется для поиска первого собранного oscript.exe -->
@@ -227,7 +225,7 @@
227225

228226
</Target>
229227

230-
<Target Name="ComposeDistributionFolders">
228+
<Target Name="ComposeDistributionFolders" DependsOnTargets="CleanIntermediates">
231229
<ItemGroup>
232230
<TargetDir Include="fdd-x64"/>
233231
<TargetDir Include="fdd-x86"/>
@@ -263,7 +261,7 @@
263261
<Delete Files="@(TempFiles)"/>
264262
</Target>
265263

266-
<Target Name="PrepareDistributionFiles" DependsOnTargets="CleanAll;BuildAll;GatherLibrary;ComposeDistributionFolders"/>
264+
<Target Name="PrepareDistributionFiles" DependsOnTargets="CleanAll;BuildAll;GatherLibrary;BuildDocumentation;ComposeDistributionFolders"/>
267265

268266
<Target Name="Test">
269267
<CallTarget Targets="UnitTests;ScriptedTests" />
@@ -375,5 +373,35 @@
375373
Command="dotnet nuget push %(NugetAbleProject.Identity) -k $(NugetToken) -s https://api.nuget.org/v3/index.json" UseUtf8Encoding="Always"/>
376374

377375
</Target>
376+
377+
<Target Name="BuildDocumenter">
378+
<Exec Command="dotnet publish &quot;$(MSBuildProjectDirectory)/src/OneScriptDocumenter/OneScriptDocumenter.csproj&quot; -c Release -o &quot;$(ArtifactsRoot)/tools/documenter&quot;" UseUtf8Encoding="Always"/>
379+
</Target>
378380

381+
<Target Name="BuildDocumentation" DependsOnTargets="MakeSCD;BuildDocumenter">
382+
<PropertyGroup>
383+
<DocInputDir>$(ArtifactsRoot)/win-x64/bin</DocInputDir>
384+
<DocsRoot>$(ArtifactsRoot)/docs</DocsRoot>
385+
<DocumenterToolDir>$(ArtifactsRoot)/tools/documenter</DocumenterToolDir>
386+
</PropertyGroup>
387+
<ItemGroup>
388+
<DocAssemblies Include="$(DocInputDir)/ScriptEngine.HostedScript.dll"/>
389+
<DocAssemblies Include="$(DocInputDir)/ScriptEngine.dll"/>
390+
<DocAssemblies Include="$(DocInputDir)/OneScript.StandardLibrary.dll"/>
391+
<DocAssemblies Include="$(DocInputDir)/OneScript.Web.Server.dll"/>
392+
<DocAssemblies Include="$(DocInputDir)/oscript.dll"/>
393+
</ItemGroup>
394+
395+
<Error Condition="'@(DocAssemblies)' == ''" Text="No input assemblies found in $(DocInputDir) for documentation generation" />
396+
397+
<MakeDir Directories="$(DocsRoot)"/>
398+
<MakeDir Directories="$(DocsRoot)/markdown"/>
399+
<MakeDir Directories="$(DocsRoot)/json"/>
400+
<Exec Command="dotnet &quot;$(DocumenterToolDir)/OneScriptDocumenter.dll&quot; @(DocAssemblies->'%(FullPath)', ' ') -t &quot;$(MSBuildProjectDirectory)/src/OneScriptDocumenter/default_toc.json&quot; -m &quot;$(DocsRoot)/markdown&quot; -j &quot;$(DocsRoot)/json/syntax-helper.json&quot;" UseUtf8Encoding="Always"/>
401+
402+
<RemoveDir Directories="$(DocumenterToolDir)" Condition="Exists($(DocumenterToolDir))"/>
403+
404+
</Target>
405+
406+
379407
</Project>

Jenkinsfile

Lines changed: 56 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pipeline {
55

66
environment {
77
VersionPrefix = '2.0.0'
8-
VersionSuffix = 'rc.9'+"+${BUILD_NUMBER}"
8+
VersionSuffix = 'rc.10'+"+${BUILD_NUMBER}"
99
outputEnc = '65001'
1010
}
1111

@@ -199,8 +199,9 @@ pipeline {
199199
}
200200

201201
stage ('Publishing night-build') {
202-
when { anyOf {
203-
branch 'develop';
202+
when {
203+
anyOf {
204+
branch 'develop';
204205
}
205206
}
206207
agent { label 'master' }
@@ -217,8 +218,9 @@ pipeline {
217218
}
218219

219220
stage ('Publishing preview') {
220-
when { anyOf {
221-
branch 'release/preview';
221+
when {
222+
anyOf {
223+
branch 'release/preview';
222224
}
223225
}
224226
agent { label 'master' }
@@ -257,6 +259,46 @@ pipeline {
257259
}
258260
}
259261
}
262+
263+
stage ('Publishing docker-images') {
264+
parallel {
265+
stage('Build v1') {
266+
agent { label 'linux' }
267+
when {
268+
anyOf {
269+
branch 'release/latest'
270+
expression {
271+
return env.TAG_NAME && env.TAG_NAME.startsWith('v1.')
272+
}
273+
}
274+
}
275+
steps {
276+
script {
277+
def codename = env.TAG_NAME ? env.TAG_NAME : 'latest'
278+
publishDockerImage('v1', codename)
279+
}
280+
}
281+
}
282+
283+
stage('Build v2') {
284+
agent { label 'linux' }
285+
when {
286+
anyOf {
287+
branch 'develop'
288+
expression {
289+
return env.TAG_NAME && env.TAG_NAME.startsWith('v2.')
290+
}
291+
}
292+
}
293+
steps {
294+
script {
295+
def codename = env.TAG_NAME ? env.TAG_NAME : 'dev'
296+
publishDockerImage('v2', codename)
297+
}
298+
}
299+
}
300+
}
301+
}
260302
}
261303
}
262304

@@ -300,3 +342,12 @@ def publishReleaseNotes(codename) {
300342
}
301343
}
302344

345+
def publishDockerImage(flavour, codename) {
346+
def imageName = "evilbeaver/onescript:${codename}"
347+
348+
docker.build(
349+
imageName,
350+
"--load -f install/builders/base-image/Dockerfile_${flavour} ."
351+
).push()
352+
}
353+

README-EN.md

Lines changed: 100 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,111 @@
1-
# README #
1+
# OneScript #
22

3-
### The project is an independent cross-platform open-source implementation of a virtual machine that executes scripts written in BSL (1C:Enterprise scripting language).
3+
[![Join telegram chat](https://img.shields.io/badge/chat-telegram-blue?style=flat&logo=telegram)](https://t.me/oscript_library) [![DEV Build Status](https://build.oscript.io/buildStatus/icon?job=1Script%2Fdevelop&style=flat-square&subject=dev)](https://build.oscript.io/job/1Script/job/develop/) [![STABLE Build Status](https://build.oscript.io/buildStatus/icon?job=1Script%2Fmaster&style=flat-square&subject=stable)](https://build.oscript.io/job/1Script/job/master/)
44

5-
![Logo](.github/logo-small.png)
5+
## The project is an independent cross-platform implementation of a virtual machine that executes scripts written in the 1C:Enterprise language ##
66

7-
Script execution doesn't use any 1C:Enterprise system libraries and doesn't require installation of 1C:Enterprise system on the target machine.
7+
![Logo](.github/logo-small-2.png) ![Logo](.github/logo-small.png)
88

9-
In other words, this is a possibility to write programs in the 1C (BSL) language without using the 1C:Enterprise platform.
9+
The 1C:Enterprise system libraries are not used and installation of the 1C:Enterprise system on the target machine is not required.
1010

11-
## Name and pronunciation
11+
In other words, this is a tool for writing and executing programs in the 1C language without using the 1C:Enterprise platform.
1212

13-
The project is called OneScript, can be abbreviated to the title 1Script on writing.
13+
## Name and pronunciation ##
1414

15-
## Project site
15+
The project is called OneScript, can be abbreviated to the title 1Script when writing. Pronounced as `[uanskript]`.
1616

17-
Basic information about the project, releases and technical documentation are located on the official website.
17+
OneScript allows you to create and execute text scripts written in a language familiar to any specialist working with the 1C:Enterprise system. Using a familiar language for script automation significantly increases a specialist's productivity by simplifying the automation of manual operations.
1818

19-
http://oscript.io
19+
## Project site ##
2020

21-
## Library of useful scripts
21+
Main information about the project, releases and technical documentation are located on the official website
2222

23-
The OneScript package already includes a set of commonly used packages.
23+
[https://oscript.io](https://oscript.io)
24+
25+
## Library of useful scripts ##
26+
27+
The OneScript distribution already includes a set of the most commonly used packages. These, as well as other packages, are located in the [oscript-library](https://github.com/oscript-library) repository and are available to everyone. There is a package manager [opm](https://github.com/oscript-library/opm).
28+
29+
## Installation ##
30+
31+
### Windows ###
32+
33+
- (interactively) download from the [official website](https://oscript.io) or installer from the [Releases](https://github.com/EvilBeaver/OneScript/releases) section and run it. Then, Next, Done.
34+
35+
### Linux ###
36+
37+
- (interactively) download the required package from the [official website](https://oscript.io) or installer from the [Releases](https://github.com/EvilBeaver/OneScript/releases) section and install it.
38+
39+
### MacOS ###
40+
41+
There is no interactive installer, but the engine can be installed from the command line:
42+
43+
- install [homebrew](https://brew.sh/index_ru)
44+
- install mono with the command `brew install mono`
45+
- download [ovm](https://github.com/oscript-library/ovm/releases). Download the `ovm.exe` file (despite the .exe extension it will work on MacOS)
46+
- run the command `mono path/to/ovm.exe install stable`
47+
48+
*Tip: To correctly specify the path to `ovm.exe`, drag the `ovm.exe` file into the terminal. Example of a full command: `mono Users/username/Downloads/ovm.exe install stable`*
49+
- run the command `mono path/to/ovm.exe use stable`
50+
- restart the terminal
51+
52+
#### Additional configuration for Self-Contained distribution (does not require dotnet installation)
53+
54+
```
55+
chmod +x ./oscript
56+
xattr -d com.apple.quarantine *.dylib oscript
57+
codesign -s - ./oscript
58+
```
59+
60+
61+
# Manual local build
62+
63+
## Preparation
64+
65+
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.
66+
67+
* 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.
68+
69+
## Build
70+
71+
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.
72+
Build is performed using msbuild. Targets:
73+
74+
* CleanAll - clean previous build results
75+
* BuildAll - prepare files for distribution
76+
* MakeCPP;MakeFDD;MakeSCD;BuildDebugger - separate build targets for preparing different types of distributions
77+
* PrepareDistributionFiles - build full distribution packages (including libraries)
78+
* PackDistributions - prepare ZIP archives for distribution
79+
* CreateNuget - create packages for publishing to NuGet
80+
81+
**Build parameters**
82+
83+
* VersionPrefix - release number prefix, its main part, for example, 2.0.0
84+
* VersionSuffix - version suffix, which usually acts as an arbitrary versioning suffix according to semver, for example, beta-786 (optional)
85+
* NoCppCompiler - if True - C++ compiler is not installed, C++ components (NativeApi support) will not be added to the build
86+
87+
All distribution files will be placed in the `built` directory at the root of the 1Script repository
88+
89+
### Building distribution contents in a separate directory
90+
91+
```bat
92+
msbuild Build.csproj /t:CleanAll;PrepareDistributionFiles
93+
```
94+
95+
### Building with manual version specification
96+
97+
```bat
98+
msbuild Build.csproj /t:CleanAll;PrepareDistributionFiles /p:VersionPrefix=2.0.0
99+
```
100+
101+
### Building ZIP distributions
102+
103+
```bat
104+
msbuild Build.csproj /t:CleanAll;PrepareDistributionFiles;PackDistributions /p:VersionPrefix=2.0.0 /p:VersionSuffix=preview223
105+
```
106+
107+
### Documentation generation
108+
109+
```bat
110+
msbuild Build.csproj /t:BuildDocumentation
111+
```

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,10 @@ msbuild Build.csproj /t:CleanAll;PrepareDistributionFiles /p:VersionPrefix=2.0.0
102102

103103
```bat
104104
msbuild Build.csproj /t:CleanAll;PrepareDistributionFiles;PackDistributions /p:VersionPrefix=2.0.0 /p:VersionSuffix=preview223
105+
```
106+
107+
### Генерация документации
108+
109+
```bat
110+
msbuild Build.csproj /t:BuildDocumentation
105111
```

0 commit comments

Comments
 (0)