From 923b58835cf775b92d76db8ea65ef5501284cd3e Mon Sep 17 00:00:00 2001 From: Louis DUFOUR Date: Wed, 6 Sep 2023 22:50:50 +0200 Subject: [PATCH] Update (Vu_homePage): Mise en place de CSharpier --- .drone.yml | 4 +--- src/BookApp/App.xaml.cs | 2 +- src/BookApp/AppShell.xaml.cs | 2 +- src/BookApp/MainPage.xaml.cs | 12 ++++++++---- src/BookApp/MauiProgram.cs | 4 ++-- src/BookApp/Pages/Tous.xaml.cs | 4 +--- src/BookApp/Platforms/Android/MainActivity.cs | 17 ++++++++++++----- .../Platforms/Android/MainApplication.cs | 6 ++---- .../Platforms/MacCatalyst/AppDelegate.cs | 2 +- src/BookApp/Platforms/MacCatalyst/Program.cs | 2 +- src/BookApp/Platforms/Tizen/Main.cs | 2 +- src/BookApp/Platforms/Windows/App.xaml.cs | 2 +- src/BookApp/Platforms/iOS/AppDelegate.cs | 2 +- src/BookApp/Platforms/iOS/Program.cs | 2 +- 14 files changed, 34 insertions(+), 29 deletions(-) diff --git a/.drone.yml b/.drone.yml index 2f025bb..e7d44d3 100644 --- a/.drone.yml +++ b/.drone.yml @@ -19,7 +19,6 @@ steps: - dotnet-csharpier --check . # Verifie le formatage - dotnet-csharpier --write . # Applique le formatage - - name: build image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dotnet7-maui:latest commandes: @@ -51,12 +50,11 @@ steps: - dotnet sonarscanner begin /k:$${project_key} /d:sonar.host.url=$${sonar_host} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions=$${coverage_exclusions} /d:sonar.login=$${sonar_token} - dotnet build BookApp.sln -c Release --no-restore /p:AndroidSdkDirectory=$ANDROID_SDK_ROOT -property:Aapt2ToolPath=$ANDROID_SDK_ROOT/build-tools/33.0.0 - dotnet test BookApp.sln --logger trx --no-restore /p:AndroidSdkDirectory=$ANDROID_SDK_ROOT -property:Aapt2ToolPath=$ANDROID_SDK_ROOT/build-tools/33.0.0 /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage" - - reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport" + #- reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport" - dotnet publish BookApp/BookApp.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} depends_on: [build] - #- name: docs #- name: deploy \ No newline at end of file diff --git a/src/BookApp/App.xaml.cs b/src/BookApp/App.xaml.cs index f7c4815..9f6da0f 100644 --- a/src/BookApp/App.xaml.cs +++ b/src/BookApp/App.xaml.cs @@ -9,4 +9,4 @@ MainPage = new AppShell(); } } -} \ No newline at end of file +} diff --git a/src/BookApp/AppShell.xaml.cs b/src/BookApp/AppShell.xaml.cs index 110b188..cbb8d54 100644 --- a/src/BookApp/AppShell.xaml.cs +++ b/src/BookApp/AppShell.xaml.cs @@ -8,4 +8,4 @@ Routing.RegisterRoute(nameof(Tous), typeof(Tous)); } } -} \ No newline at end of file +} diff --git a/src/BookApp/MainPage.xaml.cs b/src/BookApp/MainPage.xaml.cs index 2e0cfb8..140876e 100644 --- a/src/BookApp/MainPage.xaml.cs +++ b/src/BookApp/MainPage.xaml.cs @@ -8,7 +8,12 @@ namespace BookApp { public string Name { get; set; } public string Icone { get; set; } - public ObjetTemp(string name, string icone) { Name = name; Icone = icone; } + + public ObjetTemp(string name, string icone) + { + Name = name; + Icone = icone; + } } public ObservableCollection MyCollections { get; set; } @@ -30,11 +35,10 @@ namespace BookApp }; BindingContext = this; } - + async void OnButtonClicked(object sender, EventArgs args) { await Shell.Current.GoToAsync(nameof(Tous)); } - } -} \ No newline at end of file +} diff --git a/src/BookApp/MauiProgram.cs b/src/BookApp/MauiProgram.cs index 3875ec3..28f65ad 100644 --- a/src/BookApp/MauiProgram.cs +++ b/src/BookApp/MauiProgram.cs @@ -16,10 +16,10 @@ namespace BookApp }); #if DEBUG - builder.Logging.AddDebug(); + builder.Logging.AddDebug(); #endif return builder.Build(); } } -} \ No newline at end of file +} diff --git a/src/BookApp/Pages/Tous.xaml.cs b/src/BookApp/Pages/Tous.xaml.cs index 6213f30..6b37241 100644 --- a/src/BookApp/Pages/Tous.xaml.cs +++ b/src/BookApp/Pages/Tous.xaml.cs @@ -4,8 +4,6 @@ using System.Linq; using System.Text; using System.Threading.Tasks; - - namespace BookApp { [XamlCompilation(XamlCompilationOptions.Compile)] @@ -16,4 +14,4 @@ namespace BookApp InitializeComponent(); } } -} \ No newline at end of file +} diff --git a/src/BookApp/Platforms/Android/MainActivity.cs b/src/BookApp/Platforms/Android/MainActivity.cs index 8658bff..a198472 100644 --- a/src/BookApp/Platforms/Android/MainActivity.cs +++ b/src/BookApp/Platforms/Android/MainActivity.cs @@ -4,8 +4,15 @@ using Android.OS; namespace BookApp { - [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] - public class MainActivity : MauiAppCompatActivity - { - } -} \ No newline at end of file + [Activity( + Theme = "@style/Maui.SplashTheme", + MainLauncher = true, + ConfigurationChanges = ConfigChanges.ScreenSize + | ConfigChanges.Orientation + | ConfigChanges.UiMode + | ConfigChanges.ScreenLayout + | ConfigChanges.SmallestScreenSize + | ConfigChanges.Density + )] + public class MainActivity : MauiAppCompatActivity { } +} diff --git a/src/BookApp/Platforms/Android/MainApplication.cs b/src/BookApp/Platforms/Android/MainApplication.cs index 182eb4d..4999245 100644 --- a/src/BookApp/Platforms/Android/MainApplication.cs +++ b/src/BookApp/Platforms/Android/MainApplication.cs @@ -7,10 +7,8 @@ namespace BookApp public class MainApplication : MauiApplication { public MainApplication(IntPtr handle, JniHandleOwnership ownership) - : base(handle, ownership) - { - } + : base(handle, ownership) { } protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); } -} \ No newline at end of file +} diff --git a/src/BookApp/Platforms/MacCatalyst/AppDelegate.cs b/src/BookApp/Platforms/MacCatalyst/AppDelegate.cs index ee4876c..f76d1a2 100644 --- a/src/BookApp/Platforms/MacCatalyst/AppDelegate.cs +++ b/src/BookApp/Platforms/MacCatalyst/AppDelegate.cs @@ -7,4 +7,4 @@ namespace BookApp { protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); } -} \ No newline at end of file +} diff --git a/src/BookApp/Platforms/MacCatalyst/Program.cs b/src/BookApp/Platforms/MacCatalyst/Program.cs index 9730ba5..866b5f7 100644 --- a/src/BookApp/Platforms/MacCatalyst/Program.cs +++ b/src/BookApp/Platforms/MacCatalyst/Program.cs @@ -13,4 +13,4 @@ namespace BookApp UIApplication.Main(args, null, typeof(AppDelegate)); } } -} \ No newline at end of file +} diff --git a/src/BookApp/Platforms/Tizen/Main.cs b/src/BookApp/Platforms/Tizen/Main.cs index 237b0a3..e477948 100644 --- a/src/BookApp/Platforms/Tizen/Main.cs +++ b/src/BookApp/Platforms/Tizen/Main.cs @@ -14,4 +14,4 @@ namespace BookApp app.Run(args); } } -} \ No newline at end of file +} diff --git a/src/BookApp/Platforms/Windows/App.xaml.cs b/src/BookApp/Platforms/Windows/App.xaml.cs index 1e1bab4..b173296 100644 --- a/src/BookApp/Platforms/Windows/App.xaml.cs +++ b/src/BookApp/Platforms/Windows/App.xaml.cs @@ -21,4 +21,4 @@ namespace BookApp.WinUI protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); } -} \ No newline at end of file +} diff --git a/src/BookApp/Platforms/iOS/AppDelegate.cs b/src/BookApp/Platforms/iOS/AppDelegate.cs index ee4876c..f76d1a2 100644 --- a/src/BookApp/Platforms/iOS/AppDelegate.cs +++ b/src/BookApp/Platforms/iOS/AppDelegate.cs @@ -7,4 +7,4 @@ namespace BookApp { protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); } -} \ No newline at end of file +} diff --git a/src/BookApp/Platforms/iOS/Program.cs b/src/BookApp/Platforms/iOS/Program.cs index 9730ba5..866b5f7 100644 --- a/src/BookApp/Platforms/iOS/Program.cs +++ b/src/BookApp/Platforms/iOS/Program.cs @@ -13,4 +13,4 @@ namespace BookApp UIApplication.Main(args, null, typeof(AppDelegate)); } } -} \ No newline at end of file +}