Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi targeting #15

Merged
merged 6 commits into from
Nov 13, 2019
Merged

Multi targeting #15

merged 6 commits into from
Nov 13, 2019

Conversation

pluskal
Copy link
Contributor

@pluskal pluskal commented Nov 11, 2019

Changing csproj to new version VS2017+ as a prerequisite for Adding async support

netstandard1.3 is the lowest compatible .netstandard version that supports current implementation.

dotnet pack -c release build and packs project into KaitaiStruct.Runtime.CSharp.0.7.0.nupkg in bin/release/

  • removing AssemblyInfo.cs and kaitai_struct_runtime_csharp.nuspec
    • All information is moved into the csproj
    • LICENSE → LICENSE.txt - the new csproj deprecates PackageLicenseUrl but accepts PackageLicenseFile (see Packaging-License)
    • Adding icon.png because new csproj deprecates IconPackageUrl but accepts PackageIcon (see Packaging-Icon)
    • ProjectGuid is no longer needed in the new project system, it should be part of the solution that is not present in this repo
    • Disabling warning for CS1591 - The -doc compiler option was specified, but one or more constructs did not have comments.

@pluskal
Copy link
Contributor Author

pluskal commented Nov 13, 2019

I took a liberty to bump up a version 0.8.0.0 as you mentioned in Adding async support that tag was forgotten.

@pluskal
Copy link
Contributor Author

pluskal commented Nov 13, 2019

This PR also resolves #6

@GreyCat
Copy link
Member

GreyCat commented Nov 13, 2019

Everything seems to be fine, so merging this one. Thanks!

@GreyCat GreyCat merged commit 155c789 into kaitai-io:master Nov 13, 2019
@GreyCat
Copy link
Member

GreyCat commented Dec 1, 2019

Ok, unfortunately, it looks like this transition has broken quite a few builds:

  • Mono 4.6.2 on Linux / Ubuntu 18.04 or Mono 5.18.0.240 on Linux / Ubuntu 19.10 (using xbuild) end up with this error:
XBuild Engine Version 14.0
Mono, Version 5.18.0.240
Copyright (C) 2005-2013 Various Mono authors

Build started 01/12/2019 09:33:33.
__________________________________________________
kaitai_struct_runtime_csharp.csproj: error : /home/greycat/git/kaitai_struct/runtime/csharp/kaitai_struct_runtime_csharp.csproj: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format.  
Build FAILED.
  • .NET Core 2.2 or 3.0 on Linux / Ubuntu 18.04, using dotnet build:
Microsoft (R) Build Engine version 16.3.2+e481bbf88 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 121.4 ms for /home/greycat/git/kaitai_struct/runtime/csharp/kaitai_struct_runtime_csharp.csproj.
/usr/share/dotnet/sdk/3.0.101/Microsoft.Common.CurrentVersion.targets(1175,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.5 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks [/home/greycat/git/kaitai_struct/runtime/csharp/kaitai_struct_runtime_csharp.csproj]
  kaitai_struct_runtime_csharp -> /home/greycat/git/kaitai_struct/runtime/csharp/bin/Debug/netstandard1.3/Kaitai.Struct.Runtime.dll

Build FAILED.

The only way I've managed to build this is with .NET Core, removing net4.5 target framework:

-    <TargetFrameworks>netstandard1.3;net4.5</TargetFrameworks>
+    <TargetFrameworks>netstandard1.3</TargetFrameworks>

@pluskal
Copy link
Contributor Author

pluskal commented Dec 12, 2019

I am sorry to miss that. Is there any way to submit job to CI to see results before you merge it?

I am looking at https://ci.kaitai.io/ and see only csharp net45_windows, the rest like mono/netcore are nolonger there?

netstandard1.3 supports net4.6+ so removing it would cut off net4.5.
netstandard1.2 that supports net4.5 but is missing System.IO.File so it would break support for opening a file by filepath. Stream would still work.

Btw. KaitaiStream is not disposable so if someone uses this, the stream is not disposed.

In case you want to remove net4.5, the appropriate element is TargetFramework instead of TargetFrameworks

<TargetFramework>netstandard1.3</TargetFramework>

But, can you try following, I have previously seen that if you put the framework first, some compilers starts to work.

<TargetFrameworks>net4.5;netstandard1.3</TargetFrameworks>

@pluskal pluskal deleted the Multi-targeting branch January 30, 2020 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants