-
-
Notifications
You must be signed in to change notification settings - Fork 646
Add support of nugetsource for local directory.
#2621
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| #include "premake.h" | ||
|
|
||
| #ifdef PREMAKE_COMPRESSION | ||
|
|
||
| #include "zip.h" | ||
|
|
||
| int zip_list(lua_State* L) | ||
| { | ||
| const char* src = luaL_checkstring(L, 1); | ||
|
|
||
| int err = 0; | ||
| struct zip* z_archive = zip_open(src, 0, &err); | ||
|
|
||
| if(!z_archive) | ||
| { | ||
| lua_newtable(L); | ||
| lua_pushstring(L, "Cannot open file"); | ||
| return 2; | ||
| } | ||
| const zip_int64_t entries_count = zip_get_num_entries(z_archive, 0); | ||
| lua_createtable(L, entries_count, 0); | ||
| for(zip_int64_t i = 0; i != entries_count; ++i) | ||
| { | ||
| const char* full_name = zip_get_name(z_archive, i, 0); | ||
| lua_pushstring(L, full_name); | ||
| lua_rawseti(L, -2, i); | ||
| } | ||
| zip_close(z_archive); | ||
| lua_pushnil(L); | ||
| return 2; | ||
| } | ||
|
|
||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,22 +6,30 @@ nugetsource ("url") | |
|
|
||
| ### Parameters ### | ||
|
|
||
| `url` is the NuGet v3 feed URL. | ||
| `url` is the NuGet v3 feed URL or local directory. | ||
|
|
||
| ### Applies To ### | ||
|
|
||
| Project configurations. | ||
|
|
||
| ### Availability ### | ||
|
|
||
| Premake 5.0.0-alpha12 or later. | ||
| Nuget "galleries" since Premake 5.0.0-alpha12 or later. | ||
| Local directory since Premake 5.0.0 or later. | ||
|
|
||
| ### Examples ### | ||
|
|
||
| Set source to NuGet gallery. | ||
|
|
||
| ```lua | ||
| nugetsource "https://api.nuget.org/v3/index.json" | ||
| ``` | ||
|
|
||
| Set source to local directory. | ||
|
|
||
| ```lua | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a comment to both the original snippet and this snippet describing it
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I should have been more specific. This is what I'm looking for: https://premake.github.io/docs/defines/ -- Not in the code block itself, but a snippet above describing what the example does.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved. |
||
| nugetsource "c:/my_nuget_packages/" | ||
| ``` | ||
| ### See Also ### | ||
|
|
||
| * [nuget](nuget.md) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| Get list of file paths contained in an archive. | ||
|
|
||
| ```lua | ||
| local entries, err = zip.list(sourceZip) | ||
| ``` | ||
|
|
||
| ### Parameters ### | ||
| - `sourceZip` is the zip file which has to be extracted | ||
|
|
||
| ### Return Value ### | ||
|
|
||
| A new table containing the path of files contained in the archive, following with error string. | ||
|
|
||
| ### Availability ### | ||
|
|
||
| Premake 5.0.0 or later. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we write an issue to track that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, moved code BTW.
Not sure how Nuget is used outside MSVC.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used with dotnet on MacOS, Linux, and Windows in addition to the native C++ packages on Windows. That said, Microsoft recommends vcpkg now for native projects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added #2630