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

Support or Documentation of Creating of Packages with Native Applications - PhantomJS #3931

Open
greghroberts opened this issue Nov 11, 2016 · 1 comment
Labels
Functionality:Pack Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog.
Milestone

Comments

@greghroberts
Copy link

Details about Problem

This is either a documentation problem, a potential clarification, or possibly a feature request.
My scenario is that I want to create a package for a native binary executable, like phantomjs, not a library. I want that binary to be put in the output folder on build or a known path that is appropriate for the user's current OS and can be programmed against easily.

Using the snippet below for a package only copies to the runtimes folder on dotnet publish. So it's unclear what path you should program against to launch the process. Unlike libraries where you use DllImport attribute which does some magic to locate the lib, it's unclear how to locate this package during development.

Overall, I just want to know what is best practice for this situation. Other languages, package managers handle this fine.

Example of how NPM handles this. https://www.npmjs.com/package/phantomjs
Ruby Gem https://rubygems.org/gems/phantomjs/versions/2.1.1.0

Snippet from my project.json of package

 "packOptions": {
    "tags": [
      "phantomjs", "pdf"
    ],
    "files": {
      "mappings": {
        "/": "License.txt",
        "runtimes/win7-x64/native/": "runtimes/win7/native/*",
        "runtimes/win7-x86/native/": "runtimes/win7/native/*",
        "runtimes/osx/native/": "runtimes/osx/native/*",
        "runtimes/linux/native/": "runtimes/linux-x64/native/*",
        "runtimes/debian-x64/native/": "runtimes/linux-x64/native/*",
        "runtimes/opensuse-x64/native/": "runtimes/linux-x64/native/*",
        "runtimes/fedora-x64/native/": "runtimes/linux-x64/native/*"
      }
    }
  },

NuGet product used (dotnet.exe and project.json):
3.4.4.1321

dotnet.exe --version (if appropirate):
1.0.0-preview2-003121

VS version (if appropriate):
NA

OS version (i.e. win10 v1607 (14393.321)):
Any

@veikkoeeva
Copy link

@greghroberts If I understand your problem correctly, https://stackoverflow.com/questions/49162127/how-to-include-native-assets-in-nuget-on-multiple-platforms-only-64-bit should help doing this. I used this arrangement to package a native 64 bit executable along with a .NET Standard 2.0 library and restore it as a PackageReference in another .NET Standard 2.0 project so that it's being copied to project output. I tested by calling File.Exists(".exe") and it was found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality:Pack Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog.
Projects
None yet
Development

No branches or pull requests

7 participants