本文整理汇总了C#中ProjectManager.Projects.Project.ValidateBuild方法的典型用法代码示例。如果您正苦于以下问题:C# Project.ValidateBuild方法的具体用法?C# Project.ValidateBuild怎么用?C# Project.ValidateBuild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectManager.Projects.Project
的用法示例。
在下文中一共展示了Project.ValidateBuild方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Build
private static bool Build(Project project, bool runOutput)
{
// save modified files
mainForm.CallCommand("SaveAllModified", null);
string compiler = null;
if (project.NoOutput) {
// get the compiler for as3 projects, or else the FDBuildCommand pre/post command in FDBuild will fail on "No Output" projects
if (project.Language == "as3")
compiler = GetCompilerPath(project);
if (project.PreBuildEvent.Trim().Length == 0 && project.PostBuildEvent.Trim().Length == 0) {
// no output and no build commands
if (project is AS2Project || project is AS3Project) {
ErrorManager.ShowInfo("このプロジェクトはなにも出力せず、コマンドも実行しません。");
}
else {
ErrorManager.ShowInfo("このプロジェクトは有効な AS2 / AS3 プロジェクトではありません。");
}
return false;
}
}
else {
// Ask the project to validate itself
string error;
project.ValidateBuild(out error);
if (error != null) {
ErrorManager.ShowInfo(TextHelper.GetString(error));
return false;
}
// 出力先が空だったとき
if (project.OutputPath.Length < 1) {
String info = "プロジェクトをビルドするには、プロジェクトプロパティに SWF ファイルの有効な出力先を設定する必要があります。";
ErrorManager.ShowInfo(info);
return false;
}
compiler = GetCompilerPath(project);
if (compiler == null || (!Directory.Exists(compiler) && !File.Exists(compiler))) {
MessageBox.Show("Flex SDK へのパスが間違っています。プロジェクトプロパティのコンパイル設定を修正してください。", "エラー", MessageBoxButtons.OK);
return false;
}
}
return FDBuild(project, runOutput, compiler);
}
示例2: Build
public bool Build(Project project, bool runOutput, bool releaseMode)
{
// save modified files
mainForm.CallCommand("SaveAllModified", null);
string compiler = null;
InstalledSDK sdk = null;
if (project.IsCompilable)
{
sdk = GetProjectSDK(project);
compiler = GetCompilerPath(project, sdk);
}
project.TraceEnabled = !releaseMode;
if (project.OutputType == OutputType.OtherIDE)
{
// compile using associated IDE
string error;
string command = project.GetOtherIDE(runOutput, releaseMode, out error);
if (error != null) ErrorManager.ShowInfo(TextHelper.GetString(error));
else
{
if (command == "FlashIDE") RunFlashIDE(project, runOutput, releaseMode);
else
{
Hashtable data = new Hashtable();
data["command"] = command;
data["project"] = project;
data["runOutput"] = runOutput;
data["releaseMode"] = releaseMode;
DataEvent de = new DataEvent(EventType.Command, "ProjectManager.RunWithAssociatedIDE", data);
EventManager.DispatchEvent(project, de);
if (de.Handled) return true;
}
}
return false;
}
else if (project.OutputType == OutputType.CustomBuild)
{
// validate commands not empty
if (project.PreBuildEvent.Trim().Length == 0 && project.PostBuildEvent.Trim().Length == 0)
{
String info = TextHelper.GetString("Info.NoOutputAndNoBuild");
TraceManager.Add(info);
}
}
else if (project.IsCompilable)
{
// ask the project to validate itself
string error;
project.ValidateBuild(out error);
if (error != null)
{
ErrorManager.ShowInfo(TextHelper.GetString(error));
return false;
}
if (project.OutputPath.Length == 0)
{
String info = TextHelper.GetString("Info.SpecifyValidOutputSWF");
ErrorManager.ShowInfo(info);
return false;
}
if (compiler == null || (!Directory.Exists(compiler) && !File.Exists(compiler)))
{
string info = TextHelper.GetString("Info.CheckSDKSettings");
MessageBox.Show(info, TextHelper.GetString("Title.ConfigurationRequired"), MessageBoxButtons.OK);
return false;
}
}
// close running AIR projector
if (project.MovieOptions.Platform.StartsWith("AIR"))
{
foreach (Process proc in Process.GetProcessesByName("adl"))
{
try { proc.Kill(); proc.WaitForExit(10 * 1000); }
catch { }
}
}
return FDBuild(project, runOutput, releaseMode, sdk);
}
示例3: Build
public bool Build(Project project, bool runOutput, bool noTrace)
{
// save modified files
mainForm.CallCommand("SaveAllModified", null);
string compiler = null;
project.TraceEnabled = !noTrace;
if (project.NoOutput)
{
// get the compiler for as3 projects, or else the FDBuildCommand pre/post command in FDBuild will fail on "No Output" projects
if (project.Language == "as3") compiler = GetCompilerPath(project);
if (project.PreBuildEvent.Trim().Length == 0 && project.PostBuildEvent.Trim().Length == 0)
{
// no output and no build commands
if (project is AS2Project || project is AS3Project) RunFlashIDE(runOutput, noTrace);
else
{
String info = TextHelper.GetString("Info.NoOutputAndNoBuild");
ErrorManager.ShowInfo(info);
}
return false;
}
}
else
{
// Ask the project to validate itself
string error;
project.ValidateBuild(out error);
if (error != null)
{
ErrorManager.ShowInfo(TextHelper.GetString(error));
return false;
}
if (project.OutputPath.Length < 1)
{
String info = TextHelper.GetString("Info.SpecifyValidOutputSWF");
ErrorManager.ShowInfo(info);
return false;
}
compiler = GetCompilerPath(project);
if (compiler == null || (!Directory.Exists(compiler) && !File.Exists(compiler)))
{
if (usingProjectDefinedCompiler)
{
string info = TextHelper.GetString("Info.InvalidCustomCompiler");
MessageBox.Show(info, TextHelper.GetString("Title.ConfigurationRequired"), MessageBoxButtons.OK);
}
else
{
string info = String.Format(TextHelper.GetString("Info.SpecifyCompilerPath"), project.Language.ToUpper());
DialogResult result = MessageBox.Show(info, TextHelper.GetString("Title.ConfigurationRequired"), MessageBoxButtons.OKCancel);
if (result == DialogResult.OK)
{
DataEvent de = new DataEvent(EventType.Command, "ASCompletion.ShowSettings", project.Language);
EventManager.DispatchEvent(this, de);
}
}
return false;
}
}
return FDBuild(project, runOutput, noTrace, compiler);
}
示例4: Build
public bool Build(Project project, bool runOutput)
{
ipcName = Globals.MainForm.ProcessArgString("$(BuildIPC)");
string compiler = null;
if (project.NoOutput)
{
// get the compiler for as3 projects, or else the FDBuildCommand pre/post command in FDBuild will fail on "No Output" projects
if (project.Language == "as3")
compiler = ProjectManager.Actions.BuildActions.GetCompilerPath(project);
if (project.PreBuildEvent.Trim().Length == 0 && project.PostBuildEvent.Trim().Length == 0)
{
// no output and no build commands
if (project is AS2Project || project is AS3Project)
{
//RunFlashIDE(runOutput);
//ErrorManager.ShowInfo(TextHelper.GetString("ProjectManager.Info.NoOutputAndNoBuild"));
}
else
{
//ErrorManager.ShowInfo("Info.InvalidProject");
ErrorManager.ShowInfo(TextHelper.GetString("ProjectManager.Info.NoOutputAndNoBuild"));
}
return false;
}
}
else
{
// Ask the project to validate itself
string error;
project.ValidateBuild(out error);
if (error != null)
{
ErrorManager.ShowInfo(TextHelper.GetString(error));
return false;
}
// 出力先が空だったとき
if (project.OutputPath.Length < 1)
{
ErrorManager.ShowInfo(TextHelper.GetString("ProjectManager.Info.SpecifyValidOutputSWF"));
return false;
}
compiler = BuildActions.GetCompilerPath(project);
if (compiler == null || (!Directory.Exists(compiler) && !File.Exists(compiler)))
{
string info = TextHelper.GetString("ProjectManager.Info.InvalidCustomCompiler");
MessageBox.Show(info, TextHelper.GetString("ProjectManager.Title.ConfigurationRequired"), MessageBoxButtons.OK);
return false;
}
}
return FDBuild(project, runOutput, compiler);
}