public void Save(XamarinProject project, bool doNotCleanupOnUpdate = false, bool saveProject = true) { var files = project.Save(saveProject); if (!built_before) { if (project.ShouldPopulate) { if (Directory.Exists(ProjectDirectory)) { FileSystemUtils.SetDirectoryWriteable(ProjectDirectory); Directory.Delete(ProjectDirectory, true); } if (Directory.Exists(PackagesDirectory)) { Directory.Delete(PackagesDirectory, true); } project.Populate(ProjectDirectory, files); } // Copy our solution's NuGet.config var nuget_config = Path.Combine(XABuildPaths.TopDirectory, "NuGet.config"); var dest = Path.Combine(Root, ProjectDirectory, "NuGet.config"); if (File.Exists(nuget_config) && !File.Exists(dest)) { File.Copy(nuget_config, dest, overwrite: true); } } else { project.UpdateProjectFiles(ProjectDirectory, files, doNotCleanupOnUpdate); } }
public void Save(XamarinProject project, bool doNotCleanupOnUpdate = false, bool saveProject = true) { var files = project.Save(saveProject); if (!built_before) { if (project.ShouldPopulate) { if (Directory.Exists(ProjectDirectory)) { FileSystemUtils.SetDirectoryWriteable(ProjectDirectory); Directory.Delete(ProjectDirectory, true); } if (Directory.Exists(PackagesDirectory)) { Directory.Delete(PackagesDirectory, true); } project.Populate(ProjectDirectory, files); } project.CopyNuGetConfig(ProjectDirectory); } else { project.UpdateProjectFiles(ProjectDirectory, files, doNotCleanupOnUpdate); } }
/// <summary> /// Adds a reference to another project. The optional include path uses a relative path and ProjectName if omitted. /// </summary> public void AddReference(XamarinProject other, string include = null) { if (string.IsNullOrEmpty(include)) { include = $"..\\{other.ProjectName}\\{other.ProjectName}.csproj"; } References.Add(new BuildItem.ProjectReference(include, other.ProjectName, other.ProjectGuid)); }
public bool RunTarget(XamarinProject project, string target, bool doNotCleanupOnUpdate = false, string [] parameters = null, Dictionary <string, string> environmentVariables = null, bool saveProject = true) { var oldTarget = Target; Target = target; try { return(Build(project, doNotCleanupOnUpdate: doNotCleanupOnUpdate, parameters: parameters, saveProject: saveProject, environmentVariables: environmentVariables)); } finally { Target = oldTarget; } }
public bool Restore(XamarinProject project, bool doNotCleanupOnUpdate = false) { var oldTarget = Target; Target = "Restore"; try { return(Build(project, doNotCleanupOnUpdate)); } finally { Target = oldTarget; } }
public bool UpdateAndroidResources(XamarinProject project, bool doNotCleanupOnUpdate = false, string [] parameters = null, Dictionary <string, string> environmentVariables = null) { var oldTarget = Target; Target = "UpdateAndroidResources"; try { return(Build(project, doNotCleanupOnUpdate: doNotCleanupOnUpdate, parameters: parameters, environmentVariables: environmentVariables)); } finally { Target = oldTarget; } }
public bool UpdateAndroidResources(XamarinProject project, bool doNotCleanupOnUpdate = false, string [] parameters = null) { var oldTarget = Target; Target = "UpdateAndroidResources"; try { return(Build(project, doNotCleanupOnUpdate: doNotCleanupOnUpdate, parameters: parameters)); } finally { Target = oldTarget; } }
public bool DesignTimeBuild(XamarinProject project, string target = "Compile", bool doNotCleanupOnUpdate = false, string [] parameters = null) { if (parameters == null) { return(RunTarget(project, target, doNotCleanupOnUpdate, parameters: new string [] { "DesignTimeBuild=True" })); } else { var designTimeParameters = new string [parameters.Length + 1]; parameters.CopyTo(designTimeParameters, 0); designTimeParameters [parameters.Length] = "DesignTimeBuild=True"; return(RunTarget(project, target, doNotCleanupOnUpdate, parameters: designTimeParameters)); } }
public bool Build(XamarinProject project, bool doNotCleanupOnUpdate = false, string [] parameters = null, bool saveProject = true) { Save (project, doNotCleanupOnUpdate, saveProject); Output = project.CreateBuildOutput (this); project.NuGetRestore (ProjectDirectory, PackagesDirectory); bool result = BuildInternal (Path.Combine (ProjectDirectory, project.ProjectFilePath), Target, parameters); built_before = true; if (CleanupAfterSuccessfulBuild) Cleanup (); last_build_result = result; return result; }
public bool Build(XamarinProject project, bool doNotCleanupOnUpdate = false, string [] parameters = null, bool saveProject = true, Dictionary <string, string> environmentVariables = null) { Save(project, doNotCleanupOnUpdate, saveProject); Output = project.CreateBuildOutput(this); project.NuGetRestore(ProjectDirectory, PackagesDirectory); bool result = BuildInternal(Path.Combine(ProjectDirectory, project.ProjectFilePath), Target, parameters, environmentVariables); built_before = true; if (CleanupAfterSuccessfulBuild) { Cleanup(); } last_build_result = result; return(result); }
public bool BuildProject(XamarinProject project, string target = "Build") { BuildSucceeded = BuildInternal(Path.Combine(SolutionPath, project.ProjectName, project.ProjectFilePath), target, restore: project.PackageReferences?.Count > 0); return(BuildSucceeded); }
public bool BuildProject(XamarinProject project, string target = "Build") { BuildSucceeded = BuildInternal(Path.Combine(SolutionPath, project.ProjectName, project.ProjectFilePath), target); return(BuildSucceeded); }
public bool Clean(XamarinProject project, bool doNotCleanupOnUpdate = false) { var oldTarget = Target; Target = "Clean"; try { return Build (project, doNotCleanupOnUpdate); } finally { Target = oldTarget; } }
public bool Clean(XamarinProject project, bool doNotCleanupOnUpdate = false) { return(RunTarget(project, "Clean", doNotCleanupOnUpdate)); }
public bool UpdateAndroidResources(XamarinProject project, bool doNotCleanupOnUpdate = false, string [] parameters = null, Dictionary <string, string> environmentVariables = null) { return(RunTarget(project, "UpdateAndroidResources", doNotCleanupOnUpdate, parameters, environmentVariables)); }
public bool Uninstall(XamarinProject project, bool doNotCleanupOnUpdate = false, bool saveProject = true) { return(RunTarget(project, "Uninstall", doNotCleanupOnUpdate)); }
public bool Restore(XamarinProject project, bool doNotCleanupOnUpdate = false, string [] parameters = null) { return(RunTarget(project, "Restore", doNotCleanupOnUpdate, parameters)); }
public bool Restore(XamarinProject project, bool doNotCleanupOnUpdate = false) { return(RunTarget(project, "Restore", doNotCleanupOnUpdate)); }
public bool Install(XamarinProject project, bool doNotCleanupOnUpdate = false, string [] parameters = null, bool saveProject = true) { //NOTE: since $(BuildingInsideVisualStudio) is set, Build will not happen by default return(RunTarget(project, "Build,Install", doNotCleanupOnUpdate, parameters, saveProject: saveProject)); }
public bool DesignTimeBuild(XamarinProject project, bool doNotCleanupOnUpdate = false) { return(RunTarget(project, "Compile", doNotCleanupOnUpdate, parameters: new string [] { "DesignTimeBuild=True" })); }
public bool UpdateAndroidResources(XamarinProject project, bool doNotCleanupOnUpdate = false, string [] parameters = null) { var oldTarget = Target; Target = "UpdateAndroidResources"; try { return Build (project, doNotCleanupOnUpdate: doNotCleanupOnUpdate, parameters: parameters); } finally { Target = oldTarget; } }
internal AndroidApplicationBuildOutput(XamarinProject project) : base(project) { }
internal BuildOutput(XamarinProject project) { Project = project; }
public void Save(XamarinProject project, bool doNotCleanupOnUpdate = false, bool saveProject = true) { var files = project.Save (saveProject); if (!built_before) { if (Directory.Exists (ProjectDirectory)) { FileSystemUtils.SetDirectoryWriteable (ProjectDirectory); Directory.Delete (ProjectDirectory, true); } if (Directory.Exists (PackagesDirectory)) Directory.Delete (PackagesDirectory, true); project.Populate (ProjectDirectory, files); } else project.UpdateProjectFiles (ProjectDirectory, files, doNotCleanupOnUpdate); }