mirror of https://github.com/opensim/opensim.git
the changes to prebuild source..
This commit is contained in:
parent
c10b4e8760
commit
9fb436b214
|
@ -299,10 +299,10 @@ namespace Prebuild.Core.Targets
|
|||
// Output the ItemGroup for project.References
|
||||
WriteProjectReferences(solution, project, ps);
|
||||
|
||||
// ps.WriteLine(" </Build>");
|
||||
ps.WriteLine(" <ItemGroup>");
|
||||
//ps.WriteLine(" </Build>");
|
||||
ps.WriteLine(" <ItemGroup>");
|
||||
|
||||
// ps.WriteLine(" <Include>");
|
||||
//ps.WriteLine(" <Include>");
|
||||
List<string> list = new List<string>();
|
||||
|
||||
foreach (string path in project.Files)
|
||||
|
@ -314,7 +314,6 @@ namespace Prebuild.Core.Targets
|
|||
if (!list.Contains(codebehind))
|
||||
list.Add(codebehind);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#region Files
|
||||
|
@ -325,11 +324,11 @@ namespace Prebuild.Core.Targets
|
|||
// for each destination
|
||||
if (project.Files.GetBuildAction(filePath) == BuildAction.Copy)
|
||||
continue;
|
||||
// if (file == "Properties\\Bind.Designer.cs")
|
||||
// {
|
||||
// Console.WriteLine("Wait a minute!");
|
||||
// Console.WriteLine(project.Files.GetSubType(file).ToString());
|
||||
// }
|
||||
//if (file == "Properties\\Bind.Designer.cs")
|
||||
//{
|
||||
// Console.WriteLine("Wait a minute!");
|
||||
// Console.WriteLine(project.Files.GetSubType(file).ToString());
|
||||
//}
|
||||
SubType subType = project.Files.GetSubType(filePath);
|
||||
|
||||
// Visual Studio chokes on file names if forward slash is used as a path separator
|
||||
|
@ -340,16 +339,16 @@ namespace Prebuild.Core.Targets
|
|||
if (subType != SubType.Code && subType != SubType.Settings && subType != SubType.Designer
|
||||
&& subType != SubType.CodeBehind)
|
||||
{
|
||||
ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".resx");
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file));
|
||||
ps.WriteLine(" <SubType>Designer</SubType>");
|
||||
ps.WriteLine(" </EmbeddedResource>");
|
||||
ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".resx");
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file));
|
||||
ps.WriteLine(" <SubType>Designer</SubType>");
|
||||
ps.WriteLine(" </EmbeddedResource>");
|
||||
//
|
||||
}
|
||||
|
||||
if (subType == SubType.Designer)
|
||||
{
|
||||
ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file);
|
||||
ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file);
|
||||
|
||||
string autogen_name = file.Substring(0, file.LastIndexOf('.')) + ".Designer.cs";
|
||||
string dependent_name = filePath.Substring(0, file.LastIndexOf('.')) + ".cs";
|
||||
|
@ -357,57 +356,57 @@ namespace Prebuild.Core.Targets
|
|||
// Check for a parent .cs file with the same name as this designer file
|
||||
if (File.Exists(Helper.NormalizePath(dependent_name)))
|
||||
{
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(dependent_name));
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(dependent_name));
|
||||
}
|
||||
else
|
||||
{
|
||||
ps.WriteLine(" <Generator>ResXFileCodeGenerator</Generator>");
|
||||
ps.WriteLine(" <LastGenOutput>{0}</LastGenOutput>", Path.GetFileName(autogen_name));
|
||||
ps.WriteLine(" <SubType>" + subType + "</SubType>");
|
||||
ps.WriteLine(" <Generator>ResXFileCodeGenerator</Generator>");
|
||||
ps.WriteLine(" <LastGenOutput>{0}</LastGenOutput>", Path.GetFileName(autogen_name));
|
||||
ps.WriteLine(" <SubType>" + subType + "</SubType>");
|
||||
}
|
||||
|
||||
ps.WriteLine(" </EmbeddedResource>");
|
||||
ps.WriteLine(" </EmbeddedResource>");
|
||||
if (File.Exists(Helper.NormalizePath(autogen_name)))
|
||||
{
|
||||
ps.WriteLine(" <Compile Include=\"{0}\">", autogen_name);
|
||||
//ps.WriteLine(" <DesignTime>True</DesignTime>");
|
||||
ps.WriteLine(" <Compile Include=\"{0}\">", autogen_name);
|
||||
//ps.WriteLine(" <DesignTime>True</DesignTime>");
|
||||
|
||||
// If a parent .cs file exists, link this autogen file to it. Otherwise link
|
||||
// to the designer file
|
||||
if (File.Exists(dependent_name))
|
||||
{
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(dependent_name));
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(dependent_name));
|
||||
}
|
||||
else
|
||||
{
|
||||
ps.WriteLine(" <AutoGen>True</AutoGen>");
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(filePath));
|
||||
ps.WriteLine(" <AutoGen>True</AutoGen>");
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(filePath));
|
||||
}
|
||||
|
||||
ps.WriteLine(" </Compile>");
|
||||
ps.WriteLine(" </Compile>");
|
||||
}
|
||||
list.Add(autogen_name);
|
||||
}
|
||||
if (subType == SubType.Settings)
|
||||
{
|
||||
ps.Write(" <{0} ", project.Files.GetBuildAction(filePath));
|
||||
ps.WriteLine("Include=\"{0}\">", file);
|
||||
ps.Write(" <{0} ", project.Files.GetBuildAction(filePath));
|
||||
ps.WriteLine(" Include=\"{0}\">", file);
|
||||
string fileName = Path.GetFileName(filePath);
|
||||
if (project.Files.GetBuildAction(filePath) == BuildAction.None)
|
||||
{
|
||||
ps.WriteLine(" <Generator>SettingsSingleFileGenerator</Generator>");
|
||||
ps.WriteLine(" <LastGenOutput>{0}</LastGenOutput>", fileName.Substring(0, fileName.LastIndexOf('.')) + ".Designer.cs");
|
||||
ps.WriteLine(" <Generator>SettingsSingleFileGenerator</Generator>");
|
||||
ps.WriteLine(" <LastGenOutput>{0}</LastGenOutput>", fileName.Substring(0, fileName.LastIndexOf('.')) + ".Designer.cs");
|
||||
}
|
||||
else
|
||||
{
|
||||
ps.WriteLine(" <SubType>Code</SubType>");
|
||||
ps.WriteLine(" <AutoGen>True</AutoGen>");
|
||||
ps.WriteLine(" <DesignTimeSharedInput>True</DesignTimeSharedInput>");
|
||||
ps.WriteLine(" <SubType>Code</SubType>");
|
||||
ps.WriteLine(" <AutoGen>True</AutoGen>");
|
||||
ps.WriteLine(" <DesignTimeSharedInput>True</DesignTimeSharedInput>");
|
||||
string fileNameShort = fileName.Substring(0, fileName.LastIndexOf('.'));
|
||||
string fileNameShorter = fileNameShort.Substring(0, fileNameShort.LastIndexOf('.'));
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(fileNameShorter + ".settings"));
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(fileNameShorter + ".settings"));
|
||||
}
|
||||
ps.WriteLine(" </{0}>", project.Files.GetBuildAction(filePath));
|
||||
ps.WriteLine(" </{0}>", project.Files.GetBuildAction(filePath));
|
||||
}
|
||||
else if (subType != SubType.Designer)
|
||||
{
|
||||
|
@ -416,14 +415,13 @@ namespace Prebuild.Core.Targets
|
|||
|
||||
if (!list.Contains(filePath))
|
||||
{
|
||||
ps.Write(" <{0} ", project.Files.GetBuildAction(filePath));
|
||||
ps.Write(" <{0} ", project.Files.GetBuildAction(filePath));
|
||||
|
||||
int startPos = 0;
|
||||
if (project.Files.GetPreservePath(filePath))
|
||||
{
|
||||
while ((@"./\").IndexOf(file.Substring(startPos, 1)) != -1)
|
||||
startPos++;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -432,7 +430,7 @@ namespace Prebuild.Core.Targets
|
|||
|
||||
// be sure to write out the path with backslashes so VS recognizes
|
||||
// the file properly.
|
||||
ps.WriteLine("Include=\"{0}\">", file);
|
||||
ps.WriteLine(" Include=\"{0}\">", file);
|
||||
|
||||
int last_period_index = file.LastIndexOf('.');
|
||||
string short_file_name = (last_period_index >= 0)
|
||||
|
@ -454,41 +452,41 @@ namespace Prebuild.Core.Targets
|
|||
// or usercontrol that don't have an associated resx file.
|
||||
// 2. Connect settings files to associated designer files.
|
||||
if (File.Exists(file_name + extension))
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + extension));
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + extension));
|
||||
else if (File.Exists(file_name + ".resx"))
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + ".resx"));
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + ".resx"));
|
||||
else if (File.Exists(file_name + ".settings"))
|
||||
{
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + ".settings"));
|
||||
ps.WriteLine(" <AutoGen>True</AutoGen>");
|
||||
ps.WriteLine(" <DesignTimeSharedInput>True</DesignTimeSharedInput>");
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + ".settings"));
|
||||
ps.WriteLine(" <AutoGen>True</AutoGen>");
|
||||
ps.WriteLine(" <DesignTimeSharedInput>True</DesignTimeSharedInput>");
|
||||
}
|
||||
}
|
||||
else if (subType == SubType.CodeBehind)
|
||||
{
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(short_file_name));
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(short_file_name));
|
||||
}
|
||||
if (project.Files.GetIsLink(filePath))
|
||||
{
|
||||
string alias = project.Files.GetLinkPath(filePath);
|
||||
alias += file.Substring(startPos);
|
||||
alias = Helper.NormalizePath(alias);
|
||||
ps.WriteLine(" <Link>{0}</Link>", alias);
|
||||
ps.WriteLine(" <Link>{0}</Link>", alias);
|
||||
}
|
||||
else if (project.Files.GetBuildAction(filePath) != BuildAction.None)
|
||||
{
|
||||
if (project.Files.GetBuildAction(filePath) != BuildAction.EmbeddedResource)
|
||||
{
|
||||
ps.WriteLine(" <SubType>{0}</SubType>", subType);
|
||||
ps.WriteLine(" <SubType>{0}</SubType>", subType);
|
||||
}
|
||||
}
|
||||
|
||||
if (project.Files.GetCopyToOutput(filePath) != CopyToOutput.Never)
|
||||
{
|
||||
ps.WriteLine(" <CopyToOutputDirectory>{0}</CopyToOutputDirectory>", project.Files.GetCopyToOutput(filePath));
|
||||
ps.WriteLine(" <CopyToOutputDirectory>{0}</CopyToOutputDirectory>", project.Files.GetCopyToOutput(filePath));
|
||||
}
|
||||
|
||||
ps.WriteLine(" </{0}>", project.Files.GetBuildAction(filePath));
|
||||
ps.WriteLine(" </{0}>", project.Files.GetBuildAction(filePath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -529,13 +527,13 @@ namespace Prebuild.Core.Targets
|
|||
ps.WriteLine(" </Target>");
|
||||
}
|
||||
|
||||
ps.WriteLine(" <Import Project=\"" + toolInfo.ImportProject + "\" />");
|
||||
ps.WriteLine(" <PropertyGroup>");
|
||||
ps.WriteLine(" <PreBuildEvent>");
|
||||
ps.WriteLine(" </PreBuildEvent>");
|
||||
ps.WriteLine(" <PostBuildEvent>");
|
||||
ps.WriteLine(" </PostBuildEvent>");
|
||||
ps.WriteLine(" </PropertyGroup>");
|
||||
ps.WriteLine(" <Import Project=\"" + toolInfo.ImportProject + "\" />");
|
||||
ps.WriteLine(" <PropertyGroup>");
|
||||
ps.WriteLine(" <PreBuildEvent>");
|
||||
ps.WriteLine(" </PreBuildEvent>");
|
||||
ps.WriteLine(" <PostBuildEvent>");
|
||||
ps.WriteLine(" </PostBuildEvent>");
|
||||
ps.WriteLine(" </PropertyGroup>");
|
||||
ps.WriteLine("</Project>");
|
||||
}
|
||||
#endregion
|
||||
|
@ -599,15 +597,15 @@ namespace Prebuild.Core.Targets
|
|||
// Assembly References
|
||||
if (otherReferences.Count > 0)
|
||||
{
|
||||
ps.WriteLine(" <ItemGroup>");
|
||||
ps.WriteLine(" <ItemGroup>");
|
||||
|
||||
foreach (ReferenceNode refr in otherReferences)
|
||||
{
|
||||
ps.Write(" <Reference");
|
||||
ps.Write(" <Reference");
|
||||
ps.Write(" Include=\"");
|
||||
ps.Write(refr.Name);
|
||||
ps.WriteLine("\" >");
|
||||
ps.Write(" <Name>");
|
||||
ps.Write(" <Name>");
|
||||
ps.Write(refr.Name);
|
||||
ps.WriteLine("</Name>");
|
||||
|
||||
|
@ -618,32 +616,32 @@ namespace Prebuild.Core.Targets
|
|||
if (File.Exists(Helper.MakeFilePath(absolutePath, refr.Name, "exe")))
|
||||
{
|
||||
// Assembly is an executable (exe)
|
||||
ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "exe"));
|
||||
ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "exe"));
|
||||
}
|
||||
else if (File.Exists(Helper.MakeFilePath(absolutePath, refr.Name, "dll")))
|
||||
{
|
||||
// Assembly is an library (dll)
|
||||
ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "dll"));
|
||||
ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "dll"));
|
||||
}
|
||||
else
|
||||
{
|
||||
string referencePath = Helper.MakeFilePath(refr.Path, refr.Name, "dll");
|
||||
kernel.Log.Write(LogType.Warning, "Reference \"{0}\": The specified file doesn't exist.", referencePath);
|
||||
ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "dll"));
|
||||
ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "dll"));
|
||||
}
|
||||
}
|
||||
|
||||
ps.WriteLine(" <Private>{0}</Private>", refr.LocalCopy);
|
||||
ps.WriteLine(" </Reference>");
|
||||
ps.WriteLine(" <Private>{0}</Private>", refr.LocalCopy);
|
||||
ps.WriteLine(" </Reference>");
|
||||
}
|
||||
ps.WriteLine(" </ItemGroup>");
|
||||
ps.WriteLine(" </ItemGroup>");
|
||||
ps.WriteLine();
|
||||
}
|
||||
|
||||
//Project References
|
||||
if (projectReferences.Count > 0)
|
||||
{
|
||||
ps.WriteLine(" <ItemGroup>");
|
||||
ps.WriteLine(" <ItemGroup>");
|
||||
foreach (KeyValuePair<ReferenceNode, ProjectNode> pair in projectReferences)
|
||||
{
|
||||
ToolInfo tool = tools[pair.Value.Language];
|
||||
|
@ -653,19 +651,19 @@ namespace Prebuild.Core.Targets
|
|||
string path =
|
||||
Helper.MakePathRelativeTo(project.FullPath,
|
||||
Helper.MakeFilePath(pair.Value.FullPath, pair.Value.Name, tool.FileExtension));
|
||||
ps.WriteLine(" <ProjectReference Include=\"{0}\">", path);
|
||||
ps.WriteLine(" <ProjectReference Include=\"{0}\">", path);
|
||||
|
||||
// TODO: Allow reference to visual basic projects
|
||||
ps.WriteLine(" <Name>{0}</Name>", pair.Value.Name);
|
||||
ps.WriteLine(" <Project>{0}</Project>", pair.Value.Guid.ToString("B").ToUpper());
|
||||
ps.WriteLine(" <Package>{0}</Package>", tool.Guid.ToUpper());
|
||||
ps.WriteLine(" <Name>{0}</Name>", pair.Value.Name);
|
||||
ps.WriteLine(" <Project>{0}</Project>", pair.Value.Guid.ToString("B").ToUpper());
|
||||
ps.WriteLine(" <Package>{0}</Package>", tool.Guid.ToUpper());
|
||||
|
||||
//This is the Copy Local flag in VS
|
||||
ps.WriteLine(" <Private>{0}</Private>", pair.Key.LocalCopy);
|
||||
ps.WriteLine(" <Private>{0}</Private>", pair.Key.LocalCopy);
|
||||
|
||||
ps.WriteLine(" </ProjectReference>");
|
||||
ps.WriteLine(" </ProjectReference>");
|
||||
}
|
||||
ps.WriteLine(" </ItemGroup>");
|
||||
ps.WriteLine(" </ItemGroup>");
|
||||
ps.WriteLine();
|
||||
}
|
||||
}
|
||||
|
@ -673,7 +671,7 @@ namespace Prebuild.Core.Targets
|
|||
private void WriteProjectDotNet(SolutionNode solution, ProjectNode project, StreamWriter ps)
|
||||
{
|
||||
#region Project File
|
||||
bool listFiles = false;
|
||||
bool listFiles = project.Files.Count > 0;
|
||||
string prebuild = string.Empty;
|
||||
string postbuild = string.Empty;
|
||||
using (ps)
|
||||
|
@ -694,6 +692,8 @@ namespace Prebuild.Core.Targets
|
|||
//ps.WriteLine(" <EnableDefaultCompileItems>false</EnableDefaultCompileItems>");
|
||||
ps.WriteLine(" <ProduceReferenceAssembly>false</ProduceReferenceAssembly>");
|
||||
ps.WriteLine(" <GenerateDependencyFile>false</GenerateDependencyFile>");
|
||||
if (listFiles)
|
||||
ps.WriteLine(" <EnableDefaultItems>false</EnableDefaultItems>");
|
||||
ps.WriteLine(" </PropertyGroup>");
|
||||
ps.WriteLine();
|
||||
|
||||
|
@ -712,45 +712,43 @@ namespace Prebuild.Core.Targets
|
|||
}
|
||||
else
|
||||
{
|
||||
ps.Write(" <PropertyGroup ");
|
||||
ps.Write(" <PropertyGroup ");
|
||||
ps.WriteLine("Condition=\" '$(Configuration)|$(Platform)' == '{0}|{1}' \">", conf.Name, conf.Platform);
|
||||
ps.WriteLine(" <AllowUnsafeBlocks>{0}</AllowUnsafeBlocks>", conf.Options["AllowUnsafe"]);
|
||||
ps.WriteLine(" <BaseAddress>{0}</BaseAddress>", conf.Options["BaseAddress"]);
|
||||
ps.WriteLine(" <AllowUnsafeBlocks>{0}</AllowUnsafeBlocks>", conf.Options["AllowUnsafe"]);
|
||||
ps.WriteLine(" <BaseAddress>{0}</BaseAddress>", conf.Options["BaseAddress"]);
|
||||
if ((bool)conf.Options["CheckUnderflowOverflow"])
|
||||
ps.WriteLine(" <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>");
|
||||
ps.WriteLine(" <ConfigurationOverrideFile>");
|
||||
ps.WriteLine(" </ConfigurationOverrideFile>");
|
||||
ps.WriteLine(" <DefineConstants>{0}</DefineConstants>",
|
||||
ps.WriteLine(" <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>");
|
||||
ps.WriteLine(" <ConfigurationOverrideFile>");
|
||||
ps.WriteLine(" </ConfigurationOverrideFile>");
|
||||
ps.WriteLine(" <DefineConstants>{0}</DefineConstants>",
|
||||
conf.Options["CompilerDefines"].ToString() == "" ? this.kernel.ForcedConditionals : conf.Options["CompilerDefines"] + ";" + kernel.ForcedConditionals);
|
||||
ps.WriteLine(" <DocumentationFile>{0}</DocumentationFile>", Helper.NormalizePath(conf.Options["XmlDocFile"].ToString()));
|
||||
ps.WriteLine(" <DebugSymbols>{0}</DebugSymbols>", conf.Options["DebugInformation"]);
|
||||
ps.WriteLine(" <FileAlignment>{0}</FileAlignment>", conf.Options["FileAlignment"]);
|
||||
ps.WriteLine(" <Optimize>{0}</Optimize>", conf.Options["OptimizeCode"]);
|
||||
ps.WriteLine(" <TieredCompilation>false</TieredCompilation>");
|
||||
ps.WriteLine(" <DocumentationFile>{0}</DocumentationFile>", Helper.NormalizePath(conf.Options["XmlDocFile"].ToString()));
|
||||
ps.WriteLine(" <DebugSymbols>{0}</DebugSymbols>", conf.Options["DebugInformation"]);
|
||||
ps.WriteLine(" <FileAlignment>{0}</FileAlignment>", conf.Options["FileAlignment"]);
|
||||
ps.WriteLine(" <Optimize>{0}</Optimize>", conf.Options["OptimizeCode"]);
|
||||
ps.WriteLine(" <TieredCompilation>false</TieredCompilation>");
|
||||
|
||||
ps.WriteLine(" <UseCommonOutputDirectory>{0}</UseCommonOutputDirectory>", conf.Options["UseCommonOutputDirectory"].ToString());
|
||||
ps.WriteLine(" <AppendTargetFrameworkToOutputPath>{0}</AppendTargetFrameworkToOutputPath>", conf.Options["AppendTargetFrameworkToOutputPath"].ToString());
|
||||
ps.WriteLine(" <AppendRuntimeIdentifierToOutputPath>{0}</AppendRuntimeIdentifierToOutputPath>", conf.Options["AppendRuntimeIdentifierToOutputPath"].ToString());
|
||||
if ((bool)conf.Options["EnableDefaultItems"] == false)
|
||||
{
|
||||
listFiles = true;
|
||||
ps.WriteLine(" <EnableDefaultItems>false</EnableDefaultItems>");
|
||||
}
|
||||
ps.WriteLine(" <UseCommonOutputDirectory>{0}</UseCommonOutputDirectory>", conf.Options["UseCommonOutputDirectory"].ToString());
|
||||
ps.WriteLine(" <AppendTargetFrameworkToOutputPath>{0}</AppendTargetFrameworkToOutputPath>", conf.Options["AppendTargetFrameworkToOutputPath"].ToString());
|
||||
ps.WriteLine(" <AppendRuntimeIdentifierToOutputPath>{0}</AppendRuntimeIdentifierToOutputPath>", conf.Options["AppendRuntimeIdentifierToOutputPath"].ToString());
|
||||
|
||||
if (!listFiles && (bool)conf.Options["EnableDefaultItems"] == false)
|
||||
ps.WriteLine(" <EnableDefaultItems>false</EnableDefaultItems>");
|
||||
|
||||
if (project.Type != ProjectType.Web)
|
||||
ps.WriteLine(" <OutputPath>{0}</OutputPath>",
|
||||
ps.WriteLine(" <OutputPath>{0}</OutputPath>",
|
||||
Helper.EndPath(Helper.NormalizePath(conf.Options["OutputPath"].ToString())));
|
||||
else
|
||||
ps.WriteLine(" <OutputPath>{0}</OutputPath>",
|
||||
ps.WriteLine(" <OutputPath>{0}</OutputPath>",
|
||||
Helper.EndPath(Helper.NormalizePath("bin\\")));
|
||||
|
||||
ps.WriteLine(" <RegisterForComInterop>{0}</RegisterForComInterop>", conf.Options["RegisterComInterop"]);
|
||||
ps.WriteLine(" <RemoveIntegerChecks>{0}</RemoveIntegerChecks>", conf.Options["RemoveIntegerChecks"]);
|
||||
ps.WriteLine(" <TreatWarningsAsErrors>{0}</TreatWarningsAsErrors>", conf.Options["WarningsAsErrors"]);
|
||||
ps.WriteLine(" <WarningLevel>{0}</WarningLevel>", conf.Options["WarningLevel"]);
|
||||
ps.WriteLine(" <NoStdLib>{0}</NoStdLib>", conf.Options["NoStdLib"]);
|
||||
ps.WriteLine(" <NoWarn>{0}</NoWarn>", conf.Options["SuppressWarnings"]);
|
||||
ps.WriteLine(" <PlatformTarget>{0}</PlatformTarget>", conf.Platform);
|
||||
ps.WriteLine(" <RegisterForComInterop>{0}</RegisterForComInterop>", conf.Options["RegisterComInterop"]);
|
||||
ps.WriteLine(" <RemoveIntegerChecks>{0}</RemoveIntegerChecks>", conf.Options["RemoveIntegerChecks"]);
|
||||
ps.WriteLine(" <TreatWarningsAsErrors>{0}</TreatWarningsAsErrors>", conf.Options["WarningsAsErrors"]);
|
||||
ps.WriteLine(" <WarningLevel>{0}</WarningLevel>", conf.Options["WarningLevel"]);
|
||||
ps.WriteLine(" <NoStdLib>{0}</NoStdLib>", conf.Options["NoStdLib"]);
|
||||
ps.WriteLine(" <NoWarn>{0}</NoWarn>", conf.Options["SuppressWarnings"]);
|
||||
ps.WriteLine(" <PlatformTarget>{0}</PlatformTarget>", conf.Platform);
|
||||
|
||||
if (conf.Options["PreBuildEvent"] != null && conf.Options["PreBuildEvent"].ToString().Length != 0)
|
||||
{
|
||||
|
@ -761,7 +759,7 @@ namespace Prebuild.Core.Targets
|
|||
postbuild = conf.Options["PostBuildEvent"].ToString();
|
||||
}
|
||||
|
||||
ps.WriteLine(" </PropertyGroup>");
|
||||
ps.WriteLine(" </PropertyGroup>");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -789,10 +787,10 @@ namespace Prebuild.Core.Targets
|
|||
// Output the ItemGroup for project.References
|
||||
WriteProjectReferencesDotNet(solution, project, ps);
|
||||
|
||||
if (listFiles)
|
||||
if (project.Files.Count > 0 )
|
||||
{
|
||||
List<string> list = new List<string>();
|
||||
ps.WriteLine(" <ItemGroup>");
|
||||
ps.WriteLine(" <ItemGroup>");
|
||||
foreach (string filePath in project.Files)
|
||||
{
|
||||
// Add the filePath with the destination as the key
|
||||
|
@ -800,11 +798,11 @@ namespace Prebuild.Core.Targets
|
|||
// for each destination
|
||||
if (project.Files.GetBuildAction(filePath) == BuildAction.Copy)
|
||||
continue;
|
||||
// if (file == "Properties\\Bind.Designer.cs")
|
||||
// {
|
||||
// Console.WriteLine("Wait a minute!");
|
||||
// Console.WriteLine(project.Files.GetSubType(file).ToString());
|
||||
// }
|
||||
//if (file == "Properties\\Bind.Designer.cs")
|
||||
//{
|
||||
// Console.WriteLine("Wait a minute!");
|
||||
// Console.WriteLine(project.Files.GetSubType(file).ToString());
|
||||
//}
|
||||
SubType subType = project.Files.GetSubType(filePath);
|
||||
|
||||
// Visual Studio chokes on file names if forward slash is used as a path separator
|
||||
|
@ -815,16 +813,16 @@ namespace Prebuild.Core.Targets
|
|||
if (subType != SubType.Code && subType != SubType.Settings && subType != SubType.Designer
|
||||
&& subType != SubType.CodeBehind)
|
||||
{
|
||||
ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".resx");
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file));
|
||||
ps.WriteLine(" <SubType>Designer</SubType>");
|
||||
ps.WriteLine(" </EmbeddedResource>");
|
||||
ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file.Substring(0, file.LastIndexOf('.')) + ".resx");
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file));
|
||||
ps.WriteLine(" <SubType>Designer</SubType>");
|
||||
ps.WriteLine(" </EmbeddedResource>");
|
||||
//
|
||||
}
|
||||
|
||||
if (subType == SubType.Designer)
|
||||
{
|
||||
ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file);
|
||||
ps.WriteLine(" <EmbeddedResource Include=\"{0}\">", file);
|
||||
|
||||
string autogen_name = file.Substring(0, file.LastIndexOf('.')) + ".Designer.cs";
|
||||
string dependent_name = filePath.Substring(0, file.LastIndexOf('.')) + ".cs";
|
||||
|
@ -832,57 +830,57 @@ namespace Prebuild.Core.Targets
|
|||
// Check for a parent .cs file with the same name as this designer file
|
||||
if (File.Exists(Helper.NormalizePath(dependent_name)))
|
||||
{
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(dependent_name));
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(dependent_name));
|
||||
}
|
||||
else
|
||||
{
|
||||
ps.WriteLine(" <Generator>ResXFileCodeGenerator</Generator>");
|
||||
ps.WriteLine(" <LastGenOutput>{0}</LastGenOutput>", Path.GetFileName(autogen_name));
|
||||
ps.WriteLine(" <SubType>" + subType + "</SubType>");
|
||||
ps.WriteLine(" <Generator>ResXFileCodeGenerator</Generator>");
|
||||
ps.WriteLine(" <LastGenOutput>{0}</LastGenOutput>", Path.GetFileName(autogen_name));
|
||||
ps.WriteLine(" <SubType>" + subType + "</SubType>");
|
||||
}
|
||||
|
||||
ps.WriteLine(" </EmbeddedResource>");
|
||||
ps.WriteLine(" </EmbeddedResource>");
|
||||
if (File.Exists(Helper.NormalizePath(autogen_name)))
|
||||
{
|
||||
ps.WriteLine(" <Compile Include=\"{0}\">", autogen_name);
|
||||
ps.WriteLine(" <Compile Include=\"{0}\">", autogen_name);
|
||||
//ps.WriteLine(" <DesignTime>True</DesignTime>");
|
||||
|
||||
// If a parent .cs file exists, link this autogen file to it. Otherwise link
|
||||
// to the designer file
|
||||
if (File.Exists(dependent_name))
|
||||
{
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(dependent_name));
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(dependent_name));
|
||||
}
|
||||
else
|
||||
{
|
||||
ps.WriteLine(" <AutoGen>True</AutoGen>");
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(filePath));
|
||||
ps.WriteLine(" <AutoGen>True</AutoGen>");
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(filePath));
|
||||
}
|
||||
|
||||
ps.WriteLine(" </Compile>");
|
||||
ps.WriteLine(" </Compile>");
|
||||
}
|
||||
list.Add(autogen_name);
|
||||
}
|
||||
if (subType == SubType.Settings)
|
||||
{
|
||||
ps.Write(" <{0} ", project.Files.GetBuildAction(filePath));
|
||||
ps.Write(" <{0} ", project.Files.GetBuildAction(filePath));
|
||||
ps.WriteLine("Include=\"{0}\">", file);
|
||||
string fileName = Path.GetFileName(filePath);
|
||||
if (project.Files.GetBuildAction(filePath) == BuildAction.None)
|
||||
{
|
||||
ps.WriteLine(" <Generator>SettingsSingleFileGenerator</Generator>");
|
||||
ps.WriteLine(" <LastGenOutput>{0}</LastGenOutput>", fileName.Substring(0, fileName.LastIndexOf('.')) + ".Designer.cs");
|
||||
ps.WriteLine(" <Generator>SettingsSingleFileGenerator</Generator>");
|
||||
ps.WriteLine(" <LastGenOutput>{0}</LastGenOutput>", fileName.Substring(0, fileName.LastIndexOf('.')) + ".Designer.cs");
|
||||
}
|
||||
else
|
||||
{
|
||||
ps.WriteLine(" <SubType>Code</SubType>");
|
||||
ps.WriteLine(" <AutoGen>True</AutoGen>");
|
||||
ps.WriteLine(" <DesignTimeSharedInput>True</DesignTimeSharedInput>");
|
||||
ps.WriteLine(" <SubType>Code</SubType>");
|
||||
ps.WriteLine(" <AutoGen>True</AutoGen>");
|
||||
ps.WriteLine(" <DesignTimeSharedInput>True</DesignTimeSharedInput>");
|
||||
string fileNameShort = fileName.Substring(0, fileName.LastIndexOf('.'));
|
||||
string fileNameShorter = fileNameShort.Substring(0, fileNameShort.LastIndexOf('.'));
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(fileNameShorter + ".settings"));
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(fileNameShorter + ".settings"));
|
||||
}
|
||||
ps.WriteLine(" </{0}>", project.Files.GetBuildAction(filePath));
|
||||
ps.WriteLine(" </{0}>", project.Files.GetBuildAction(filePath));
|
||||
}
|
||||
else if (subType != SubType.Designer)
|
||||
{
|
||||
|
@ -891,7 +889,7 @@ namespace Prebuild.Core.Targets
|
|||
|
||||
if (!list.Contains(filePath))
|
||||
{
|
||||
ps.Write(" <{0} ", project.Files.GetBuildAction(filePath));
|
||||
ps.Write(" <{0} ", project.Files.GetBuildAction(filePath));
|
||||
|
||||
int startPos = 0;
|
||||
if (project.Files.GetPreservePath(filePath))
|
||||
|
@ -929,41 +927,41 @@ namespace Prebuild.Core.Targets
|
|||
// or usercontrol that don't have an associated resx file.
|
||||
// 2. Connect settings files to associated designer files.
|
||||
if (File.Exists(file_name + extension))
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + extension));
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + extension));
|
||||
else if (File.Exists(file_name + ".resx"))
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + ".resx"));
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + ".resx"));
|
||||
else if (File.Exists(file_name + ".settings"))
|
||||
{
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + ".settings"));
|
||||
ps.WriteLine(" <AutoGen>True</AutoGen>");
|
||||
ps.WriteLine(" <DesignTimeSharedInput>True</DesignTimeSharedInput>");
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(file_name + ".settings"));
|
||||
ps.WriteLine(" <AutoGen>True</AutoGen>");
|
||||
ps.WriteLine(" <DesignTimeSharedInput>True</DesignTimeSharedInput>");
|
||||
}
|
||||
}
|
||||
else if (subType == SubType.CodeBehind)
|
||||
{
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(short_file_name));
|
||||
ps.WriteLine(" <DependentUpon>{0}</DependentUpon>", Path.GetFileName(short_file_name));
|
||||
}
|
||||
if (project.Files.GetIsLink(filePath))
|
||||
{
|
||||
string alias = project.Files.GetLinkPath(filePath);
|
||||
alias += file.Substring(startPos);
|
||||
alias = Helper.NormalizePath(alias);
|
||||
ps.WriteLine(" <Link>{0}</Link>", alias);
|
||||
ps.WriteLine(" <Link>{0}</Link>", alias);
|
||||
}
|
||||
else if (project.Files.GetBuildAction(filePath) != BuildAction.None)
|
||||
{
|
||||
if (project.Files.GetBuildAction(filePath) != BuildAction.EmbeddedResource)
|
||||
{
|
||||
ps.WriteLine(" <SubType>{0}</SubType>", subType);
|
||||
ps.WriteLine(" <SubType>{0}</SubType>", subType);
|
||||
}
|
||||
}
|
||||
|
||||
if (project.Files.GetCopyToOutput(filePath) != CopyToOutput.Never)
|
||||
{
|
||||
ps.WriteLine(" <CopyToOutputDirectory>{0}</CopyToOutputDirectory>", project.Files.GetCopyToOutput(filePath));
|
||||
ps.WriteLine(" <CopyToOutputDirectory>{0}</CopyToOutputDirectory>", project.Files.GetCopyToOutput(filePath));
|
||||
}
|
||||
|
||||
ps.WriteLine(" </{0}>", project.Files.GetBuildAction(filePath));
|
||||
ps.WriteLine(" </{0}>", project.Files.GetBuildAction(filePath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -973,19 +971,18 @@ namespace Prebuild.Core.Targets
|
|||
if (!string.IsNullOrEmpty(prebuild))
|
||||
{
|
||||
ps.WriteLine(" <Target Name=\"PreBuild\" BeforeTargets=\"PreBuildEvent\">");
|
||||
ps.WriteLine(" <Exec Command = \"{0}\" />", prebuild);
|
||||
ps.WriteLine(" </Target>");
|
||||
ps.WriteLine(" <Exec Command = \"{0}\" />", prebuild);
|
||||
ps.WriteLine(" </Target>");
|
||||
}
|
||||
if (!string.IsNullOrEmpty(postbuild))
|
||||
{
|
||||
ps.WriteLine(" <Target Name = \"PostBuild\" AfterTargets = \"PostBuildEvent\">");
|
||||
ps.WriteLine(" <Exec Command = \"{0}\" />", postbuild);
|
||||
ps.WriteLine(" </Target>");
|
||||
ps.WriteLine(" <Target Name = \"PostBuild\" AfterTargets = \"PostBuildEvent\">");
|
||||
ps.WriteLine(" <Exec Command = \"{0}\" />", postbuild);
|
||||
ps.WriteLine(" </Target>");
|
||||
}
|
||||
|
||||
ps.WriteLine("</Project>");
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1006,16 +1003,16 @@ namespace Prebuild.Core.Targets
|
|||
// Assembly References
|
||||
if (otherReferences.Count > 0)
|
||||
{
|
||||
ps.WriteLine(" <ItemGroup>");
|
||||
ps.WriteLine(" <ItemGroup>");
|
||||
|
||||
foreach (ReferenceNode refr in otherReferences)
|
||||
{
|
||||
ps.Write(" <Reference");
|
||||
ps.Write(" <Reference");
|
||||
//ps.Write(" Update=\"");
|
||||
ps.Write(" Include=\"");
|
||||
ps.Write(refr.Name);
|
||||
ps.WriteLine("\" >");
|
||||
ps.Write(" <Name>");
|
||||
ps.Write(" <Name>");
|
||||
ps.Write(refr.Name);
|
||||
ps.WriteLine("</Name>");
|
||||
|
||||
|
@ -1026,18 +1023,18 @@ namespace Prebuild.Core.Targets
|
|||
if (File.Exists(Helper.MakeFilePath(absolutePath, refr.Name, "exe")))
|
||||
{
|
||||
// Assembly is an executable (exe)
|
||||
ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "exe"));
|
||||
ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "exe"));
|
||||
}
|
||||
else if (File.Exists(Helper.MakeFilePath(absolutePath, refr.Name, "dll")))
|
||||
{
|
||||
// Assembly is an library (dll)
|
||||
ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "dll"));
|
||||
ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "dll"));
|
||||
}
|
||||
else
|
||||
{
|
||||
string referencePath = Helper.MakeFilePath(refr.Path, refr.Name, "dll");
|
||||
kernel.Log.Write(LogType.Warning, "Reference \"{0}\": The specified file doesn't exist.", referencePath);
|
||||
ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "dll"));
|
||||
ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(refr.Path, refr.Name, "dll"));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1048,12 +1045,12 @@ namespace Prebuild.Core.Targets
|
|||
if (File.Exists(Helper.MakeFilePath(absolutePath, refr.Name, "exe")))
|
||||
{
|
||||
// Assembly is an executable (exe)
|
||||
ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(absolutePath, refr.Name, "exe"));
|
||||
ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(absolutePath, refr.Name, "exe"));
|
||||
}
|
||||
else if (File.Exists(Helper.MakeFilePath(absolutePath, refr.Name, "dll")))
|
||||
{
|
||||
// Assembly is an library (dll)
|
||||
ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(absolutePath, refr.Name, "dll"));
|
||||
ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(absolutePath, refr.Name, "dll"));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1062,17 +1059,17 @@ namespace Prebuild.Core.Targets
|
|||
// ps.WriteLine(" <HintPath>{0}</HintPath>", Helper.MakeFilePath(absolutePath, refr.Name, "dll"));
|
||||
}
|
||||
}
|
||||
ps.WriteLine(" <Private>{0}</Private>", refr.LocalCopy);
|
||||
ps.WriteLine(" </Reference>");
|
||||
ps.WriteLine(" <Private>{0}</Private>", refr.LocalCopy);
|
||||
ps.WriteLine(" </Reference>");
|
||||
}
|
||||
ps.WriteLine(" </ItemGroup>");
|
||||
ps.WriteLine(" </ItemGroup>");
|
||||
ps.WriteLine();
|
||||
}
|
||||
|
||||
//Project References
|
||||
if (projectReferences.Count > 0)
|
||||
{
|
||||
ps.WriteLine(" <ItemGroup>");
|
||||
ps.WriteLine(" <ItemGroup>");
|
||||
foreach (KeyValuePair<ReferenceNode, ProjectNode> pair in projectReferences)
|
||||
{
|
||||
ToolInfo tool = tools[pair.Value.Language];
|
||||
|
@ -1082,9 +1079,9 @@ namespace Prebuild.Core.Targets
|
|||
string path =
|
||||
Helper.MakePathRelativeTo(project.FullPath,
|
||||
Helper.MakeFilePath(pair.Value.FullPath, pair.Value.Name, tool.FileExtension));
|
||||
ps.WriteLine(" <ProjectReference Include=\"{0}\" />", path);
|
||||
ps.WriteLine(" <ProjectReference Include=\"{0}\" />", path);
|
||||
}
|
||||
ps.WriteLine(" </ItemGroup>");
|
||||
ps.WriteLine(" </ItemGroup>");
|
||||
ps.WriteLine();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -342,14 +342,14 @@ namespace Prebuild.Core.Targets
|
|||
ss.WriteLine(" </summaries>");
|
||||
ss.WriteLine(" <referencepaths basedir=\"${project::get-base-directory()}\">");
|
||||
ss.WriteLine(" <include name=\"${build.dir}\" />");
|
||||
// foreach(ReferenceNode refr in project.References)
|
||||
// {
|
||||
// string path = Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReferencePath(solution, refr)), '/');
|
||||
// if (path != "")
|
||||
// {
|
||||
// ss.WriteLine(" <include name=\"{0}\" />", path);
|
||||
// }
|
||||
// }
|
||||
//foreach(ReferenceNode refr in project.References)
|
||||
//{
|
||||
// string path = Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReferencePath(solution, refr)), '/');
|
||||
// if (path != "")
|
||||
// {
|
||||
// ss.WriteLine(" <include name=\"{0}\" />", path);
|
||||
// }
|
||||
//}
|
||||
ss.WriteLine(" </referencepaths>");
|
||||
ss.WriteLine(" <documenters>");
|
||||
ss.WriteLine(" <documenter name=\"MSDN\">");
|
||||
|
|
Loading…
Reference in New Issue