GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — codeql/csharp/scripts/stubs at main · github/codeql

Expand file tree

/

stubs

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

stubs

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
README.md
README.md
 
 
helpers.py
helpers.py
 
 
make_stubs_all.py
make_stubs_all.py
 
 
make_stubs_nuget.py
make_stubs_nuget.py
 
 

README.md

Outline

Generate stubs for a single NuGet package

Stubs can be generated from NuGet packages with the make_stubs_nuget.py script.

The following calls generate stubs for Newtonsoft.Json:

python3 make_stubs_nuget.py classlib Newtonsoft.Json
python3 make_stubs_nuget.py classlib Newtonsoft.Json latest
python3 make_stubs_nuget.py classlib Newtonsoft.Json 13.0.1
python3 make_stubs_nuget.py classlib Newtonsoft.Json 13.0.1 /Users/tmp/working-dir

The output stubs are found in the [DIR]/output/stubs folder and can be copied over to csharp/ql/test/resources/stubs.

In some more involved cases the output files need to be edited. For example ServiceStack has NuGet dependencies, which are included in the Microsoft.NETCore.App framework stub. These dependencies generate empty packages, which can be removed. The ProjectReference entries referencing these removed empty packages also need to be deleted from the .csproj files.

Generate stubs for all packages needed for tests.

Stubs needed for all C# Code QL tests can be generated by

python3 make_stubs_all.py
python3 make_stubs_all.py /Users/tmp/working-dir

The script contains a hardcoded list of packages. If a new package is needed for test purposes, it should be added to the packages list in the script.

The generated stubs require some manual changes before they are compilable.

The output stubs are found in the [DIR]/output/stubs folder and can be copied over to csharp/ql/test/resources/stubs.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.