mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
@@ -745,6 +745,53 @@ namespace Semmle.Extraction.Tests
|
||||
TestAutobuilderScript(autobuilder, 0, 6);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestWindowCSharpMsBuildMultipleSolutions()
|
||||
{
|
||||
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\csharp\nuget\nuget.exe restore test1.csproj"] = 0;
|
||||
Actions.RunProcess["cmd.exe /C CALL ^\"C:\\Program Files ^(x86^)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat^\" && C:\\odasa\\tools\\odasa index --auto msbuild test1.csproj /p:UseSharedCompilation=false /t:Windows /p:Platform=\"x86\" /p:Configuration=\"Debug\" /p:MvcBuildViews=true /P:Fu=Bar"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\csharp\nuget\nuget.exe restore test2.csproj"] = 0;
|
||||
Actions.RunProcess["cmd.exe /C CALL ^\"C:\\Program Files ^(x86^)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat^\" && C:\\odasa\\tools\\odasa index --auto msbuild test2.csproj /p:UseSharedCompilation=false /t:Windows /p:Platform=\"x86\" /p:Configuration=\"Debug\" /p:MvcBuildViews=true /P:Fu=Bar"] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\java\bin\java -jar C:\odasa\tools\extractor-asp.jar ."] = 0;
|
||||
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --xml --extensions config csproj props xml"] = 0;
|
||||
Actions.FileExists["csharp.log"] = true;
|
||||
Actions.FileExists[@"test1.csproj"] = true;
|
||||
Actions.FileExists[@"test2.csproj"] = true;
|
||||
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"] = false;
|
||||
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"] = false;
|
||||
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"] = true;
|
||||
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"] = false;
|
||||
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"] = true;
|
||||
|
||||
Actions.GetEnvironmentVariable["TRAP_FOLDER"] = null;
|
||||
Actions.GetEnvironmentVariable["SOURCE_ARCHIVE"] = null;
|
||||
Actions.EnumerateFiles[@"C:\Project"] = "test1.csproj\ntest2.csproj\ntest1.cs\ntest2.cs";
|
||||
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
||||
|
||||
var csproj1 = new XmlDocument();
|
||||
csproj1.LoadXml(@"<?xml version=""1.0"" encoding=""utf - 8""?>
|
||||
<Project ToolsVersion=""15.0"" xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
|
||||
<ItemGroup>
|
||||
<Compile Include=""test1.cs"" />
|
||||
</ItemGroup>
|
||||
</Project>");
|
||||
Actions.LoadXml["test1.csproj"] = csproj1;
|
||||
|
||||
var csproj2 = new XmlDocument();
|
||||
csproj2.LoadXml(@"<?xml version=""1.0"" encoding=""utf - 8""?>
|
||||
<Project ToolsVersion=""15.0"" xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
|
||||
<ItemGroup>
|
||||
<Compile Include=""test1.cs"" />
|
||||
</ItemGroup>
|
||||
</Project>");
|
||||
Actions.LoadXml["test2.csproj"] = csproj2;
|
||||
|
||||
var autobuilder = CreateAutoBuilder("csharp", true, msBuildArguments: "/P:Fu=Bar", msBuildTarget: "Windows", msBuildPlatform: "x86", msBuildConfiguration: "Debug",
|
||||
vsToolsVersion: "12");
|
||||
|
||||
TestAutobuilderScript(autobuilder, 0, 6);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestWindowCSharpMsBuildFailed()
|
||||
{
|
||||
|
||||
@@ -156,15 +156,9 @@ namespace Semmle.Autobuild
|
||||
if (options.AllSolutions)
|
||||
return matchingFiles.Select(p => p.ProjectOrSolution);
|
||||
|
||||
var firstIsClosest = matchingFiles.Length > 1 && matchingFiles[0].DistanceFromRoot < matchingFiles[1].DistanceFromRoot;
|
||||
if (matchingFiles.Length == 1 || firstIsClosest)
|
||||
return matchingFiles.Select(p => p.ProjectOrSolution).Take(1);
|
||||
|
||||
var candidates = matchingFiles.
|
||||
return matchingFiles.
|
||||
Where(f => f.DistanceFromRoot == matchingFiles[0].DistanceFromRoot).
|
||||
Select(f => f.ProjectOrSolution);
|
||||
Log(Severity.Info, $"Found multiple '{extension}' files, giving up: {string.Join(", ", candidates)}.");
|
||||
return new IProjectOrSolution[0];
|
||||
}
|
||||
|
||||
// First look for `.proj` files
|
||||
|
||||
@@ -89,9 +89,11 @@ Building and previewing the QL training presentations
|
||||
*****************************************************
|
||||
|
||||
To build the QL training presentations, you need to install a Sphinx extension
|
||||
called `hieroglyph <https://github.com/nyergler/hieroglyph>`__.
|
||||
called `hieroglyph <https://github.com/nyergler/hieroglyph>`__.
|
||||
You also need to install `graphviz <https://graphviz.gitlab.io/download/>`__, which
|
||||
is used to generate graphs on some slides.
|
||||
|
||||
After installing hieroglyph, you can build the QL training presentations by running
|
||||
After installing hieroglyph and graphviz, you can build the QL training presentations by running
|
||||
``sphinx-build``, specifying the ``slides`` builder. For example
|
||||
|
||||
.. code::
|
||||
|
||||
@@ -19,7 +19,10 @@ Start learning how to use QL in variant analysis for a specific language by look
|
||||
|
||||
.. |arrow-r| unicode:: U+2192
|
||||
|
||||
When you have selected a presentation, use |arrow-r| and |arrow-l| to navigate between slides, press **p** to view the additional notes for a slide (where available), and press **f** to enter full-screen mode.
|
||||
.. |info| unicode:: U+24D8
|
||||
|
||||
When you have selected a presentation, use |arrow-r| and |arrow-l| to navigate between slides.
|
||||
Press **p** to view the additional notes on slides that have an information icon |info| in the top right corner, and press **f** to enter full-screen mode.
|
||||
|
||||
The presentations contain a number of QL query examples.
|
||||
We recommend that you download `QL for Eclipse <https://help.semmle.com/ql-for-eclipse/Content/WebHelp/home-page.html>`__ and import the example snapshot for each presentation so that you can find the bugs mentioned in the slides.
|
||||
|
||||
@@ -148,11 +148,18 @@ URL: https://code.google.com/p/io-2012-slides
|
||||
</slides>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
//insert info buttons on slides that have additional notes
|
||||
$(".admonition.note").before("<button id='extra-notes'>ⓘ</button>");
|
||||
$(".admonition-title").before("<button id='close-notes'>×</button>");
|
||||
$(document).ready(function() {
|
||||
$('button').click(function() {
|
||||
document.body.classList.toggle('with-notes');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--[if IE]>
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>
|
||||
<script>CFInstall.check({mode: 'overlay'});</script>
|
||||
<![endif]-->
|
||||
<script type="text/javascript">
|
||||
|
||||
//assigns font-size when document is ready
|
||||
|
||||
@@ -587,15 +587,6 @@ dt {
|
||||
/* line 386, ../scss/default.scss */
|
||||
button {
|
||||
display: inline-block;
|
||||
background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSI0MCUiIHN0b3AtY29sb3I9IiNmOWY5ZjkiLz48c3RvcCBvZmZzZXQ9IjcwJSIgc3RvcC1jb2xvcj0iI2UzZTNlMyIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');
|
||||
background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(40%, #f9f9f9), color-stop(70%, #e3e3e3));
|
||||
background: -moz-linear-gradient(#f9f9f9 40%, #e3e3e3 70%);
|
||||
background: -webkit-linear-gradient(#f9f9f9 40%, #e3e3e3 70%);
|
||||
background: linear-gradient(#f9f9f9 40%, #e3e3e3 70%);
|
||||
border: 1px solid #a9a9a9;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
padding: 5px 8px;
|
||||
outline: none;
|
||||
white-space: nowrap;
|
||||
@@ -605,7 +596,6 @@ button {
|
||||
user-select: none;
|
||||
cursor: pointer;
|
||||
text-shadow: 1px 1px #fff;
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
/* line 400, ../scss/default.scss */
|
||||
@@ -1599,10 +1589,38 @@ p.first.admonition-title {
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
.admonition.note ul {
|
||||
.admonition.note ul li {
|
||||
width: inherit;
|
||||
}
|
||||
|
||||
|
||||
/* styles for information buttons on slides that have notes */
|
||||
|
||||
#extra-notes {
|
||||
display: block;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 1%;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
#close-notes {
|
||||
display: block;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: -1%;
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
button {
|
||||
border: none;
|
||||
background: none;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/********* images ************/
|
||||
/* general styles to scale and centre images*/
|
||||
|
||||
@@ -1774,4 +1792,4 @@ li > ul > li {
|
||||
width: 90%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ extensions = [
|
||||
'sphinx.ext.intersphinx',
|
||||
'sphinx.ext.mathjax',
|
||||
'hieroglyph',
|
||||
'sphinxcontrib.blockdiag',
|
||||
'sphinx.ext.graphviz',
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user