Build-Fixes, string.ParseDecimal
This commit is contained in:
@@ -9,4 +9,4 @@ build:
|
|||||||
- docker
|
- docker
|
||||||
script:
|
script:
|
||||||
- bash build.sh
|
- bash build.sh
|
||||||
- dotnet nuget push -k $APIKEY -s https://nuget.am-wd.de/v3/index.json --skip-duplicate build/*.nupkg
|
- dotnet nuget push -k $APIKEY -s https://nuget.am-wd.de/v3/index.json --skip-duplicate artifacts/*.nupkg
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
@@ -117,5 +118,20 @@ namespace System
|
|||||||
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Parses a <see cref="string"/> to a <see cref="decimal"/> using culture "de" or invariant.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="decString">The string to parse.</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static decimal ParseDecimal(this string decString)
|
||||||
|
{
|
||||||
|
int dotIndex = decString.LastIndexOf('.');
|
||||||
|
int commaIndex = decString.LastIndexOf(',');
|
||||||
|
|
||||||
|
var culture = dotIndex < commaIndex ? new CultureInfo("de-DE") : CultureInfo.InvariantCulture;
|
||||||
|
|
||||||
|
return decimal.Parse(decString, culture);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
30
build.bat
30
build.bat
@@ -1,30 +0,0 @@
|
|||||||
@echo off
|
|
||||||
set Configuration=Release
|
|
||||||
|
|
||||||
cd "%~dp0"
|
|
||||||
cd "AMWD.Common"
|
|
||||||
rmdir /S /Q bin
|
|
||||||
dotnet build -c %Configuration% --nologo --no-incremental
|
|
||||||
|
|
||||||
cd "%~dp0"
|
|
||||||
cd "AMWD.Common.AspNetCore"
|
|
||||||
rmdir /S /Q bin
|
|
||||||
dotnet build -c %Configuration% --nologo --no-incremental
|
|
||||||
|
|
||||||
cd "%~dp0"
|
|
||||||
cd "AMWD.Common.EntityFrameworkCore"
|
|
||||||
rmdir /S /Q bin
|
|
||||||
dotnet build -c %Configuration% --nologo --no-incremental
|
|
||||||
|
|
||||||
cd "%~dp0"
|
|
||||||
rmdir /S /Q build
|
|
||||||
mkdir build
|
|
||||||
|
|
||||||
move AMWD.Common\bin\%Configuration%\*.nupkg build
|
|
||||||
move AMWD.Common\bin\%Configuration%\*.snupkg build
|
|
||||||
|
|
||||||
move AMWD.Common.AspNetCore\bin\%Configuration%\*.nupkg build
|
|
||||||
move AMWD.Common.AspNetCore\bin\%Configuration%\*.snupkg build
|
|
||||||
|
|
||||||
move AMWD.Common.EntityFrameworkCore\bin\%Configuration%\*.nupkg build
|
|
||||||
move AMWD.Common.EntityFrameworkCore\bin\%Configuration%\*.snupkg build
|
|
||||||
42
build.cmd
Normal file
42
build.cmd
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
@echo off
|
||||||
|
set Configuration=Release
|
||||||
|
|
||||||
|
cd "%~dp0"
|
||||||
|
powershell write-host -fore Blue Restoring solution
|
||||||
|
|
||||||
|
rmdir /S /Q artifacts
|
||||||
|
mkdir artifacts
|
||||||
|
|
||||||
|
dotnet restore -v q
|
||||||
|
:: dotnet tool restore -v q
|
||||||
|
|
||||||
|
cd "%~dp0"
|
||||||
|
cd "AMWD.Common"
|
||||||
|
powershell write-host -fore Blue Building AMWD.Common
|
||||||
|
|
||||||
|
rmdir /S /Q bin
|
||||||
|
dotnet build -c %Configuration% --nologo --no-incremental
|
||||||
|
move bin\%Configuration%\*.nupkg ..\artifacts
|
||||||
|
move bin\%Configuration%\*.snupkg ..\artifacts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cd "%~dp0"
|
||||||
|
cd "AMWD.Common.AspNetCore"
|
||||||
|
powershell write-host -fore Blue Building AMWD.Common.AspNetCore
|
||||||
|
|
||||||
|
rmdir /S /Q bin
|
||||||
|
dotnet build -c %Configuration% --nologo --no-incremental
|
||||||
|
move bin\%Configuration%\*.nupkg ..\artifacts
|
||||||
|
move bin\%Configuration%\*.snupkg ..\artifacts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cd "%~dp0"
|
||||||
|
cd "AMWD.Common.EntityFrameworkCore"
|
||||||
|
powershell write-host -fore Blue Building AMWD.Common.EntityFrameworkCore
|
||||||
|
|
||||||
|
rmdir /S /Q bin
|
||||||
|
dotnet build -c %Configuration% --nologo --no-incremental
|
||||||
|
move bin\%Configuration%\*.nupkg ..\artifacts
|
||||||
|
move bin\%Configuration%\*.snupkg ..\artifacts
|
||||||
25
build.sh
25
build.sh
@@ -1,29 +1,30 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
CONFIGURATION=Release
|
CONFIGURATION=Release
|
||||||
|
|
||||||
|
cd "$(dirname "${0}")"
|
||||||
|
rm -rf artifacts
|
||||||
|
mkdir artifacts
|
||||||
|
|
||||||
|
dotnet restore -v q
|
||||||
|
# dotnet tool restore -v q
|
||||||
|
|
||||||
pushd AMWD.Common
|
pushd AMWD.Common
|
||||||
rm -rf bin
|
rm -rf bin
|
||||||
dotnet build -c ${CONFIGURATION} --nologo --no-incremental
|
dotnet build -c ${CONFIGURATION} --nologo --no-incremental
|
||||||
|
mv bin/${CONFIGURATION}/*.nupkg ../artifacts
|
||||||
|
mv bin/${CONFIGURATION}/*.snupkg ../artifacts
|
||||||
popd
|
popd
|
||||||
|
|
||||||
pushd AMWD.Common.AspNetCore
|
pushd AMWD.Common.AspNetCore
|
||||||
rm -rf bin
|
rm -rf bin
|
||||||
dotnet build -c ${CONFIGURATION} --nologo --no-incremental
|
dotnet build -c ${CONFIGURATION} --nologo --no-incremental
|
||||||
|
mv bin/${CONFIGURATION}/*.nupkg ../artifacts
|
||||||
|
mv bin/${CONFIGURATION}/*.snupkg ../artifacts
|
||||||
popd
|
popd
|
||||||
|
|
||||||
pushd AMWD.Common.EntityFrameworkCore
|
pushd AMWD.Common.EntityFrameworkCore
|
||||||
rm -rf bin
|
rm -rf bin
|
||||||
dotnet build -c ${CONFIGURATION} --nologo --no-incremental
|
dotnet build -c ${CONFIGURATION} --nologo --no-incremental
|
||||||
|
mv bin/${CONFIGURATION}/*.nupkg ../artifacts
|
||||||
|
mv bin/${CONFIGURATION}/*.snupkg ../artifacts
|
||||||
popd
|
popd
|
||||||
|
|
||||||
rm -rf build
|
|
||||||
mkdir build
|
|
||||||
mv AMWD.Common/bin/${CONFIGURATION}/*.nupkg build
|
|
||||||
mv AMWD.Common/bin/${CONFIGURATION}/*.snupkg build
|
|
||||||
|
|
||||||
mv AMWD.Common.AspNetCore/bin/${CONFIGURATION}/*.nupkg build
|
|
||||||
mv AMWD.Common.AspNetCore/bin/${CONFIGURATION}/*.snupkg build
|
|
||||||
|
|
||||||
mv AMWD.Common.EntityFrameworkCore/bin/${CONFIGURATION}/*.nupkg build
|
|
||||||
mv AMWD.Common.EntityFrameworkCore/bin/${CONFIGURATION}/*.snupkg build
|
|
||||||
|
|||||||
Reference in New Issue
Block a user