Skip to content

Conversation

@jpobst
Copy link
Contributor

@jpobst jpobst commented Apr 18, 2022

Context: NuGet/Home#6461

Trying to build Java.Interop.csproj in Visual Studio currently fails with several errors like:

Error NETSDK1005 Assets file 'C:\code\xamarin-android\external\Java.Interop\tools\generator\obj\project.assets.json' 
doesn't have a target for 'net6.0'. Ensure that restore has run and that you have included 'net6.0' in the 
TargetFrameworks for your project.

Even though we don't build NuGet packages, it still attempts to calculate the NuGet package name, which includes the assembly $(Version) if $(PackageVersion) isn't specified. Because our assemblies have different versions per-TFM, that causes a problem because the package can't have multiple versions in it.

We can set a dummy $(PackageVersion) because we don't actually need it.

Also updates the generator.slnf for additional needed projects to build generator.

@jpobst jpobst marked this pull request as ready for review April 18, 2022 21:46
per-TFM, that causes a problem because the package can't have multiple versions in it.
Set a dummy PackageVersion because we don't actually need it.
-->
<PackageVersion>1.0.0.0</PackageVersion>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we'd change this if we ever ship a NuGet package from this repo? Maybe wouldn't happen.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we could drop this hack when we no longer target classic.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If (when?) we ever ship a NuGet package from this repo, it should presumably match the version of Java.Interop.dll, which will match the .NET version it's shipping with (6.0.0.0, 7.0.0.0, etc.).

Thus, perhaps we should set $(PackageVersion)=6.0.0.0?

Copy link
Contributor Author

@jpobst jpobst Apr 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that we have no intentions of releasing a NuGet package from this repo, I suspect a 6.0.0.0 version number will be just as obsolete as 1.0.0.0 if we ever do ship a package. 😁

@jonpryor jonpryor merged commit 968e0f5 into main Apr 20, 2022
@jonpryor jonpryor deleted the fix-vs branch April 20, 2022 19:37
@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants