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

Tests fail with FileNotFoundException #268

Closed
masesdevelopers opened this issue Jul 29, 2024 · 2 comments
Closed

Tests fail with FileNotFoundException #268

masesdevelopers opened this issue Jul 29, 2024 · 2 comments
Assignees
Labels
bug Something isn't working KEFCore SerDes The issue is releated to KEFCore SerDes KEFCore The issue is releated to KEFCore

Comments

@masesdevelopers
Copy link
Collaborator

masesdevelopers commented Jul 29, 2024

Test fails with the following error:

Unhandled exception. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.IO.FileNotFoundException: Unable to identify JNet Jar location
File name: '/home/runner/work/KEFCore/KEFCore/bin/net6.0/jars/jnet-2.5.6.jar'

Originally posted by @masesdevelopers in #266 (comment)

@masesdevelopers masesdevelopers self-assigned this Jul 29, 2024
@masesdevelopers masesdevelopers added bug Something isn't working KEFCore The issue is releated to KEFCore KEFCore SerDes The issue is releated to KEFCore SerDes labels Jul 29, 2024
@masesdevelopers
Copy link
Collaborator Author

Currently the missing JAR is not a direct problem for KEFCore, however the latest version of JNet introduced, with masesgroup/JNet#479, a check on needed JARs and the issue is raised.
The missing JAR is related to the import chain of *.targets files, i.e. JNet defines a mases.jnet.targets with the following content:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <jnet_jars Include="$(MSBuildThisFileDirectory)\jars\*.*" />
  </ItemGroup>

  <Target Name="CopyFilesNative" BeforeTargets="Build">
    <Copy SourceFiles="@(jnet_jars)" DestinationFolder="$(TargetDir)\jars" />
  </Target>
  
  <Target Name="CopyFilesNativePublish" BeforeTargets="Publish">
    <Copy SourceFiles="@(jnet_jars)" DestinationFolder="$(PublishDir)\jars" />
  </Target>
</Project>

and KNet defines a mases.knet.targets with the following content:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <knet_jars Include="$(MSBuildThisFileDirectory)\jars\*.*" />
    <knet_config Include="$(MSBuildThisFileDirectory)\config\*.*" />
    <knet_configKraft Include="$(MSBuildThisFileDirectory)\config\kraft\*.*" />
  </ItemGroup>

  <Target Name="CopyFilesNative" BeforeTargets="Build">
    <Copy SourceFiles="@(knet_jars)" DestinationFolder="$(TargetDir)/jars" />
    <Copy SourceFiles="@(knet_config)" DestinationFolder="$(TargetDir)/config" />
    <Copy SourceFiles="@(knet_configKraft)" DestinationFolder="$(TargetDir)/config/kraft" />
  </Target>
  
  <Target Name="CopyFilesNativePublish" BeforeTargets="Publish">
    <Copy SourceFiles="@(knet_jars)" DestinationFolder="$(PublishDir)/jars" />
    <Copy SourceFiles="@(knet_config)" DestinationFolder="$(PublishDir)/config" />
    <Copy SourceFiles="@(knet_configKraft)" DestinationFolder="$(PublishDir)/config/kraft" />
  </Target>
</Project>

From both files it is possible to highlight that Targets have the same name, so chaining the *.targets the latest one replace the previous one.
Replacing lacally the Targets of mases.jnet.targets with another name the build chain works fine.
So, to avoid confusion Targets of mases.(jnet/knet).targets shall be renamed with a name that is specific for each project.

@masesdevelopers
Copy link
Collaborator Author

Solved with #270

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working KEFCore SerDes The issue is releated to KEFCore SerDes KEFCore The issue is releated to KEFCore
Projects
None yet
Development

No branches or pull requests

1 participant