This commit is contained in:
Kudzu 2017-06-22 20:41:57 -04:00
parent 799a56c975
commit 65a4b58049
2 changed files with 17 additions and 13 deletions

View file

@ -26,8 +26,11 @@ namespace Cosmos.Build.Builder {
public CosmosTask(string aCosmosDir, int aReleaseNo) { public CosmosTask(string aCosmosDir, int aReleaseNo) {
mCosmosPath = aCosmosDir; mCosmosPath = aCosmosDir;
mVsipPath = Path.Combine(mCosmosPath, @"Build\VSIP");
mBinCachePath = Path.Combine(mCosmosPath, @"Build\bin");
mSourcePath = Path.Combine(mCosmosPath, "source"); mSourcePath = Path.Combine(mCosmosPath, "source");
mAppDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Cosmos User Kit"); mAppDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Cosmos User Kit");
mReleaseNo = aReleaseNo; mReleaseNo = aReleaseNo;
mInnoFile = Path.Combine(mCosmosPath, @"Setup\Cosmos.iss"); mInnoFile = Path.Combine(mCosmosPath, @"Setup\Cosmos.iss");
} }
@ -49,27 +52,27 @@ namespace Cosmos.Build.Builder {
private void CleanDirectory(string aName, string aPath) { private void CleanDirectory(string aName, string aPath) {
if (Directory.Exists(aPath)) { if (Directory.Exists(aPath)) {
Section("Cleaning up " + aName + " directory"); Log.WriteLine("Cleaning up existing " + aName + " directory.");
Directory.Delete(aPath, true); Directory.Delete(aPath, true);
} else { } else {
Section("Creating " + aName + " directory"); Log.WriteLine("Creating " + aName + " as " + aPath);
Directory.CreateDirectory(aPath); Directory.CreateDirectory(aPath);
} }
Log.WriteLine(" " + aPath);
} }
protected override List<string> DoRun() { protected override List<string> DoRun() {
mVsipPath = Path.Combine(mCosmosPath, @"Build\VSIP");
mBinCachePath = Path.Combine(mCosmosPath, @"Build\bin");
if (PrereqsOK()) { if (PrereqsOK()) {
Section("Checking Directories");
CleanDirectory("VSIP", mVsipPath); CleanDirectory("VSIP", mVsipPath);
CleanDirectory("Bin Cache", mBinCachePath); CleanDirectory("Bin Cache", mBinCachePath);
if (!App.IsUserKit) {
CleanDirectory("User Kit", mAppDataPath);
}
CompileCosmos(); CompileCosmos();
CreateSetup(); CreateSetup();
if (!App.IsUserKit) { if (!App.IsUserKit) {
CleanDirectory("User Kit", mAppDataPath);
RunSetup(); RunSetup();
WriteDevKit(); WriteDevKit();
if (!App.DoNotLaunchVS) { if (!App.DoNotLaunchVS) {
@ -326,7 +329,7 @@ namespace Cosmos.Build.Builder {
} }
Log.WriteLine("Launching Visual Studio"); Log.WriteLine("Launching Visual Studio");
Start(xVisualStudio, Quoted(mCosmosPath + @"Cosmos.sln"), false, true); Start(xVisualStudio, Quoted(mCosmosPath + @"Kernel.sln"), false, true);
} }
private void RunSetup() { private void RunSetup() {

View file

@ -23,20 +23,21 @@ namespace Cosmos.Build.Builder {
} }
} }
public void Copy(string aSrcPathname, bool clearReadonlyIfDestExists = true) { public void Copy(string aSrcPathname, bool aClearReadonly = true) {
Copy(aSrcPathname, Path.GetFileName(aSrcPathname), clearReadonlyIfDestExists); Copy(aSrcPathname, Path.GetFileName(aSrcPathname), aClearReadonly);
} }
public void Copy(string aSrcPathname, string aDestPathname, bool clearReadonlyIfDestExists = true) { public void Copy(string aSrcPathname, string aDestPathname, bool aClearReadonly = true) {
Log.WriteLine("Copy"); Log.WriteLine("Copy");
string xSrc = Path.Combine(SrcPath, aSrcPathname); string xSrc = Path.Combine(SrcPath, aSrcPathname);
Log.WriteLine(" From: " + xSrc); Log.WriteLine(" From: " + xSrc);
string xDest = Path.Combine(Directory.GetCurrentDirectory(), aDestPathname); string xDest = Path.Combine(DestPath, aDestPathname);
Log.WriteLine(" To: " + xDest); Log.WriteLine(" To: " + xDest);
// Copying files that are in TFS often they will be read only, so need to kill this file before copy // Copying files that are in TFS often they will be read only, so need to kill this file before copy
if (clearReadonlyIfDestExists && File.Exists(xDest)) { // We don't use TFS any more.. but left the code.
if (aClearReadonly && File.Exists(xDest)) {
ResetReadOnly(xDest); ResetReadOnly(xDest);
} }
File.Copy(xSrc, xDest, true); File.Copy(xSrc, xDest, true);