Skip to content

Commit ff3081d

Browse files
jpobstjonpryor
authored andcommitted
[build] Migrate library projects to SDK style + netstandard2.0 (#507)
Migrate most non-unit-test libraries to use the new MSBuild [Short-Form Project (previously SDK-style projects)][0] format, targeting [.NET Standard 2.0][1]. Test projects aren't converted yet. (I prefer to do this in smaller chunks and make sure each part works.) [0]: https://docs.microsoft.com/en-us/dotnet/core/tools/csproj#additions [1]: https://docs.microsoft.com/en-us/dotnet/standard/net-standard#net-implementation-support
1 parent f5d29c3 commit ff3081d

File tree

19 files changed

+115
-520
lines changed

19 files changed

+115
-520
lines changed
Lines changed: 11 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,20 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
33
<PropertyGroup>
4-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6-
<ProductVersion>8.0.30703</ProductVersion>
7-
<SchemaVersion>2.0</SchemaVersion>
8-
<ProjectGuid>{D48EE8D0-0A0A-4493-AEF5-DAF5F8CF86AD}</ProjectGuid>
9-
<OutputType>Library</OutputType>
10-
<RootNamespace>Java.Interop.Tools.Cecil</RootNamespace>
11-
<AssemblyName>Java.Interop.Tools.Cecil</AssemblyName>
12-
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
4+
<TargetFramework>netstandard2.0</TargetFramework>
135
</PropertyGroup>
14-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
15-
<DebugSymbols>true</DebugSymbols>
16-
<DebugType>full</DebugType>
17-
<Optimize>false</Optimize>
6+
7+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
188
<OutputPath>..\..\bin\Debug</OutputPath>
19-
<DefineConstants>DEBUG;</DefineConstants>
20-
<ErrorReport>prompt</ErrorReport>
21-
<WarningLevel>4</WarningLevel>
22-
<ConsolePause>false</ConsolePause>
239
</PropertyGroup>
24-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25-
<DebugType>full</DebugType>
26-
<Optimize>true</Optimize>
10+
11+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
2712
<OutputPath>..\..\bin\Release</OutputPath>
28-
<ErrorReport>prompt</ErrorReport>
29-
<WarningLevel>4</WarningLevel>
30-
<ConsolePause>false</ConsolePause>
3113
</PropertyGroup>
14+
3215
<ItemGroup>
33-
<Reference Include="System" />
16+
<ProjectReference Include="..\Java.Interop.Tools.Diagnostics\Java.Interop.Tools.Diagnostics.csproj" />
17+
<ProjectReference Include="..\Xamarin.Android.Cecil\Xamarin.Android.Cecil.csproj" />
3418
</ItemGroup>
35-
<ItemGroup>
36-
<Compile Include="Properties\AssemblyInfo.cs" />
37-
<Compile Include="Java.Interop.Tools.Cecil\CustomAttributeProviderRocks.cs" />
38-
<Compile Include="Java.Interop.Tools.Cecil\DirectoryAssemblyResolver.cs" />
39-
<Compile Include="Java.Interop.Tools.Cecil\MethodDefinitionRocks.cs" />
40-
<Compile Include="Java.Interop.Tools.Cecil\TypeDefinitionRocks.cs" />
41-
</ItemGroup>
42-
<ItemGroup>
43-
<ProjectReference Include="..\Java.Interop.Tools.Diagnostics\Java.Interop.Tools.Diagnostics.csproj">
44-
<Project>{64CC4E44-CE3A-4319-BF3F-6CF8BD513870}</Project>
45-
<Name>Java.Interop.Tools.Diagnostics</Name>
46-
</ProjectReference>
47-
<ProjectReference Include="..\Xamarin.Android.Cecil\Xamarin.Android.Cecil.csproj">
48-
<Project>{15945D4B-FF56-4BCC-B598-2718D199DD08}</Project>
49-
<Name>Xamarin.Android.Cecil</Name>
50-
</ProjectReference>
51-
</ItemGroup>
52-
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
19+
5320
</Project>

src/Java.Interop.Tools.Cecil/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 11 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,19 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
33
<PropertyGroup>
4-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6-
<ProductVersion>8.0.30703</ProductVersion>
7-
<SchemaVersion>2.0</SchemaVersion>
8-
<ProjectGuid>{64CC4E44-CE3A-4319-BF3F-6CF8BD513870}</ProjectGuid>
9-
<OutputType>Library</OutputType>
10-
<RootNamespace>Java.Interop.Tools.Diagnostics</RootNamespace>
11-
<AssemblyName>Java.Interop.Tools.Diagnostics</AssemblyName>
12-
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
4+
<TargetFramework>netstandard2.0</TargetFramework>
135
</PropertyGroup>
14-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
15-
<DebugSymbols>true</DebugSymbols>
16-
<DebugType>full</DebugType>
17-
<Optimize>false</Optimize>
6+
7+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
188
<OutputPath>..\..\bin\Debug</OutputPath>
19-
<DefineConstants>DEBUG;</DefineConstants>
20-
<ErrorReport>prompt</ErrorReport>
21-
<WarningLevel>4</WarningLevel>
22-
<ConsolePause>false</ConsolePause>
239
</PropertyGroup>
24-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25-
<DebugType>full</DebugType>
26-
<Optimize>true</Optimize>
10+
11+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
2712
<OutputPath>..\..\bin\Release</OutputPath>
28-
<ErrorReport>prompt</ErrorReport>
29-
<WarningLevel>4</WarningLevel>
30-
<ConsolePause>false</ConsolePause>
3113
</PropertyGroup>
14+
3215
<ItemGroup>
33-
<Reference Include="System" />
16+
<ProjectReference Include="..\Xamarin.Android.Cecil\Xamarin.Android.Cecil.csproj" />
3417
</ItemGroup>
35-
<ItemGroup>
36-
<Compile Include="Properties\AssemblyInfo.cs" />
37-
<Compile Include="Java.Interop.Tools.Diagnostics\Diagnostic.cs" />
38-
<Compile Include="Java.Interop.Tools.Diagnostics\XamarinAndroidException.cs" />
39-
</ItemGroup>
40-
<ItemGroup>
41-
<ProjectReference Include="..\Xamarin.Android.Cecil\Xamarin.Android.Cecil.csproj">
42-
<Project>{15945D4B-FF56-4BCC-B598-2718D199DD08}</Project>
43-
<Name>Xamarin.Android.Cecil</Name>
44-
</ProjectReference>
45-
</ItemGroup>
46-
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
47-
</Project>
18+
19+
</Project>

src/Java.Interop.Tools.Diagnostics/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 18 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,35 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
33
<PropertyGroup>
4-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6-
<ProductVersion>8.0.30703</ProductVersion>
7-
<SchemaVersion>2.0</SchemaVersion>
8-
<ProjectGuid>{D18FCF91-8876-48A0-A693-2DC1E7D3D80A}</ProjectGuid>
9-
<OutputType>Library</OutputType>
10-
<RootNamespace>Java.Interop.Tools.JavaCallableWrappers</RootNamespace>
11-
<AssemblyName>Java.Interop.Tools.JavaCallableWrappers</AssemblyName>
12-
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
4+
<TargetFramework>netstandard2.0</TargetFramework>
135
</PropertyGroup>
14-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
15-
<DebugSymbols>true</DebugSymbols>
16-
<DebugType>full</DebugType>
17-
<Optimize>false</Optimize>
6+
7+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
188
<OutputPath>..\..\bin\Debug</OutputPath>
199
<DefineConstants>DEBUG;JCW_ONLY_TYPE_NAMES;HAVE_CECIL</DefineConstants>
20-
<ErrorReport>prompt</ErrorReport>
21-
<WarningLevel>4</WarningLevel>
22-
<ConsolePause>false</ConsolePause>
2310
</PropertyGroup>
24-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25-
<DebugType>full</DebugType>
26-
<Optimize>true</Optimize>
11+
12+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
2713
<OutputPath>..\..\bin\Release</OutputPath>
2814
<DefineConstants>JCW_ONLY_TYPE_NAMES;HAVE_CECIL</DefineConstants>
29-
<ErrorReport>prompt</ErrorReport>
30-
<WarningLevel>4</WarningLevel>
31-
<ConsolePause>false</ConsolePause>
3215
</PropertyGroup>
16+
3317
<ItemGroup>
34-
<Reference Include="System" />
35-
</ItemGroup>
36-
<ItemGroup>
37-
<Compile Include="Properties\AssemblyInfo.cs" />
38-
<Compile Include="Java.Interop.Tools.JavaCallableWrappers\Crc64.cs" />
39-
<Compile Include="Java.Interop.Tools.JavaCallableWrappers\IdentifierValidator.cs" />
40-
<Compile Include="Java.Interop.Tools.JavaCallableWrappers\JavaCallableWrapperGenerator.cs" />
41-
<Compile Include="Java.Interop.Tools.JavaCallableWrappers\JavaTypeScanner.cs" />
42-
<Compile Include="Java.Interop.Tools.JavaCallableWrappers\TypeNameMapGenerator.cs" />
18+
<Compile Remove="Test\**" />
19+
<EmbeddedResource Remove="Test\**" />
20+
<None Remove="Test\**" />
21+
4322
<Compile Include="..\Java.Interop.Tools.TypeNameMappings\Java.Interop.Tools.TypeNameMappings\JavaNativeTypeManager.cs">
4423
<Link>JavaNativeTypeManager.cs</Link>
4524
</Compile>
4625
</ItemGroup>
26+
4727
<ItemGroup>
48-
<ProjectReference Include="..\Java.Interop.Tools.Diagnostics\Java.Interop.Tools.Diagnostics.csproj">
49-
<Project>{64CC4E44-CE3A-4319-BF3F-6CF8BD513870}</Project>
50-
<Name>Java.Interop.Tools.Diagnostics</Name>
51-
</ProjectReference>
52-
<ProjectReference Include="..\Java.Interop.Tools.Cecil\Java.Interop.Tools.Cecil.csproj">
53-
<Project>{D48EE8D0-0A0A-4493-AEF5-DAF5F8CF86AD}</Project>
54-
<Name>Java.Interop.Tools.Cecil</Name>
55-
</ProjectReference>
56-
<ProjectReference Include="..\Xamarin.Android.Cecil\Xamarin.Android.Cecil.csproj">
57-
<Project>{15945D4B-FF56-4BCC-B598-2718D199DD08}</Project>
58-
<Name>Xamarin.Android.Cecil</Name>
59-
</ProjectReference>
28+
<ProjectReference Include="..\Java.Interop.Tools.Cecil\Java.Interop.Tools.Cecil.csproj" />
29+
<ProjectReference Include="..\Java.Interop.Tools.Diagnostics\Java.Interop.Tools.Diagnostics.csproj" />
30+
<ProjectReference Include="..\Xamarin.Android.Cecil\Xamarin.Android.Cecil.csproj" />
6031
</ItemGroup>
32+
6133
<Import Project="..\Java.Interop.NamingCustomAttributes\Java.Interop.NamingCustomAttributes.projitems" Label="Shared" Condition="Exists('..\Java.Interop.NamingCustomAttributes\Java.Interop.NamingCustomAttributes.projitems')" />
62-
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
34+
6335
</Project>

src/Java.Interop.Tools.JavaCallableWrappers/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 14 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,29 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
33
<PropertyGroup>
4-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6-
<ProductVersion>8.0.30703</ProductVersion>
7-
<SchemaVersion>2.0</SchemaVersion>
8-
<ProjectGuid>{5887B410-D448-4257-A46B-EAC03C80BE93}</ProjectGuid>
9-
<OutputType>Library</OutputType>
10-
<RootNamespace>Java.Interop</RootNamespace>
11-
<AssemblyName>Java.Runtime.Environment</AssemblyName>
12-
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
4+
<TargetFramework>netstandard2.0</TargetFramework>
135
<SignAssembly>true</SignAssembly>
146
<AssemblyOriginatorKeyFile>..\..\product.snk</AssemblyOriginatorKeyFile>
7+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
8+
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
159
</PropertyGroup>
16-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17-
<DebugSymbols>true</DebugSymbols>
18-
<DebugType>full</DebugType>
19-
<Optimize>false</Optimize>
10+
11+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
2012
<OutputPath>..\..\bin\Debug</OutputPath>
21-
<DefineConstants>DEBUG;</DefineConstants>
22-
<ErrorReport>prompt</ErrorReport>
23-
<WarningLevel>4</WarningLevel>
24-
<ConsolePause>false</ConsolePause>
25-
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
2613
</PropertyGroup>
27-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28-
<DebugType>full</DebugType>
29-
<Optimize>true</Optimize>
14+
15+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
3016
<OutputPath>..\..\bin\Release</OutputPath>
31-
<ErrorReport>prompt</ErrorReport>
32-
<WarningLevel>4</WarningLevel>
33-
<ConsolePause>false</ConsolePause>
34-
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
3517
</PropertyGroup>
18+
3619
<ItemGroup>
37-
<Compile Include="Properties\AssemblyInfo.cs" />
38-
<Compile Include="Java.Interop\JreRuntime.cs" />
39-
<Compile Include="Java.Interop\MonoRuntimeObjectReferenceManager.cs" />
40-
<Compile Include="Java.Interop\MonoRuntimeValueManager.cs" />
41-
</ItemGroup>
42-
<ItemGroup>
43-
<Reference Include="System" />
44-
</ItemGroup>
45-
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
46-
<ItemGroup>
47-
<ProjectReference Include="..\Java.Interop\Java.Interop.csproj">
48-
<Project>{94BD81F7-B06F-4295-9636-F8A3B6BDC762}</Project>
49-
<Name>Java.Interop</Name>
50-
</ProjectReference>
20+
<ProjectReference Include="..\Java.Interop\Java.Interop.csproj" />
5121
</ItemGroup>
22+
5223
<ItemGroup>
5324
<Content Include="Java.Runtime.Environment.dll.config" Condition=" '$(OS)' != 'Windows_NT' ">
5425
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
5526
</Content>
5627
</ItemGroup>
57-
</Project>
28+
29+
</Project>

src/Java.Runtime.Environment/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)