{"componentChunkName":"component---src-pages-author-author-yaml-id-js","path":"/author/hitesh-pamnani/","result":{"data":{"allMarkdownRemark":{"edges":[{"node":{"id":"8a93da19-d5e6-5946-8796-674fa1afde91","html":"<p>NuGet is a free and open-source package manager for the .NET ecosystem. We can create and install packages using NuGet client tools. All of the .NET packages are hosted for publishing and consumption on a central package repository known as NuGet Gallery.</p>\n<p>Prerequisites</p>\n<ul>\n<li>Visual Studio 2017 (with .NET-related workload)</li>\n<li>nuget.exe (add it’s location to PATH environment variable)</li>\n<li>Valid account on nuget.org</li>\n</ul>\n<p><strong>Create a class library project</strong></p>\n<p>For a .NET package to be published in the NuGet Gallery, it should be a valid class library project. The following instructions can be used to create a simple class library project:</p>\n<ul>\n<li>Open Visual Studio, go to File > New > Project, expand the Visual C# > .NET Standard node. Select the \"Class Library (.NET Standard)\" template and provide a valid name.</li>\n<li>To build the project, right-click on the project file and select Build. A DLL file will be generated in the Debug folder or Release folder (if you build the configuration)</li>\n</ul>\n<p>For a real useful NuGet package, you should write necessary code which can be used by others to develop applications. However, a class library from the template is sufficient to create a package.</p>\n<p><strong>Configure Package Properties</strong></p>\n<ol>\n<li>Go to Project > Properties, select Package tab.</li>\n<li>Provide a unique identifier for your package and fill out other required properties. For a description of various properties, please visit <a href=\"https://docs.microsoft.com/en-us/nuget/reference/nuspec\">here</a>. The properties provided at this stage will be defined in .nuspec manifest that is created by Visual Studio for the project.</li>\n<li>To view the properties directly in the project file, right-click the project in Solution Explorer and select Edit AppLogger.csproj.</li>\n</ol>\n<p><strong>Run the pack command</strong></p>\n<ol>\n<li>Set the configuration to Release.</li>\n<li>Right click the project in Solution Explorer and select the Pack command.</li>\n<li>Visual Studio builds the project and creates the .nupkg file. Please note that the built package is in bin\\Release\\netstandard2.0 as befits the .NET Standard 2.0 target.</li>\n</ol>\n<p><strong>Acquire API Key</strong></p>\n<ol>\n<li><a href=\"https://www.nuget.org/users/account/LogOn?returnUrl=%2F\">Sign in to your nuget.org account</a> or create an account if it doesn’t already exist.</li>\n<li>Select your user name on the top right, then select API Keys.</li>\n<li>Select Create, provide a name for your key, select Select Scopes > Push.</li>\n<li>Under API Key, enter * for Glob pattern, then select Create.</li>\n<li>After the key is created, select Copy to retrieve the access key needed for publishing the package.</li>\n</ol>\n<p><strong>Important:</strong> Save your key in a secure location because you cannot copy the key again later on. If you return to the API key page, you need to regenerate the key to copy it.</p>\n<p><strong>Publish with nuget push</strong></p>\n<ol>\n<li>Open Command Prompt.</li>\n<li>Change to the folder containing the .nupkg file.</li>\n<li>\n<p>Run the following command, specifying your package name and replacing the key value with your API key:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"powershell\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">nuget push &amp;lt;PACKAGE-NAME&amp;gt;.nupkg &amp;lt;API-KEY&amp;gt; -Source https://api.nuget.org/v3/index.json</span></span></code></pre>\n</li>\n<li>nuget.exe displays the results of the publishing process.</li>\n</ol>\n<p><strong>Manage the published package</strong></p>\n<p>You can view your published package in your profile on nuget.org. Select Manage Packages to see the one that was just published. It might take a while for your package to be visible in search results.</p>\n<p>If you want to unlist the package and hide it from search results, follow the steps listed below:</p>\n<ol>\n<li>On nuget.org, select your user name on top right, then select Manage Packages.</li>\n<li>Find the package to be unlisted under Published and select the trash can icon on the right.</li>\n<li>On the next page, clear the box labeled List (package-name) in search results and select Save.</li>\n</ol>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n</style>","frontmatter":{"title":"Using NuGet to publish .NET packages","author":{"id":"Hitesh Pamnani","github":null,"avatar":null},"date":"June 28, 2018","updated_date":null,"tags":["NuGet",".NET"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1,"src":"/static/61bc9402fec623803bf04d21e948e84a/2a4de/desdev.png","srcSet":"/static/61bc9402fec623803bf04d21e948e84a/69585/desdev.png 200w,\n/static/61bc9402fec623803bf04d21e948e84a/497c6/desdev.png 400w,\n/static/61bc9402fec623803bf04d21e948e84a/2a4de/desdev.png 600w","sizes":"(max-width: 600px) 100vw, 600px"}}}},"fields":{"authorId":"Hitesh Pamnani","slug":"/engineering/using-nuget-to-publish-net-packages/"}}},{"node":{"id":"68c9203f-395f-5130-aae6-c0ee149c69c1","html":"<p>jCenter is the public repository hosted at <a href=\"https://bintray.com/\">bintray</a> that is free to use for open source library publishers. It is the largest repository in the world for Java and Android OSS libraries, packages and components. All the content in JCenter is served over a CDN, with a secure HTTPS connection. In this article, we’ll discuss how to make use of jCenter dependencies in Android Studio.</p>\n<p>Prerequisites</p>\n<ul>\n<li>Android Studio</li>\n<li>Existing project in Android Studio</li>\n<li>Active internet connection</li>\n</ul>\n<p>If you don’t have Android Studio installed, you can download from the following link:</p>\n<p><a href=\"https://developer.android.com/studio/index.html\">Android Studio</a></p>\n<p>After successfully installing Android Studio, you can open an existing project or create a new project to start with.</p>\n<p><strong>Usage</strong></p>\n<p>After opening or creating a new project, you can find two files named “build.gradle” under Gradle Scripts section in the left pane. The first one will be suffixed with “Project” and another with “Module”. We’ll start with the “Project” one.</p>\n<p>Add jCenter repository in project’s build.gradle file as shown below and sync your project:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">allprojects {</span>\n<span class=\"grvsc-line\">   repositories {</span>\n<span class=\"grvsc-line\">       jcenter()</span>\n<span class=\"grvsc-line\">\t   . . .</span>\n<span class=\"grvsc-line\">   }</span>\n<span class=\"grvsc-line\">}</span></code></pre>\n<p>On successful sync, you’re now able to add any Android dependency hosted on jCenter repository. The dependency will be added to “Module” build.gradle. It’s also known as app’s build.gradle.</p>\n<p>For example, if you want to add LoginRadius dependency/library, you can add in app’s build.gradle as follows and sync your project:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">compile &#39;com.loginradius.android:androidsdk:3.3.1&#39;</span></code></pre>\n<p>If all the steps are followed successfully, you’re now able to add a jCenter dependency in Android Studio.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n</style>","frontmatter":{"title":"jCenter Dependencies in Android Studio","author":{"id":"Hitesh Pamnani","github":null,"avatar":null},"date":"July 11, 2017","updated_date":null,"tags":["JCenter","Android"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.7699115044247788,"src":"/static/21f45b8f9eba48b3695a10929ce75fff/ee604/jCenter.png","srcSet":"/static/21f45b8f9eba48b3695a10929ce75fff/69585/jCenter.png 200w,\n/static/21f45b8f9eba48b3695a10929ce75fff/497c6/jCenter.png 400w,\n/static/21f45b8f9eba48b3695a10929ce75fff/ee604/jCenter.png 800w,\n/static/21f45b8f9eba48b3695a10929ce75fff/f3583/jCenter.png 1200w,\n/static/21f45b8f9eba48b3695a10929ce75fff/e4d72/jCenter.png 1280w","sizes":"(max-width: 800px) 100vw, 800px"}}}},"fields":{"authorId":"Hitesh Pamnani","slug":"/engineering/how-to-use-jcenter-dependencies-in-android-studio/"}}}]},"authorYaml":{"id":"Hitesh Pamnani","bio":"An enthusiastic developer with hands-on-experience in various tech platforms. Settled as an Android developer from past 4 years, worked on some interesting stuff and looking forward to more. Loves gadgets, soothing music and spending time with family.","github":null,"stackoverflow":null,"linkedin":null,"medium":null,"twitter":null,"avatar":null}},"pageContext":{"id":"Hitesh Pamnani","__params":{"id":"hitesh-pamnani"}}},"staticQueryHashes":["1171199041","1384082988","2100481360","23180105","528864852"]}