コード例 #1
0
        private string CreateProjectFile(string projectSnippet)
        {
            var projectDirectory = TestUtils.CreateTestSpecificFolderWithSubPaths(TestContext);
            var targetTestUtils  = new TargetsTestsUtils(TestContext);
            var projectTemplate  = targetTestUtils.GetProjectTemplate(null, projectDirectory, null, projectSnippet);

            return(targetTestUtils.CreateProjectFile(projectDirectory, projectTemplate));
        }
コード例 #2
0
        private string CreateProjectFile(AnalysisConfig config, string projectSnippet)
        {
            var projectDirectory = TestUtils.CreateTestSpecificFolderWithSubPaths(TestContext);
            var targetTestUtils  = new TargetsTestsUtils(TestContext);
            var projectTemplate  = targetTestUtils.GetProjectTemplate(config, projectDirectory, TestSpecificProperties, projectSnippet);

            return(targetTestUtils.CreateProjectFile(projectDirectory, projectTemplate));
        }
コード例 #3
0
        private string CreateProjectFile(string projectSnippet)
        {
            // This target captures the ItemGroup we're interested in
            var captureReferences = $@"
<Project ToolsVersion='Current' xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
  <Target Name='CaptureValues' AfterTargets='{TargetConstants.CategoriseProjectTarget}'>
    <Message Importance='high' Text='CAPTURE::ITEM::{TargetProperties.SonarResolvedReferences}::%({TargetProperties.SonarResolvedReferences}.Identity)' />
  </Target>
</Project>";
            var projectDirectory  = TestUtils.CreateTestSpecificFolderWithSubPaths(TestContext);
            var targetTestUtils   = new TargetsTestsUtils(TestContext);
            var capturePath       = targetTestUtils.CreateCaptureTargetsFile(projectDirectory, captureReferences);
            var projectTemplate   = targetTestUtils.GetProjectTemplate(null, projectDirectory, null, projectSnippet, $"<Import Project='{capturePath}' />");

            return(targetTestUtils.CreateProjectFile(projectDirectory, projectTemplate));
        }