Skip to content

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

@greghroberts

Description

@greghroberts

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Functionality:PackPriority:3Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions