Skip to content

Commit 6b38a3e

Browse files
committed
[Docs] Updated README with install the package locally and remotelly steps
1 parent d340f22 commit 6b38a3e

File tree

8 files changed

+72
-8
lines changed

8 files changed

+72
-8
lines changed

.vscode/extensions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"ms-dotnettools.csharp",
1212
"ionide.ionide-paket",
1313
"eridem.vscode-nupkg",
14-
"ms-azure-devops.azure-pipelines"
14+
"ms-azure-devops.azure-pipelines",
15+
"k--kato.docomment"
1516
],
1617
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
1718
"unwantedRecommendations": [

ComponentBase.sln

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ VisualStudioVersion = 16.0.30225.117
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".paket", ".paket", "{39BC1193-8B28-46D4-A7C4-169B1BD0BE1E}"
77
ProjectSection(SolutionItems) = preProject
8+
ComponentBase\ComponentBase.csproj.paket.template = ComponentBase\ComponentBase.csproj.paket.template
89
paket.dependencies = paket.dependencies
910
EndProjectSection
1011
EndProject
@@ -16,6 +17,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1617
ProjectSection(SolutionItems) = preProject
1718
.editorconfig = .editorconfig
1819
.gitignore = .gitignore
20+
azure-pipelines.yml = azure-pipelines.yml
1921
nuget.config = nuget.config
2022
README.md = README.md
2123
EndProjectSection

README.md

Lines changed: 68 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ This is a **nuget/paket** main scaffold component to create others packages
99
* ### [.NET Core](https://dotnet.microsoft.com/download)
1010
> Build and run tests
1111
12-
* ### [Nuget CLI](https://chocolatey.org/packages/NuGet.CommandLine/5.6.0)
12+
* ### [Nuget CLI (Command Line)](https://chocolatey.org/packages/NuGet.CommandLine/5.6.0)
1313
> .NET official package manager to generate **```.nupkg```** file
1414
1515
* ### [Paket](https://fsprojects.github.io/Paket/index.html)
16-
> Integrated with [Nuget]() to manage dependencies, with more clear files and allow use **Git** dependencies
16+
> Integrated with [Nuget](https://www.nuget.org) to manage dependencies, with more clear files and allow use **Git** dependencies
1717
1818

1919
## Getting Started
@@ -61,7 +61,7 @@ Use [.NET Core tools](https://docs.microsoft.com/en-us/dotnet/core/tools/global-
6161
Use [Chocolatey](https://chocolatey.org/)
6262

6363
```bash
64-
# Install base Azure command line
64+
# Install base Azure CLI (command line)
6565
choco install azure-cli
6666
6767
# Install Azure Devops extensions
@@ -99,8 +99,7 @@ Your project folders structure should be:
9999
> The project with your library/component
100100
- 📄 [ComponentBaseComponent.csproj](ComponentBaseComponent/ComponentBaseComponent.csproj)
101101

102-
![Component.Directories](./images/Component.Tree.Explanation.png)
103-
102+
![component-directories-explanation](./images/component-tree-explanation.png)
104103

105104
## Generating package (```.nupkg```)
106105

@@ -119,9 +118,43 @@ Your project folders structure should be:
119118
# Pack your component to the path nugets/*.nupkg
120119
dotnet pack --include-symbols --configuration Release --output nugets [your-component-project]
121120
```
122-
> **PS:** If you not pass the **_--outputs_** flag, the ```.nupkg``` file is generated in: ```[your-component-project]/bin/Release``` by default
121+
> **PS:** If you not pass the **_--outputs_** flag, the ```.nupkg``` file is generated in: ```[your-component-project]/bin/Release``` by default
122+
123+
Or use Visual Studio and right click on your project component under Solution explorer, and click **Pack**.
124+
125+
![component-pack-nupkg](./images/component-pack.png)
126+
127+
## Testing your package locally
128+
129+
1. After [generated the `.nupkg`](#generating-package-nupkg) file, create a folder accessible to you (local directory or network share) as package repo:
130+
131+
Publish the package to local repo using `nuget add`:
132+
133+
```bash
134+
nuget add [my-component.{version-number}].nupkg -source [your/local-repo/directory]
135+
```
136+
2. Using [Paket](https://fsprojects.github.io/Paket/index.html), add your local folder like a `source` to the `paket.dependencies` file, in a project/application that will use this package like a dependency:
137+
138+
```bash
139+
source D:\source\nuget_repo
140+
source ~/source/nuget_repo
141+
source \\server\nuget_repo
142+
143+
# Paket supports relative directory to the paket.dependencies too
144+
source directory/relative/to/paket.dependencies
145+
```
146+
147+
If your destiny project/application uses only [Nuget](https://www.nuget.org) like a package manager (without **`Paket`**), you can add the nuget repo folder mentioned above with **Visual Studio**:
148+
149+
![component-local-source-folder](images/component-local-source.png)
150+
151+
For more information, see these tutorials:
123152

124-
## Publish to Azure Devops
153+
- [Testing NuGet packages locally](https://blog.verslu.is/nuget/testing-nuget-packages-locally)
154+
- [Creating and using a local NuGet package repository](https://medium.com/@churi.vibhav/creating-and-using-a-local-nuget-package-repository-9f19475d6af8)
155+
156+
157+
## Publish to Azure Devops/Artifacts
125158

126159
1. Restore the project to provide authentication
127160

@@ -135,3 +168,31 @@ Your project folders structure should be:
135168
# See the nuget.config file <packageSources> tag
136169
nuget push -Source "[your-feed-name]" -ApiKey az [path/to/nupkg-file].nupkg
137170
```
171+
172+
## Install remote package to an application
173+
174+
1. Using [Paket](https://fsprojects.github.io/Paket/index.html), add your **remote feed URL** like a `source` to the `paket.dependencies` file, in a project/application that will use this package like a dependency:
175+
176+
```bash
177+
source https://pkgs.dev.azure.com/opitblast/_packaging/opitblast/nuget/v3/index.json
178+
179+
# Paket supports relative directory to the paket.dependencies too
180+
source directory/relative/to/paket.dependencies
181+
```
182+
183+
2. Add the **packageId** like a dependency into `paket.dependencies` file of your application:
184+
185+
![component-packageid-dependency](images/component-packageid-dependency.png)
186+
187+
If your destiny project/application uses only [Nuget](https://www.nuget.org) like a package manager (without **`Paket`**), you can add the **remote feed URL** mentioned above with **Visual Studio**:
188+
189+
![component-remote-source](images/component-remote-source.png)
190+
191+
Where:
192+
193+
- **[organization]**: replace with your organization name defined in Azure Devops
194+
- **[feed]**: replace with your private feed (by organization or project) where the package that will be used like an dependency was uploaded.
195+
196+
For more information, see this official Microsoft tutorial:
197+
198+
- [Visual Studio Package Sources](https://docs.microsoft.com/en-us/nuget/consume-packages/install-use-packages-visual-studio#package-sources)

images/component-local-source.png

76.8 KB
Loading

images/component-pack.png

10.3 KB
Loading
7.7 KB
Loading

images/component-remote-source.png

29.3 KB
Loading

0 commit comments

Comments
 (0)