public void ExecuteCore(string coreFilesRoot, IEnumerable<ProjectFileConfiguration> projectFileConfigurations)
{
CreatedProjectFiles = new Dictionary<string, ProjectConfigurationData>();
foreach (var projectFileConfiguration in projectFileConfigurations)
{
var projectType = projectFileConfiguration.Name;
var assemblyName = "AWSSDK.Core";
var projectFilename = string.Concat(assemblyName, ".", projectType, ".csproj");
bool newProject = false;
string projectGuid;
if (File.Exists(Path.Combine(coreFilesRoot, projectFilename)))
{
Console.WriteLine("...updating existing project file {0}", projectFilename);
var projectPath = Path.Combine(coreFilesRoot, projectFilename);
projectGuid = Utils.GetProjectGuid(projectPath);
}
else
{
newProject = true;
projectGuid = Utils.NewProjectGuid;
Console.WriteLine("...creating project file {0}", projectFilename);
}
var templateSession = new Dictionary<string, object>();
templateSession["Name"] = projectFileConfiguration.Name;
templateSession["ProjectGuid"] = projectGuid;
templateSession["RootNamespace"] = "Amazon";
templateSession["AssemblyName"] = assemblyName;
templateSession["SourceDirectories"] = GetCoreProjectSourceFolders(projectFileConfiguration, coreFilesRoot);
templateSession["IndividualFileIncludes"] = new List<string>
{
"endpoints.json",
};
templateSession["KeyFilePath"] = @"..\..\awssdk.dll.snk";
templateSession["SupressWarnings"] = "419,1570,1591";
templateSession["NugetPackagesLocation"] = @"..\..\packages\";
templateSession["TargetFrameworkVersion"] = projectFileConfiguration.TargetFrameworkVersion;
templateSession["DefineConstants"] = projectFileConfiguration.CompilationConstants;
templateSession["BinSubfolder"] = projectFileConfiguration.BinSubFolder;
var projectConfigurationData = new ProjectConfigurationData { ProjectGuid = projectGuid };
var projectName = Path.GetFileNameWithoutExtension(projectFilename);
if (newProject)
CreatedProjectFiles[projectName] = projectConfigurationData;
var projectReferences = new List<ProjectReference>();
templateSession["ProjectReferences"] = projectReferences.OrderBy(x => x.Name).ToList();
templateSession["UnityPath"] = Options.UnityPath;
GenerateProjectFile(projectFileConfiguration, projectConfigurationData, templateSession, coreFilesRoot, projectFilename);
}
}