Welcome to the JSON Schema GSOC 2024 Qualification Task solution repository! This project addresses compilation issues in the CorvusQualification project by updating the ExistingPackage. The main goals include enhancing the ExistingPackage to generate a missing attribute, enabling smooth referencing in the CorvusQualification project, and creating a NuGet package for broader usability.
- ExistingPackage is now capable of generating the missing attribute.
- The CorvusQualification project successfully references the ExistingPackage as a project reference.
- A NuGet package for ExistingPackage has been generated and is being referenced by the UserCode project.
Add Project Reference:
-
dotnet restore: to get all dependencies
-
Open the project file of the target project (e.g., CorvusQualification).
-
Include a project reference to ExistingPackage with the following entry:
<ProjectReference Include="..\JsonSchema.GSoC2024.ExistingPackage\JsonSchema.GSoC2024.ExistingPackage.csproj"
OutputItemType="Analyzer" />
- build and run the project (optional) use ctrl+click on generated to navigate to the generated code
To use this package, follow the steps in the Readme:
-
Package the NuGet package by navigating to the existing library folder:
dotnet pack -c debug
-
Add a local source if not already present:
dotnet nuget add source D:\local-nuget -n Local
-
Confirm the added source:
dotnet nuget list source
-
Push the NuGet package to the local source (replace
<path-to-nuget-file>
with the actual path):dotnet nuget push "<path-to-nuget-file>" -s D:\local-nuget
Example:
dotnet nuget push "D:\Json Schema GSOC\JsonSchema.GSoC2024.CorvusQualification\JsonSchema.GSoC2024.ExistingPackage\bin\Debug\JsonSchema.GSoC2024.ExistingPackage.1.0.0.nupkg" -s "D:\local-nuget"
-
Use the package in another project (e.g., UserCode):
dotnet add package JsonSchema.GSoC2024.ExistingPackage --version 1.0.0 --source local-nuget-demo
Ensure you replace placeholders like
<path-to-nuget-file>
with the actual paths and version numbers as needed for your specific project.
Note: The above steps can also be performed using the GUI in Visual Studio.
-
Create a Local Folder:
- Create a folder on your local system where you want to store your NuGet packages.
-
Add a New Source:
- Click on the "+" icon in your NuGet package manager.
- Enter the desired name for your new source.
- Set the source path to the absolute path of the folder created in step 1.
-
Move .nuget Files:
- Locate the
.nuget
files generated during the build process, typically found in the debug folder of your project. - Move these
.nuget
files into the folder created in step 1.
- Locate the
-
Manage NuGet Packages:
By following these steps, you will have successfully set up a local NuGet package source for your project. You can build the project and move .nuget
into the folder and use it in UserCode
Project
- Refer to the learning.md document attached, where I've documented my learning and references used to complete this task, including the creation of the source code generator.