Update (Vu_homePage): Mise en place de CSharpier

pull/2/head
Louis DUFOUR 2 years ago
parent 22b5e38c16
commit 923b58835c

@ -19,7 +19,6 @@ steps:
- dotnet-csharpier --check . # Verifie le formatage - dotnet-csharpier --check . # Verifie le formatage
- dotnet-csharpier --write . # Applique le formatage - dotnet-csharpier --write . # Applique le formatage
- name: build - name: build
image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dotnet7-maui:latest image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dotnet7-maui:latest
commandes: 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 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 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" - 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 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} - dotnet sonarscanner end /d:sonar.login=$${sonar_token}
depends_on: [build] depends_on: [build]
#- name: docs #- name: docs
#- name: deploy #- name: deploy

@ -8,7 +8,12 @@ namespace BookApp
{ {
public string Name { get; set; } public string Name { get; set; }
public string Icone { 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<ObjetTemp> MyCollections { get; set; } public ObservableCollection<ObjetTemp> MyCollections { get; set; }
@ -35,6 +40,5 @@ namespace BookApp
{ {
await Shell.Current.GoToAsync(nameof(Tous)); await Shell.Current.GoToAsync(nameof(Tous));
} }
} }
} }

@ -4,8 +4,6 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace BookApp namespace BookApp
{ {
[XamlCompilation(XamlCompilationOptions.Compile)] [XamlCompilation(XamlCompilationOptions.Compile)]

@ -4,8 +4,15 @@ using Android.OS;
namespace BookApp namespace BookApp
{ {
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] [Activity(
public class MainActivity : MauiAppCompatActivity Theme = "@style/Maui.SplashTheme",
{ MainLauncher = true,
} ConfigurationChanges = ConfigChanges.ScreenSize
| ConfigChanges.Orientation
| ConfigChanges.UiMode
| ConfigChanges.ScreenLayout
| ConfigChanges.SmallestScreenSize
| ConfigChanges.Density
)]
public class MainActivity : MauiAppCompatActivity { }
} }

@ -7,9 +7,7 @@ namespace BookApp
public class MainApplication : MauiApplication public class MainApplication : MauiApplication
{ {
public MainApplication(IntPtr handle, JniHandleOwnership ownership) public MainApplication(IntPtr handle, JniHandleOwnership ownership)
: base(handle, ownership) : base(handle, ownership) { }
{
}
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
} }

Loading…
Cancel
Save