Skip to content

Commit 11eacb7

Browse files
committed
Address review feedback.
1 parent 74724c0 commit 11eacb7

File tree

22 files changed

+53
-49
lines changed

22 files changed

+53
-49
lines changed

Directory.Build.props

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
<!-- Note: MUST be imported *after* $(Configuration) is set! -->
44
<PropertyGroup>
55
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<TreatWarningsAsErrors Condition=" '$(Configuration)' == 'Release' ">true</TreatWarningsAsErrors>
67
<_OutputPath>$(MSBuildThisFileDirectory)bin\Build$(Configuration)\</_OutputPath>
78
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
89
<ProduceReferenceAssemblyInOutDir>true</ProduceReferenceAssemblyInOutDir>
910
<DotNetTargetFrameworkVersion>7.0</DotNetTargetFrameworkVersion>
1011
<DotNetTargetFramework>net$(DotNetTargetFrameworkVersion)</DotNetTargetFramework>
11-
<!-- These assemblies are used by Xamarin.Android.Build.Tasks which must be netstandard2.0
12-
in order to be loaded into Visual Studio -->
13-
<MSBuildRequiredTargetFramework>netstandard2.0</MSBuildRequiredTargetFramework>
1412
</PropertyGroup>
1513

1614
<Import
@@ -69,19 +67,10 @@
6967
</PropertyGroup>
7068

7169
<!--
72-
When building on a bot w/ VS2019:
73-
74-
warning CS8032: An instance of analyzer System.Text.Json.SourceGeneration.JsonSourceGenerator cannot be created from
75-
76-
however, with `$(TreatWarningsAsErrors)`=True, this becomes an error,
77-
meaning we can't build on VS2019.
78-
79-
Ignore CS8032 so that we can build on VS2019.
80-
8170
JniEnvironment.g.cs(34,8): error CS8981: The type name 'jobject' only contains lower-cased ascii characters. Such names may become reserved for the language.
8271
-->
8372
<PropertyGroup>
84-
<NoWarn>$(NoWarn);CS8032;CS8981</NoWarn>
73+
<NoWarn>$(NoWarn);CS8981</NoWarn>
8574
</PropertyGroup>
8675

8776
</Project>

build-tools/automation/azure-pipelines.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ variables:
2121
RunningOnCI: true
2222
Build.Configuration: Release
2323
MaxJdkVersion: 8
24-
DotNetCoreVersion: 7.0.100-rc.1.22431.12
24+
DotNetCoreVersion: 7.x
2525
DotNetTargetFramework: net7.0
2626
NetCoreTargetFrameworkPathSuffix: -$(DotNetTargetFramework)
2727
1ESWindowsPool: AzurePipelines-EO

build-tools/automation/templates/install-dependencies.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ steps:
66
displayName: Use .NET $(DotNetCoreVersion)
77
inputs:
88
version: $(DotNetCoreVersion)
9-
includePreviewVersions: true

src/Java.Interop.Localization/Java.Interop.Localization.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>$(MSBuildRequiredTargetFramework)</TargetFramework>
4+
<TargetFramework>netstandard2.0</TargetFramework>
55
<LangVersion>8.0</LangVersion>
66
<Nullable>enable</Nullable>
77
<DefineConstants>INTERNAL_NULLABLE_ATTRIBUTES</DefineConstants>

src/Java.Interop.Localization/Resources.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Java.Interop.Localization/Resources.resx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,11 @@ The following terms should not be translated: Metadata.xml.</comment>
294294
<value>Invalid namespace transform '{0}'</value>
295295
<comment>{0} - XML transform. (example: '&lt;ns-replace source="example" replacement="Example" /&gt;')</comment>
296296
</data>
297+
<data name="Generator_BG8A08" xml:space="preserve">
298+
<value>Metadata.xml element '{0}' is missing the 'path' attribute.</value>
299+
<comment>{0} - XML transform. (example: '&lt;remove-node path="/api/package[@name='javax.sql']"')
300+
The following terms should not be translated: Metadata.xml, path.</comment>
301+
</data>
297302
<data name="Generator_BG8B00" xml:space="preserve">
298303
<value>Unknown generic argument constraint type '{0}' for member '{1}'.</value>
299304
<comment>{0} - .NET type name

src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>$(MSBuildRequiredTargetFramework)</TargetFramework>
4+
<TargetFramework>netstandard2.0</TargetFramework>
55
<LangVersion>8.0</LangVersion>
66
<Nullable>enable</Nullable>
77
<DefineConstants>INTERNAL_NULLABLE_ATTRIBUTES</DefineConstants>

src/Java.Interop.Tools.Diagnostics/Java.Interop.Tools.Diagnostics.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>$(MSBuildRequiredTargetFramework)</TargetFramework>
4+
<TargetFramework>netstandard2.0</TargetFramework>
55
<LangVersion>8.0</LangVersion>
66
<Nullable>enable</Nullable>
77
<DefineConstants>INTERNAL_NULLABLE_ATTRIBUTES</DefineConstants>

src/Java.Interop.Tools.Generator/Enumification/ConstantEntry.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,18 +148,18 @@ public static ConstantEntry FromElement (XElement elem)
148148
var entry = new ConstantEntry {
149149
Action = ConstantAction.None,
150150
ApiLevel = NamingConverter.ParseApiLevel (elem),
151-
JavaSignature = elem.Parent.Parent.Attribute ("name").Value,
151+
JavaSignature = elem.Parent?.Parent?.Attribute ("name")?.Value,
152152
Value = elem.Attribute ("value")?.Value,
153153
};
154154

155-
var java_package = elem.Parent.Parent.Attribute ("name").Value.Replace ('.', '/');
156-
var java_type = elem.Parent.Attribute ("name").Value.Replace ('.', '$');
157-
var java_member = elem.Attribute ("name").Value;
155+
var java_package = elem.Parent?.Parent?.Attribute ("name")?.Value.Replace ('.', '/');
156+
var java_type = elem.Parent?.Attribute ("name")?.Value.Replace ('.', '$');
157+
var java_member = elem.Attribute ("name")?.Value;
158158

159159
entry.JavaSignature = $"{java_package}/{java_type}.{java_member}".TrimStart ('/');
160160

161161
// Interfaces get an "I:" prefix
162-
if (elem.Parent.Name.LocalName == "interface")
162+
if (elem.Parent?.Name.LocalName == "interface")
163163
entry.JavaSignature = "I:" + entry.JavaSignature;
164164

165165
return entry;

src/Java.Interop.Tools.Generator/Enumification/ConstantsParser.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static List<ConstantEntry> FromEnumMapCsv (TextReader reader)
2020
var constants = new List<ConstantEntry> ();
2121
var transient = false;
2222

23-
string s;
23+
string? s;
2424

2525
// Read the enum csv file
2626
while ((s = reader.ReadLine ()) != null) {
@@ -105,7 +105,7 @@ public class JavaSignatureComparer : IEqualityComparer<ConstantEntry>
105105
{
106106
public static JavaSignatureComparer Instance { get; } = new JavaSignatureComparer ();
107107

108-
public bool Equals (ConstantEntry x, ConstantEntry y) => x?.JavaSignature == y?.JavaSignature;
108+
public bool Equals (ConstantEntry? x, ConstantEntry? y) => x?.JavaSignature == y?.JavaSignature;
109109
public int GetHashCode (ConstantEntry obj) => 0;
110110
}
111111
}

0 commit comments

Comments
 (0)