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 BuildAndroid::Build(const String& buildPath) { ToolEnvironment* tenv = GetSubsystem<ToolEnvironment>(); ToolSystem* tsystem = GetSubsystem<ToolSystem>(); Project* project = tsystem->GetProject(); buildPath_ = AddTrailingSlash(buildPath) + GetBuildSubfolder(); Initialize(); if (!BuildClean(buildPath_)) return; //generate manifest file String manifest; for (unsigned i = 0; i < resourceEntries_.Size(); i++) { BuildResourceEntry* entry = resourceEntries_[i]; manifest += entry->packagePath_; if ( i != resourceEntries_.Size() - 1) manifest += ";"; } String buildSourceDir = tenv->GetToolDataDir(); String androidProject = buildSourceDir + "Deployment/Android"; // Copy the base android project FileSystem* fileSystem = GetSubsystem<FileSystem>(); if( !BuildCopyDir(androidProject, buildPath_)) return; Vector<String> defaultResourcePaths; GetDefaultResourcePaths(defaultResourcePaths); String projectResources = project->GetResourcePath(); for (unsigned i = 0; i < defaultResourcePaths.Size(); i++) { if ( !BuildCopyDir(defaultResourcePaths[i], buildPath_ + "/assets/" + GetFileName(RemoveTrailingSlash(defaultResourcePaths[i])))) return; } if( !BuildCopyDir(project->GetProjectPath() + "Cache/", buildPath_ + "/assets/Cache")) return; if( !BuildCopyDir(projectResources, buildPath_ + "/assets/AtomicResources")) return; // write the manifest SharedPtr<File> mfile(new File(context_, buildPath_ + "/assets/AtomicManifest", FILE_WRITE)); mfile->WriteString(manifest); mfile->Close(); //check for Deployment/Android/libs/armeabi-v7a/libAtomicPlayer.so if ( !fileSystem->FileExists(androidProject + "/libs/armeabi-v7a/libAtomicPlayer.so") ) { FailBuild( "The file libAtomicPlayer.so is not found. This is required for APK generation." ); return; } AndroidProjectGenerator gen(context_, this); gen.SetBuildPath(buildPath_); if (!gen.Generate()) { FailBuild(gen.GetErrorText()); return; } RunAntDebug(); }
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_); }