void BuildIOS::Build(const String& buildPath) { buildPath_ = buildPath + "/IOS-Build"; Initialize(); FileSystem* fileSystem = GetSubsystem<FileSystem>(); if (fileSystem->DirExists(buildPath_)) fileSystem->RemoveDir(buildPath_, true); #ifdef ATOMIC_PLATFORM_WINDOWS String buildSourceDir = fileSystem->GetProgramDir(); #else String buildSourceDir = fileSystem->GetAppBundleResourceFolder(); #endif String buildAppSourceDir = buildSourceDir + "Deployment/IOS/AtomicPlayer.app"; fileSystem->CreateDir(buildPath_); String buildDestDist = buildPath_ + "/AtomicPlayer.app"; fileSystem->CreateDir(buildDestDist); String resourcePackagePath = buildDestDist + "/AtomicResources.pak"; GenerateResourcePackage(resourcePackagePath); fileSystem->Copy(buildAppSourceDir + "/AtomicPlayer", buildDestDist + "/AtomicPlayer"); fileSystem->Copy(buildAppSourceDir + "/PkgInfo", buildDestDist + "/PkgInfo"); BuildSystem* buildSystem = GetSubsystem<BuildSystem>(); IOSBuildSettings settings = buildSystem->GetBuildSettings()->GetIOSSettings(); fileSystem->Copy(settings.provisionFile, buildDestDist + "/embedded.mobileprovision"); String entitlements = GenerateEntitlements(); String plist = GenerateInfoPlist(); File file(context_, buildPath_ + "/AtomicPlayer.app.xcent", FILE_WRITE); if (file.IsOpen()) { file.Write(entitlements.CString(), entitlements.Length()); file.Close(); } File pfile(context_, buildDestDist + "/Info.plist", FILE_WRITE); if (pfile.IsOpen()) { pfile.Write(plist.CString(), plist.Length()); pfile.Close(); } RunConvertPList(); }
void BuildMac::Build(const String& buildPath) { ToolSystem* tsystem = GetSubsystem<ToolSystem>(); buildPath_ = AddTrailingSlash(buildPath) + GetBuildSubfolder(); Initialize(); BuildSystem* buildSystem = GetSubsystem<BuildSystem>(); FileSystem* fileSystem = GetSubsystem<FileSystem>(); if (fileSystem->DirExists(buildPath_)) fileSystem->RemoveDir(buildPath_, true); String dataPath = tsystem->GetDataPath(); String appSrcPath = dataPath + "Deployment/MacOS/AtomicPlayer.app"; fileSystem->CreateDir(buildPath_); buildPath_ += "/AtomicPlayer.app"; fileSystem->CreateDir(buildPath_); fileSystem->CreateDir(buildPath_ + "/Contents"); fileSystem->CreateDir(buildPath_ + "/Contents/MacOS"); fileSystem->CreateDir(buildPath_ + "/Contents/Resources"); String resourcePackagePath = buildPath_ + "/Contents/Resources/AtomicResources.pak"; GenerateResourcePackage(resourcePackagePath); fileSystem->Copy(appSrcPath + "/Contents/Resources/Atomic.icns", buildPath_ + "/Contents/Resources/Atomic.icns"); fileSystem->Copy(appSrcPath + "/Contents/Info.plist", buildPath_ + "/Contents/Info.plist"); fileSystem->Copy(appSrcPath + "/Contents/MacOS/AtomicPlayer", buildPath_ + "/Contents/MacOS/AtomicPlayer"); #ifdef ATOMIC_PLATFORM_OSX Vector<String> args; args.Push("+x"); args.Push(buildPath_ + "/Contents/MacOS/AtomicPlayer"); fileSystem->SystemRun("chmod", args); #endif buildPath_ = buildPath + "/Mac-Build"; buildSystem->BuildComplete(PLATFORMID_MAC, buildPath_); }
void BuildWindows::Build(const String& buildPath) { ToolEnvironment* tenv = GetSubsystem<ToolEnvironment>(); buildPath_ = AddTrailingSlash(buildPath) + GetBuildSubfolder(); BuildLog("Starting Windows Deployment"); Initialize(); if (!BuildClean(buildPath_)) return; BuildSystem* buildSystem = GetSubsystem<BuildSystem>(); FileSystem* fileSystem = GetSubsystem<FileSystem>(); String rootSourceDir = tenv->GetRootSourceDir(); String playerBinary = tenv->GetPlayerBinary(); String d3d9dll = GetPath(playerBinary) + "/D3DCompiler_47.dll"; if (!BuildCreateDirectory(buildPath_)) return; if (!BuildCreateDirectory(buildPath_ + "/AtomicPlayer_Resources")) return; String resourcePackagePath = buildPath_ + "/AtomicPlayer_Resources/AtomicResources" + PAK_EXTENSION; GenerateResourcePackage(resourcePackagePath); if (buildFailed_) return; if (!BuildCopyFile(playerBinary, buildPath_ + "/AtomicPlayer.exe")) return; if (!BuildCopyFile(d3d9dll, buildPath_ + "/D3DCompiler_47.dll")) return; BuildAtomicNET(); BuildLog("Windows Deployment Complete"); buildSystem->BuildComplete(PLATFORMID_WINDOWS, buildPath_); }
void BuildMac::Build(const String& buildPath) { buildPath_ = buildPath + "/Mac-Build"; Initialize(); BuildSystem* buildSystem = GetSubsystem<BuildSystem>(); // BEGIN LICENSE MANAGEMENT LicenseSystem *licenseSystem = GetSubsystem<LicenseSystem>(); if (licenseSystem->IsStandardLicense()) { if (containsMDL_) { buildSystem->BuildComplete(CE_PLATFORM_MAC, buildPath_, false, true); return; } } // END LICENSE MANAGEMENT FileSystem* fileSystem = GetSubsystem<FileSystem>(); if (fileSystem->DirExists(buildPath_)) fileSystem->RemoveDir(buildPath_, true); #ifdef CLOCKWORK_PLATFORM_WINDOWS String buildSourceDir = fileSystem->GetProgramDir(); #else String buildSourceDir = fileSystem->GetAppBundleResourceFolder(); #endif buildSourceDir += "Deployment/MacOS/ClockworkPlayer.app"; fileSystem->CreateDir(buildPath_); buildPath_ += "/ClockworkPlayer.app"; fileSystem->CreateDir(buildPath_); fileSystem->CreateDir(buildPath_ + "/Contents"); fileSystem->CreateDir(buildPath_ + "/Contents/MacOS"); fileSystem->CreateDir(buildPath_ + "/Contents/Resources"); String resourcePackagePath = buildPath_ + "/Contents/Resources/ClockworkResources.pak"; GenerateResourcePackage(resourcePackagePath); fileSystem->Copy(buildSourceDir + "/Contents/Resources/Clockwork.icns", buildPath_ + "/Contents/Resources/Clockwork.icns"); fileSystem->Copy(buildSourceDir + "/Contents/Info.plist", buildPath_ + "/Contents/Info.plist"); fileSystem->Copy(buildSourceDir + "/Contents/MacOS/ClockworkPlayer", buildPath_ + "/Contents/MacOS/ClockworkPlayer"); #ifdef CLOCKWORK_PLATFORM_OSX Vector<String> args; args.Push("+x"); args.Push(buildPath_ + "/Contents/MacOS/ClockworkPlayer"); fileSystem->SystemRun("chmod", args); #endif buildPath_ = buildPath + "/Mac-Build"; buildSystem->BuildComplete(CE_PLATFORM_MAC, buildPath_); }
void BuildWindows::Build(const String& buildPath) { BuildSystem* buildSystem = GetSubsystem<BuildSystem>(); FileSystem* fileSystem = GetSubsystem<FileSystem>(); ToolEnvironment* tenv = GetSubsystem<ToolEnvironment>(); ToolSystem* tsystem = GetSubsystem<ToolSystem>(); Project* project = tsystem->GetProject(); buildPath_ = AddTrailingSlash(buildPath); if (!resourcesOnly_) buildPath_ += GetBuildSubfolder(); BuildLog("Starting Windows Deployment"); Initialize(); if (!resourcesOnly_ && !BuildClean(buildPath_)) return; String rootSourceDir = tenv->GetRootSourceDir(); if (!BuildCreateDirectory(buildPath_)) return; if (!resourcesOnly_ && !BuildCreateDirectory(buildPath_ + "/AtomicPlayer_Resources")) return; String resourcePackagePath = buildPath_ + "/AtomicPlayer_Resources/AtomicResources" + PAK_EXTENSION; if (resourcesOnly_) { resourcePackagePath = buildPath_ + "/AtomicResources" + PAK_EXTENSION; } GenerateResourcePackage(resourcePackagePath); if (buildFailed_) return; if (resourcesOnly_) return; if (!BuildCreateDirectory(buildPath_ + "/Settings")) return; String engineJSON(GetSettingsDirectory() + "/Engine.json"); if (fileSystem->FileExists(engineJSON)) { if (!BuildCopyFile(engineJSON, buildPath_ + "/Settings/Engine.json")) return; } // TODO: Set project as managed and don't key off project assembly if (fileSystem->FileExists(project->GetResourcePath() + project->GetProjectSettings()->GetName() + ".dll")) { if (!BuildManaged(buildPath)) return; } else { BuildNative(buildPath); } BuildLog("Windows Deployment Complete"); buildSystem->BuildComplete(PLATFORMID_WINDOWS, buildPath_); }