Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

"kpm pack --no-source" should nupkg the main project #378

Closed
ChengTian opened this issue Jun 25, 2014 · 4 comments
Closed

"kpm pack --no-source" should nupkg the main project #378

ChengTian opened this issue Jun 25, 2014 · 4 comments
Assignees
Milestone

Comments

@ChengTian
Copy link
Contributor

See #80
In an initial implementation #371 , if we do kpm pack --no-source, the sources of main project are still exported. In next step, we want to export main project as a nupkg as well.

@lodejard @davidfowl , before we enable users to nupkg the main project, two points need to be clarified:

  1. @lodejard mentioned that we should enable users to specify the main package when they execute k run . I guess we can have something like
    k --main ./packages/MainProject.4.0.0.0 run?
  2. k run cannot execute without project.json. Can I simply copy the project.json file to {PACK_OUTPUT_DIR}/packages/MainProject.4.0.0.0/project.json?
@ChengTian ChengTian added this to the 1.0.0-alpha3 milestone Jun 25, 2014
@ChengTian ChengTian self-assigned this Jun 25, 2014
@davidfowl
Copy link
Member

  1. By name not path.
  2. Or we change k to understand nupkg's as well as project.json

@ChengTian
Copy link
Contributor Author

@davidfowl Changing k to understand nupkgs sounds better because, in this case, main packages have the same structure as common packages. Consistency is always good 😄

@ChengTian
Copy link
Contributor Author

@davidfowl , I am trying to make k understand nupkgs as we discussed above. Although I can get name, version and most other information from .nuspec file, the "loader" we specify in project.json is missing in .nuspec.

Seems we have no way to preserve "loader" information in this approach, should I turn to the approach where we copy and paste project.json into main nupkg?

@ChengTian
Copy link
Contributor Author

Had a discussion with @lodejard and @davidfowl and made the following design:

  1. Add files pattern in project.json
    To make sure non-source-code contents (including views, config files and etc.) are preserved in packed output, we add a new key files into project.json and the value of files specifies the pattern of files we want to preserve. Then we can get the files we want to preserve in output by subtracting all other specified files (including source files, exclude files, ignored files, shared files, preprocess files and resource files) from files that match files pattern. The default value of files is the pattern **.*.
  2. Structure of kpm pack --no-source output
    Assume we have an app MyApp with the following dir structure and MyApp depends on a NuGet package DependencyPackage.1.0.0.0.
    myapp
    After we do kpm pack --no-source in the root dir of MyApp, we will get the following output
    output
  3. How to run the packed app
    In the output above, execute k --app-name MyApp run in output/packages/MyApp.0.1-beta-SNAPSHOT/root/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants