Skip to content

Commit 3527e62

Browse files
authored
#146 - переход на NativeAot (#166)
* #146 - отключил дебаг в релизе * #146 - убрал ворнинги для аота * #146 - aot publish с оптимизацией размера файла * #146 - рефакторинг ci/cd * #146 - upd docs
1 parent b8f061e commit 3527e62

File tree

5 files changed

+36
-2
lines changed

5 files changed

+36
-2
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
- name: Publish
7272
run: |
7373
mkdir output
74-
dotnet publish ./src/HydraScript/HydraScript.csproj -c Release -r ${{ matrix.config.rid }} -p:PublishSingleFile=true -p:DebugType=embedded -p:Version=${{ needs.create-release.outputs.publish_version }} --self-contained false -o ./output
74+
dotnet publish ./src/HydraScript/HydraScript.csproj -r ${{ matrix.config.rid }} -p:Version=${{ needs.create-release.outputs.publish_version }} -o ./output
7575
- name: Rename Executable
7676
run: mv ./output/HydraScript${{ matrix.config.rid == 'win-x64' && '.exe' || '' }} ./output/hydrascript_${{ matrix.config.rid }}${{ matrix.config.rid == 'win-x64' && '.exe' || '' }}
7777
- name: Add asset to a release with GitReleaseManager

Directory.Build.props

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
<LangVersion>latest</LangVersion>
88
</PropertyGroup>
99

10+
<PropertyGroup Condition="'$(Configuration)'=='Release'">
11+
<DebugType>none</DebugType>
12+
<DebugSymbols>false</DebugSymbols>
13+
</PropertyGroup>
14+
1015
<PropertyGroup>
1116
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
1217
<JsonSerializerIsReflectionEnabledByDefault>false</JsonSerializerIsReflectionEnabledByDefault>

Readme.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,17 @@ let obj = {}
188188

189189
### Требования
190190

191-
- .NET 9 SDK
191+
До версии **2.3.0** для запуска интерпретатора требовалась [установка .NET Runtime](https://dotnet.microsoft.com/ru-ru/download/dotnet)
192+
193+
Таблица соответствий hydrascript и dotnet:
194+
195+
| hydrascript | dotnet |
196+
|-------------------------------------------------------------------|--------|
197+
| <ul><li>1.0.0</li><li>1.0.2</li></ul> | .NET 5 |
198+
| <ul><li>1.1.2</li><li>1.1.3</li><li>1.1.4</li><li>1.1.5</li></ul> | .NET 6 |
199+
| <ul><li>1.2.5</li><li>1.2.6</li><ul> | .NET 7 |
200+
| 2.0.0 | .NET 8 |
201+
| <ul><li>2.1.0</li><li>2.1.1</li><li>2.2.0</li></ul> | .NET 9 |
192202

193203
### Сборка
194204
После клонирования репозитория идём в папку проекта `HydraScript`.

src/HydraScript/HydraScript.csproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5+
<PublishAot>true</PublishAot>
6+
<PublishSingleFile>true</PublishSingleFile>
7+
</PropertyGroup>
8+
9+
<PropertyGroup Condition="'$(Configuration)'=='Release'">
10+
<OptimizationPreference>Size</OptimizationPreference>
11+
<InvariantGlobalization>true</InvariantGlobalization>
12+
<StackTraceSupport>false</StackTraceSupport>
13+
<UseSystemResourceKeys>true</UseSystemResourceKeys>
514
</PropertyGroup>
615

716
<ItemGroup>

src/HydraScript/Program.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ private static ExecuteCommand GetCommand()
2525
return command;
2626
}
2727

28+
private const string SuppressMessage = $"{nameof(ConsoleFormatterOptions)} is used";
29+
30+
[UnconditionalSuppressMessage(
31+
category: "ReflectionAnalysis",
32+
checkId: "IL2026:RequiresUnreferencedCode",
33+
Justification = SuppressMessage)]
34+
[UnconditionalSuppressMessage(
35+
category: "AotAnalysis",
36+
checkId: "IL3050:RequiresDynamicCode",
37+
Justification = SuppressMessage)]
2838
internal static ServiceProvider GetServiceProvider(
2939
FileInfo fileInfo,
3040
bool dump,

0 commit comments

Comments
 (0)