diff --git a/.drone.yml b/.drone.yml index b8b996a..f97d11b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -31,19 +31,19 @@ steps: secrets: [ SECRET_SONAR_LOGIN ] settings: # accessible en ligne de commande par ${PLUGIN_SONAR_HOST} - SONAR_HOST: https://codefirst.iut.uca.fr/sonar/ + sonar_host: https://codefirst.iut.uca.fr/sonar/ # accessible en ligne de commande par ${PLUGIN_SONAR_TOKEN} - SONNAR_TOKEN: + sonar_token: from_secret: SECRET_SONAR_LOGIN commands: - cd src/Banquale/ - dotnet restore Banquale.sln - - dotnet sonarscanner begin /k:Banquale /d:sonar.host.url=$SONAR_HOST /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions="Tests/**" /d:sonar.login=$SONAR_TOKEN + - dotnet sonarscanner begin /k:"Banquale" /d:sonar.host.url=$${PLUGIN_SONAR_HOST} /d:sonar.login=$${PLUGIN_SONAR_TOKEN} - dotnet build Banquale.sln -c Release --no-restore - dotnet test Banquale.sln --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage" - - reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport" - - dotnet publish Banquale/Banquale.csproj -c Release --no-restore -o $CI_PROJECT_DIR/build/release -f:net7.0-android /p:AndroidSdkDirectory=/usr/lib/android-sdk - - dotnet sonarscanner end /d:sonar.login=$SONAR_TOKEN +# - reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport" +# - dotnet publish Banquale/Banquale.csproj -c Release --no-restore -o $CI_PROJECT_DIR/build/release -f:net7.0-android /p:AndroidSdkDirectory=/usr/lib/android-sdk + - dotnet sonarscanner end /d:sonar.login=$${PLUGIN_SONAR_TOKEN} depends_on: [tests] - name: generate-and-deploy-docs diff --git a/README.md b/README.md index d0e13da..bc86d13 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,10 @@ # Banquale [![Build Status](https://codefirst.iut.uca.fr/api/badges/antoine.perederii/Banquale/status.svg)](https://codefirst.iut.uca.fr/antoine.perederii/Banquale) +[![Quality Gate Status](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=Banquale&metric=alert_status&token=1a49717e4d2f15e2eecaaa971ebd8c83fb9bd5c5)](https://codefirst.iut.uca.fr/sonar/dashboard?id=Banquale) +[![Bugs](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=Banquale&metric=bugs&token=1a49717e4d2f15e2eecaaa971ebd8c83fb9bd5c5)](https://codefirst.iut.uca.fr/sonar/dashboard?id=Banquale) +[![Coverage](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=Banquale&metric=coverage&token=1a49717e4d2f15e2eecaaa971ebd8c83fb9bd5c5)](https://codefirst.iut.uca.fr/sonar/dashboard?id=Banquale) +[![Vulnerabilities](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=Banquale&metric=vulnerabilities&token=1a49717e4d2f15e2eecaaa971ebd8c83fb9bd5c5)](https://codefirst.iut.uca.fr/sonar/dashboard?id=Banquale) # Table of Content [overview--big-picture](#overview--big-picture) | [Features](#features) | [Getting Started](#getting-started) | [Prerequisites](#prerequisites) diff --git a/src/Banquale/Banquale/Banquale.csproj b/src/Banquale/Banquale/Banquale.csproj index 8939ab5..3f03349 100644 --- a/src/Banquale/Banquale/Banquale.csproj +++ b/src/Banquale/Banquale/Banquale.csproj @@ -75,6 +75,7 @@ + diff --git a/src/Banquale/Banquale/DataContractPersistance/DataContractPers.cs b/src/Banquale/Banquale/DataContractPersistance/DataContractPers.cs index 83ed1e4..e1239a2 100644 --- a/src/Banquale/Banquale/DataContractPersistance/DataContractPers.cs +++ b/src/Banquale/Banquale/DataContractPersistance/DataContractPers.cs @@ -1,7 +1,16 @@ +<<<<<<< HEAD using System; using System.Diagnostics; using System.Runtime.Serialization; using Banquale.Model; +======= +using Banquale.Model; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Runtime.Serialization; +using System.Xml; +>>>>>>> 771dfebd455ecbc2d933450b081c14049561ab24 namespace Banquale.DataContractPersistance { @@ -11,7 +20,11 @@ namespace Banquale.DataContractPersistance public string FileName { get; set; } = "ClientAndTransactionsList.xml"; public string FilePath { get; set; } = Path.Combine(Directory.GetCurrentDirectory(), "..//XML1_folder")/*"/Users/Perederii/SAE/Banquale/src/Banquale/Banquale/XML_folder"*/; + + public string FileName { get; set; } = "nomFichier.xml"; + public string FilePath2 { get; set; } = "..\\Persistances"; + public string FilePath { get; set; } = "C:\\Users\\louve\\depot\\Banquale\\src\\Banquale\\Persistances"; public (List, List) ChargeDonnee() { @@ -38,11 +51,15 @@ namespace Banquale.DataContractPersistance Directory.CreateDirectory(FilePath); } - using (Stream s = File.Create(Path.Combine(FilePath, FileName))) + XmlWriterSettings settings = new XmlWriterSettings() { Indent = true }; + using (TextWriter tw = File.CreateText(Path.Combine(FilePath, FileName))) { - serializer.WriteObject(s, t); + using (XmlWriter writer = XmlWriter.Create(tw, settings)) + { + serializer.WriteObject(writer, t); + } } - } + } } } diff --git a/src/Banquale/Banquale/Model/Manager.cs b/src/Banquale/Banquale/Model/Manager.cs index a38d1e3..d7739f0 100644 --- a/src/Banquale/Banquale/Model/Manager.cs +++ b/src/Banquale/Banquale/Model/Manager.cs @@ -1,12 +1,15 @@ using System; +using System.Runtime.Serialization; namespace Banquale.Model { + [DataContract] public class Manager { + [DataMember] public List ListeClients { get; private set; } - + [DataMember] public List ListeTransactions { get; private set; } public IPersistanceManager Persistance { get; set; }