Commit 197ed5e3 authored by Andreas Müller's avatar Andreas Müller
Browse files

Build-Fixes, string.ParseDecimal

parent b74eb5b9
......@@ -9,4 +9,4 @@ build:
- docker
script:
- 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
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
......@@ -117,5 +118,20 @@ namespace System
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);
}
}
}
@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"
rmdir /S /Q bin
dotnet build -c %Configuration% --nologo --no-incremental
powershell write-host -fore Blue Building AMWD.Common.AspNetCore
cd "%~dp0"
cd "AMWD.Common.EntityFrameworkCore"
rmdir /S /Q bin
dotnet build -c %Configuration% --nologo --no-incremental
move bin\%Configuration%\*.nupkg ..\artifacts
move bin\%Configuration%\*.snupkg ..\artifacts
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
cd "%~dp0"
cd "AMWD.Common.EntityFrameworkCore"
powershell write-host -fore Blue Building AMWD.Common.EntityFrameworkCore
move AMWD.Common.EntityFrameworkCore\bin\%Configuration%\*.nupkg build
move AMWD.Common.EntityFrameworkCore\bin\%Configuration%\*.snupkg build
rmdir /S /Q bin
dotnet build -c %Configuration% --nologo --no-incremental
move bin\%Configuration%\*.nupkg ..\artifacts
move bin\%Configuration%\*.snupkg ..\artifacts
#!/bin/bash
CONFIGURATION=Release
cd "$(dirname "${0}")"
rm -rf artifacts
mkdir artifacts
dotnet restore -v q
# dotnet tool restore -v q
pushd AMWD.Common
rm -rf bin
dotnet build -c ${CONFIGURATION} --nologo --no-incremental
mv bin/${CONFIGURATION}/*.nupkg ../artifacts
mv bin/${CONFIGURATION}/*.snupkg ../artifacts
popd
pushd AMWD.Common.AspNetCore
rm -rf bin
dotnet build -c ${CONFIGURATION} --nologo --no-incremental
mv bin/${CONFIGURATION}/*.nupkg ../artifacts
mv bin/${CONFIGURATION}/*.snupkg ../artifacts
popd
pushd AMWD.Common.EntityFrameworkCore
rm -rf bin
dotnet build -c ${CONFIGURATION} --nologo --no-incremental
mv bin/${CONFIGURATION}/*.nupkg ../artifacts
mv bin/${CONFIGURATION}/*.snupkg ../artifacts
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment