Updated Jenkinsfile and .NET version.
This commit is contained in:
parent
f460382a64
commit
2fdf476a85
6
.vscode/settings.json
vendored
Normal file
6
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"cSpell.words": [
|
||||||
|
"dotnetresxutils",
|
||||||
|
"Resx"
|
||||||
|
]
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
|
|
||||||
<IsPackable>false</IsPackable>
|
<IsPackable>false</IsPackable>
|
||||||
|
@ -49,21 +49,21 @@ namespace DotNetResxUtils.Commands
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FlattenJsonElement(IDictionary<string, string> flattened, JsonElement jsonElement, string namepath)
|
private void FlattenJsonElement(IDictionary<string, string> flattened, JsonElement jsonElement, string namePath)
|
||||||
{
|
{
|
||||||
if (jsonElement.ValueKind == JsonValueKind.Array)
|
if (jsonElement.ValueKind == JsonValueKind.Array)
|
||||||
{
|
{
|
||||||
int itemIndex = 0;
|
int itemIndex = 0;
|
||||||
foreach (JsonElement item in jsonElement.EnumerateArray())
|
foreach (JsonElement item in jsonElement.EnumerateArray())
|
||||||
{
|
{
|
||||||
FlattenJsonElement(flattened, item, namepath + $"[{itemIndex}]");
|
FlattenJsonElement(flattened, item, namePath + $"[{itemIndex}]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (jsonElement.ValueKind == JsonValueKind.Object)
|
else if (jsonElement.ValueKind == JsonValueKind.Object)
|
||||||
{
|
{
|
||||||
foreach (JsonProperty item in jsonElement.EnumerateObject())
|
foreach (JsonProperty item in jsonElement.EnumerateObject())
|
||||||
{
|
{
|
||||||
FlattenJsonElement(flattened, item.Value, namepath + $".{item.Name}");
|
FlattenJsonElement(flattened, item.Value, namePath + $".{item.Name}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -71,7 +71,7 @@ namespace DotNetResxUtils.Commands
|
|||||||
string? stored = jsonElement.GetString();
|
string? stored = jsonElement.GetString();
|
||||||
if (stored != null)
|
if (stored != null)
|
||||||
{
|
{
|
||||||
flattened[namepath] = stored;
|
flattened[namePath] = stored;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<PublishReadyToRun>true</PublishReadyToRun>
|
<PublishReadyToRun>true</PublishReadyToRun>
|
||||||
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
|
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
|
||||||
<PublishTrimmed>true</PublishTrimmed>
|
<PublishTrimmed>true</PublishTrimmed>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<ImplicitUsings>disable</ImplicitUsings>
|
<ImplicitUsings>disable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
19
Jenkinsfile
vendored
19
Jenkinsfile
vendored
@ -1,26 +1,23 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
stages {
|
stages {
|
||||||
stage("Cleanup") {
|
stage("Setup") {
|
||||||
steps {
|
steps {
|
||||||
cleanWs(patterns: [[pattern: '**/bin/Release', type: 'INCLUDE'], [pattern: 'output/**', type: 'INCLUDE']])
|
sh 'mamba env update --file environment.yml'
|
||||||
}
|
sh 'echo "mamba activate dotnetresxutils" >> ~/.bashrc'
|
||||||
}
|
sh "dotnet restore DotNetResxUtils"
|
||||||
stage("Restore") {
|
sh "dotnet restore DotNetResxUtils.Tests"
|
||||||
steps {
|
|
||||||
dotnetRestore project: 'DotNetResxUtils'
|
|
||||||
dotnetRestore project: 'DotNetResxUtils.Tests'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage("Test") {
|
stage("Test") {
|
||||||
steps {
|
steps {
|
||||||
dotnetTest noRestore: true, project: 'DotNetResxUtils.Tests'
|
sh "dotnet test --no-restore DotNetResxUtils.Tests"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage("Publish") {
|
stage("Publish") {
|
||||||
steps {
|
steps {
|
||||||
dotnetPublish configuration: 'Release', outputDirectory: 'output/DotNetResxUtils/DotNetResxUtils-win-x64', project: 'DotNetResxUtils', runtime: 'win-x64', selfContained: true
|
sh "dotnet publish DotNetResxUtils --configuration Release --output output/DotNetResxUtils/DotNetResxUtils-win-x64 --runtime win-x64 --self-contained"
|
||||||
dotnetPublish configuration: 'Release', outputDirectory: 'output/DotNetResxUtils/DotNetResxUtils-linux-x64', project: 'DotNetResxUtils', runtime: 'linux-x64', selfContained: true
|
sh "dotnet publish DotNetResxUtils --configuration Release --output output/DotNetResxUtils/DotNetResxUtils-linux-x64 --runtime linux-x64 --self-contained"
|
||||||
fingerprint 'output/DotNetResxUtils/**/DotNetResxUtils*'
|
fingerprint 'output/DotNetResxUtils/**/DotNetResxUtils*'
|
||||||
tar file: "output/DotNetResxUtils-linux-x64.tar.gz", archive: true, compress: true, dir: "output/DotNetResxUtils/DotNetResxUtils-linux-x64"
|
tar file: "output/DotNetResxUtils-linux-x64.tar.gz", archive: true, compress: true, dir: "output/DotNetResxUtils/DotNetResxUtils-linux-x64"
|
||||||
zip zipFile: "output/DotNetResxUtils-win-x64.zip", archive: true, dir: "output/DotNetResxUtils/DotNetResxUtils-win-x64"
|
zip zipFile: "output/DotNetResxUtils-win-x64.zip", archive: true, dir: "output/DotNetResxUtils/DotNetResxUtils-win-x64"
|
||||||
|
5
environment.yml
Normal file
5
environment.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
name: dotnetresxutils
|
||||||
|
channels:
|
||||||
|
- conda-forge
|
||||||
|
dependencies:
|
||||||
|
- dotnet-sdk=7.0.*
|
Loading…
x
Reference in New Issue
Block a user