mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-22 22:09:12 +00:00
Builder
This commit is contained in:
parent
799a56c975
commit
65a4b58049
2 changed files with 17 additions and 13 deletions
|
|
@ -26,8 +26,11 @@ namespace Cosmos.Build.Builder {
|
|||
|
||||
public CosmosTask(string aCosmosDir, int aReleaseNo) {
|
||||
mCosmosPath = aCosmosDir;
|
||||
mVsipPath = Path.Combine(mCosmosPath, @"Build\VSIP");
|
||||
mBinCachePath = Path.Combine(mCosmosPath, @"Build\bin");
|
||||
mSourcePath = Path.Combine(mCosmosPath, "source");
|
||||
mAppDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Cosmos User Kit");
|
||||
|
||||
mReleaseNo = aReleaseNo;
|
||||
mInnoFile = Path.Combine(mCosmosPath, @"Setup\Cosmos.iss");
|
||||
}
|
||||
|
|
@ -49,27 +52,27 @@ namespace Cosmos.Build.Builder {
|
|||
|
||||
private void CleanDirectory(string aName, string aPath) {
|
||||
if (Directory.Exists(aPath)) {
|
||||
Section("Cleaning up " + aName + " directory");
|
||||
Log.WriteLine("Cleaning up existing " + aName + " directory.");
|
||||
Directory.Delete(aPath, true);
|
||||
} else {
|
||||
Section("Creating " + aName + " directory");
|
||||
Log.WriteLine("Creating " + aName + " as " + aPath);
|
||||
Directory.CreateDirectory(aPath);
|
||||
}
|
||||
Log.WriteLine(" " + aPath);
|
||||
}
|
||||
|
||||
protected override List<string> DoRun() {
|
||||
mVsipPath = Path.Combine(mCosmosPath, @"Build\VSIP");
|
||||
mBinCachePath = Path.Combine(mCosmosPath, @"Build\bin");
|
||||
|
||||
if (PrereqsOK()) {
|
||||
Section("Checking Directories");
|
||||
CleanDirectory("VSIP", mVsipPath);
|
||||
CleanDirectory("Bin Cache", mBinCachePath);
|
||||
if (!App.IsUserKit) {
|
||||
CleanDirectory("User Kit", mAppDataPath);
|
||||
}
|
||||
|
||||
CompileCosmos();
|
||||
CreateSetup();
|
||||
|
||||
if (!App.IsUserKit) {
|
||||
CleanDirectory("User Kit", mAppDataPath);
|
||||
RunSetup();
|
||||
WriteDevKit();
|
||||
if (!App.DoNotLaunchVS) {
|
||||
|
|
@ -326,7 +329,7 @@ namespace Cosmos.Build.Builder {
|
|||
}
|
||||
|
||||
Log.WriteLine("Launching Visual Studio");
|
||||
Start(xVisualStudio, Quoted(mCosmosPath + @"Cosmos.sln"), false, true);
|
||||
Start(xVisualStudio, Quoted(mCosmosPath + @"Kernel.sln"), false, true);
|
||||
}
|
||||
|
||||
private void RunSetup() {
|
||||
|
|
|
|||
|
|
@ -23,20 +23,21 @@ namespace Cosmos.Build.Builder {
|
|||
}
|
||||
}
|
||||
|
||||
public void Copy(string aSrcPathname, bool clearReadonlyIfDestExists = true) {
|
||||
Copy(aSrcPathname, Path.GetFileName(aSrcPathname), clearReadonlyIfDestExists);
|
||||
public void Copy(string aSrcPathname, bool aClearReadonly = true) {
|
||||
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");
|
||||
|
||||
string xSrc = Path.Combine(SrcPath, aSrcPathname);
|
||||
Log.WriteLine(" From: " + xSrc);
|
||||
|
||||
string xDest = Path.Combine(Directory.GetCurrentDirectory(), aDestPathname);
|
||||
string xDest = Path.Combine(DestPath, aDestPathname);
|
||||
Log.WriteLine(" To: " + xDest);
|
||||
|
||||
// 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);
|
||||
}
|
||||
File.Copy(xSrc, xDest, true);
|
||||
|
|
|
|||
Loading…
Reference in a new issue