Skip to content

Commit

Permalink
[Mono.Android] Fix API-34 exercise enums with name conflicts (#8254)
Browse files Browse the repository at this point in the history
Context: dab495f

While creating enumerations for API-34 constants, three enums were
created that had the same type name as a bound Java type.  These
enums have been renamed to no longer conflict with generated types.

  - `BodyTemperatureMeasurementLocation` -> `BodyTemperatureMeasurementLocationType`
  - `ExerciseSegmentType` -> `ExerciseSegmentTypeEnum`
  - `ExerciseSessionType` -> `ExerciseSessionTypeEnum`

This was noticed because `CS2002` warnings appeared when building `Mono.Android`:

	CSC : error CS2002: Source file 'C:\code\xamarin-android\src\Mono.Android\obj\Debug\net8.0\android-34\mcw\Android.Health.Connect.DataTypes.ExerciseSessionType.cs' specified multiple times

To help ensure this is prevented in the future, turn
`CS2002` warnings into errors.
  • Loading branch information
jpobst authored Aug 9, 2023
1 parent a427688 commit 06224f3
Show file tree
Hide file tree
Showing 4 changed files with 442 additions and 294 deletions.
1 change: 1 addition & 0 deletions src/Mono.Android/Mono.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\product.snk</AssemblyOriginatorKeyFile>
<NoWarn>0618;0809;0108;0114;0465;8609;8610;8614;8617;8613;8764;8765;8766;8767;RS0041</NoWarn>
<WarningsAsErrors>$(WarningsAsErrors);CS2002</WarningsAsErrors>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefineConstants>$(DefineConstants);JAVA_INTEROP</DefineConstants>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\$(TargetFramework)\android-$(AndroidPlatformId)\</IntermediateOutputPath>
Expand Down
Loading

0 comments on commit 06224f3

Please sign in to comment.