本文整理汇总了C++中ProjectSaver类的典型用法代码示例。如果您正苦于以下问题:C++ ProjectSaver类的具体用法?C++ ProjectSaver怎么用?C++ ProjectSaver使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ProjectSaver类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeIncludes
//==============================================================================
void LibraryModule::writeIncludes (ProjectSaver& projectSaver, OutputStream& out)
{
Project& project = projectSaver.project;
EnabledModuleList& modules = project.getModules();
const String id (getID());
const File localModuleFolder (project.getLocalModuleFolder (id));
const File localHeader (getModuleHeaderFile (localModuleFolder));
const bool usingLocalCopyOfModules = modules.shouldCopyModuleFilesLocally (id).getValue();
if (usingLocalCopyOfModules
&& modules.shouldNotOverwriteModuleCodeOnSave (id).getValue()
&& localModuleFolder.getChildFile ("juce_module_info").exists())
{
projectSaver.filesCreated.add (localModuleFolder);
}
else
{
const File juceModuleFolder (moduleInfo.getFolder());
localModuleFolder.createDirectory();
if (usingLocalCopyOfModules)
projectSaver.copyFolder (juceModuleFolder, localModuleFolder);
else
createLocalHeaderWrapper (projectSaver, getModuleHeaderFile (juceModuleFolder), localHeader);
out << CodeHelpers::createIncludeStatement (localHeader, projectSaver.getGeneratedCodeFolder()
.getChildFile ("AppConfig.h")) << newLine;
}
}
示例2: liveBuildSaver
void MainWindow::openPIP (PIPGenerator& generator)
{
if (auto* window = ProjucerApplication::getApp().mainWindowList.getMainWindowForFile (generator.getJucerFile()))
{
if (auto* project = window->getProject())
{
project->setTemporaryDirectory (generator.getOutputDirectory());
ProjectSaver liveBuildSaver (*project, project->getFile());
liveBuildSaver.saveContentNeededForLiveBuild();
if (auto* pcc = window->getProjectContentComponent())
{
pcc->invokeDirectly (CommandIDs::toggleBuildEnabled, true);
pcc->invokeDirectly (CommandIDs::buildNow, true);
pcc->invokeDirectly (CommandIDs::toggleContinuousBuild, true);
auto fileToDisplay = generator.getPIPFile();
if (fileToDisplay != File())
{
pcc->showEditorForFile (fileToDisplay, true);
if (auto* sourceCodeEditor = dynamic_cast <SourceCodeEditor*> (pcc->getEditorComponent()))
{
sourceCodeEditor->editor->scrollToLine (findBestLineToScrollTo (StringArray::fromLines (fileToDisplay.loadFileAsString()),
generator.getMainClassName()));
}
}
}
}
}
}
示例3: updateProjectSettings
String Project::saveProject (const File& file, bool showProgressBox)
{
updateProjectSettings();
sanitiseConfigFlags();
StoredSettings::getInstance()->recentFiles.addFile (file);
ProjectSaver saver (*this, file);
return saver.save (showProgressBox);
}
示例4: updateProjectSettings
Result Project::saveProject (const File& file, bool isCommandLineApp)
{
updateProjectSettings();
sanitiseConfigFlags();
if (! isCommandLineApp)
registerRecentFile (file);
ProjectSaver saver (*this, file);
return saver.save (! isCommandLineApp);
}
示例5: findAndAddCompiledCode
void LibraryModule::findAndAddCompiledCode (ProjectExporter& exporter, ProjectSaver& projectSaver,
const File& localModuleFolder, Array<File>& result) const
{
const var compileArray (moduleInfo.moduleInfo ["compile"]); // careful to keep this alive while the array is in use!
if (const Array<var>* const files = compileArray.getArray())
{
for (int i = 0; i < files->size(); ++i)
{
const var& file = files->getReference(i);
const String filename (file ["file"].toString());
if (filename.isNotEmpty() && fileShouldBeAdded (exporter, file))
{
const File compiledFile (localModuleFolder.getChildFile (filename));
result.add (compiledFile);
Project::Item item (projectSaver.addFileToGeneratedGroup (compiledFile));
if (file ["warnings"].toString().equalsIgnoreCase ("disabled"))
item.getShouldInhibitWarningsValue() = true;
if (file ["stdcall"])
item.getShouldUseStdCallValue() = true;
}
}
}
}
示例6: createLocalHeaderWrapper
void LibraryModule::createLocalHeaderWrapper (ProjectSaver& projectSaver, const File& originalHeader, const File& localHeader) const
{
Project& project = projectSaver.project;
MemoryOutputStream out;
out << "// This is an auto-generated file to redirect any included" << newLine
<< "// module headers to the correct external folder." << newLine
<< newLine;
StringArray paths, guards;
for (Project::ExporterIterator exporter (project); exporter.next();)
{
const RelativePath headerFromProject (exporter->getModuleFolderRelativeToProject (getID(), projectSaver)
.getChildFile (originalHeader.getFileName()));
const RelativePath fileFromHere (headerFromProject.rebased (project.getProjectFolder(),
localHeader.getParentDirectory(), RelativePath::unknown));
paths.add (fileFromHere.toUnixStyle().quoted());
guards.add ("defined (" + exporter->getExporterIdentifierMacro() + ")");
}
writeGuardedInclude (out, paths, guards);
out << newLine;
projectSaver.replaceFileIfDifferent (localHeader, out);
}
示例7: updateProjectSettings
Result Project::saveProject (const File& file, bool isCommandLineApp)
{
if (isSaving)
return Result::ok();
updateProjectSettings();
sanitiseConfigFlags();
if (! isCommandLineApp)
registerRecentFile (file);
const ScopedValueSetter<bool> vs (isSaving, true, false);
ProjectSaver saver (*this, file);
return saver.save (! isCommandLineApp);
}
示例8: prepareExporter
//==============================================================================
void LibraryModule::prepareExporter (ProjectExporter& exporter, ProjectSaver& projectSaver) const
{
Project& project = exporter.getProject();
exporter.addToExtraSearchPaths (exporter.getModuleFolderRelativeToProject (getID(), projectSaver).getParentDirectory());
const String extraDefs (moduleInfo.getPreprocessorDefs().trim());
if (extraDefs.isNotEmpty())
exporter.getExporterPreprocessorDefs() = exporter.getExporterPreprocessorDefsString() + "\n" + extraDefs;
{
Array<File> compiled;
const File localModuleFolder = project.getModules().shouldCopyModuleFilesLocally (getID()).getValue()
? projectSaver.getLocalModuleFolder (getID())
: moduleInfo.getFolder();
findAndAddCompiledCode (exporter, projectSaver, localModuleFolder, compiled);
if (project.getModules().shouldShowAllModuleFilesInProject (getID()).getValue())
addBrowsableCode (exporter, projectSaver, compiled, moduleInfo.getFolder());
}
if (isVSTPluginHost (project))
VSTHelpers::addVSTFolderToPath (exporter, exporter.extraSearchPaths);
if (exporter.isXcode())
{
if (isAUPluginHost (project))
exporter.xcodeFrameworks.addTokens ("AudioUnit CoreAudioKit", false);
const String frameworks (moduleInfo.moduleInfo [exporter.isOSX() ? "OSXFrameworks" : "iOSFrameworks"].toString());
exporter.xcodeFrameworks.addTokens (frameworks, ", ", String::empty);
}
else if (exporter.isLinux())
{
const String libs (moduleInfo.moduleInfo ["LinuxLibs"].toString());
exporter.linuxLibs.addTokens (libs, ", ", String::empty);
exporter.linuxLibs.trim();
exporter.linuxLibs.sort (false);
exporter.linuxLibs.removeDuplicates (false);
}
else if (exporter.isCodeBlocks())
{
const String libs (moduleInfo.moduleInfo ["mingwLibs"].toString());
exporter.mingwLibs.addTokens (libs, ", ", String::empty);
exporter.mingwLibs.trim();
exporter.mingwLibs.sort (false);
exporter.mingwLibs.removeDuplicates (false);
}
if (moduleInfo.isPluginClient())
{
if (shouldBuildVST (project).getValue()) VSTHelpers::prepareExporter (exporter, projectSaver);
if (shouldBuildAU (project).getValue()) AUHelpers::prepareExporter (exporter, projectSaver);
if (shouldBuildAAX (project).getValue()) AAXHelpers::prepareExporter (exporter, projectSaver);
if (shouldBuildRTAS (project).getValue()) RTASHelpers::prepareExporter (exporter, projectSaver);
}
}
示例9: updateProjectSettings
const String Project::saveDocument (const File& file)
{
updateProjectSettings();
{
// (getting these forces the values to be sanitised)
OwnedArray <Project::JuceConfigFlag> flags;
getJuceConfigFlags (flags);
}
if (FileHelpers::isJuceFolder (getLocalJuceFolder()))
StoredSettings::getInstance()->setLastKnownJuceFolder (getLocalJuceFolder().getFullPathName());
StoredSettings::getInstance()->recentFiles.addFile (file);
ProjectSaver saver (*this, file);
return saver.save();
}
示例10: writeIncludes
//==============================================================================
void LibraryModule::writeIncludes (ProjectSaver& projectSaver, OutputStream& out)
{
const File localModuleFolder (projectSaver.getLocalModuleFolder (getID()));
const File localHeader (getModuleHeaderFile (localModuleFolder));
localModuleFolder.createDirectory();
if (projectSaver.project.getModules().shouldCopyModuleFilesLocally (getID()).getValue())
{
projectSaver.copyFolder (moduleInfo.getFolder(), localModuleFolder);
}
else
{
localModuleFolder.createDirectory();
createLocalHeaderWrapper (projectSaver, getModuleHeaderFile (moduleInfo.getFolder()), localHeader);
}
out << CodeHelpers::createIncludeStatement (localHeader, projectSaver.getGeneratedCodeFolder()
.getChildFile ("AppConfig.h")) << newLine;
}
示例11: getModuleFolderRelativeToProject
RelativePath ProjectExporter::getModuleFolderRelativeToProject (const String& moduleID, ProjectSaver& projectSaver) const
{
if (project.getModules().shouldCopyModuleFilesLocally (moduleID).getValue())
return RelativePath (project.getRelativePathForFile (projectSaver.getLocalModuleFolder (moduleID)),
RelativePath::projectFolder);
String path (getPathForModuleString (moduleID));
if (path.isEmpty())
return getLegacyModulePath (moduleID).getChildFile (moduleID);
return RelativePath (path, RelativePath::projectFolder).getChildFile (moduleID);
}
示例12: writeIncludes
//==============================================================================
void LibraryModule::writeIncludes (ProjectSaver& projectSaver, OutputStream& out)
{
Project& project = projectSaver.project;
EnabledModuleList& modules = project.getModules();
const String id (getID());
if (modules.shouldCopyModuleFilesLocally (id).getValue())
{
const File juceModuleFolder (moduleInfo.getFolder());
const File localModuleFolder (project.getLocalModuleFolder (id));
localModuleFolder.createDirectory();
projectSaver.copyFolder (juceModuleFolder, localModuleFolder);
}
out << "#include <" << moduleInfo.moduleFolder.getFileName() << "/"
<< moduleInfo.getHeader().getFileName()
<< ">" << newLine;
}
示例13: saver
Result Project::saveResourcesOnly (const File& file)
{
ProjectSaver saver (*this, file);
return saver.saveResourcesOnly();
}