Browse Source

Introjucer: launching a project now opens the first possible exporter in the list.

tags/2021-05-28
jules 12 years ago
parent
commit
b11527d751
9 changed files with 36 additions and 117 deletions
  1. +13
    -1
      extras/Introjucer/Source/Code Editor/jucer_SourceCodeEditor.h
  2. +1
    -14
      extras/Introjucer/Source/Project Saving/jucer_ProjectExport_Android.h
  3. +9
    -32
      extras/Introjucer/Source/Project Saving/jucer_ProjectExport_MSVC.h
  4. +1
    -15
      extras/Introjucer/Source/Project Saving/jucer_ProjectExport_Make.h
  5. +6
    -12
      extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h
  6. +2
    -20
      extras/Introjucer/Source/Project Saving/jucer_ProjectExporter.cpp
  7. +1
    -5
      extras/Introjucer/Source/Project Saving/jucer_ProjectExporter.h
  8. +0
    -14
      extras/Introjucer/Source/Project/jucer_Module.cpp
  9. +3
    -4
      extras/Introjucer/Source/Project/jucer_ProjectContentComponent.cpp

+ 13
- 1
extras/Introjucer/Source/Code Editor/jucer_SourceCodeEditor.h View File

@@ -64,7 +64,19 @@ public:
//==============================================================================
struct Type : public OpenDocumentManager::DocumentType
{
bool canOpenFile (const File& file) { return file.hasFileExtension ("cpp;h;hpp;mm;m;c;cc;cxx;txt;inc;tcc;xml;plist;rtf;html;htm;php;py;rb;cs"); }
bool canOpenFile (const File& file)
{
if (file.hasFileExtension ("cpp;h;hpp;mm;m;c;cc;cxx;txt;inc;tcc;xml;plist;rtf;html;htm;php;py;rb;cs"))
return true;
MemoryBlock mb;
if (file.loadFileAsData (mb)
&& CharPointer_UTF8::isValidString (static_cast <const char*> (mb.getData()), mb.getSize()))
return true;
return false;
}
Document* openFile (Project* project, const File& file) { return new SourceCodeDocument (project, file); }
};


+ 1
- 14
extras/Introjucer/Source/Project Saving/jucer_ProjectExport_Android.h View File

@@ -73,24 +73,11 @@ public:
}
//==============================================================================
int getLaunchPreferenceOrderForCurrentOS()
{
#if JUCE_ANDROID
return 1;
#else
return 0;
#endif
}
bool launchProject() { return false; }
bool isAndroid() const { return true; }
bool isPossibleForCurrentProject() { return projectType.isGUIApplication(); }
bool usesMMFiles() const { return false; }
bool canCopeWithDuplicateFiles() { return false; }
void launchProject()
{
}
void createPropertyEditors (PropertyListBuilder& props)
{
ProjectExporter::createPropertyEditors (props);


+ 9
- 32
extras/Introjucer/Source/Project Saving/jucer_ProjectExport_MSVC.h View File

@@ -48,11 +48,19 @@ public:
}
//==============================================================================
bool isPossibleForCurrentProject() { return true; }
bool usesMMFiles() const { return false; }
bool isVisualStudio() const { return true; }
bool canCopeWithDuplicateFiles() { return false; }
bool launchProject()
{
#if JUCE_WINDOWS
return getSLNFile().startAsProcess();
#else
return false;
#endif
}
void createPropertyEditors (PropertyListBuilder& props)
{
ProjectExporter::createPropertyEditors (props);
@@ -529,17 +537,6 @@ public:
static const char* getValueTreeTypeName() { return "VS2008"; }
int getVisualStudioVersion() const { return 9; }
void launchProject() { getSLNFile().startAsProcess(); }
int getLaunchPreferenceOrderForCurrentOS()
{
#if JUCE_WINDOWS
return 4;
#else
return 0;
#endif
}
static MSVCProjectExporterVC2008* createForSettings (Project& project, const ValueTree& settings)
{
if (settings.hasType (getValueTreeTypeName()))
@@ -880,15 +877,6 @@ public:
static const char* getValueTreeTypeName() { return "VS2005"; }
int getVisualStudioVersion() const { return 8; }
int getLaunchPreferenceOrderForCurrentOS()
{
#if JUCE_WINDOWS
return 2;
#else
return 0;
#endif
}
static MSVCProjectExporterVC2005* createForSettings (Project& project, const ValueTree& settings)
{
if (settings.hasType (getValueTreeTypeName()))
@@ -918,17 +906,6 @@ public:
static const char* getValueTreeTypeName() { return "VS2010"; }
int getVisualStudioVersion() const { return 10; }
int getLaunchPreferenceOrderForCurrentOS()
{
#if JUCE_WINDOWS
return 3;
#else
return 0;
#endif
}
void launchProject() { getSLNFile().startAsProcess(); }
static MSVCProjectExporterVC2010* createForSettings (Project& project, const ValueTree& settings)
{
if (settings.hasType (getValueTreeTypeName()))


+ 1
- 15
extras/Introjucer/Source/Project Saving/jucer_ProjectExport_Make.h View File

@@ -57,25 +57,11 @@ public:
}
//==============================================================================
int getLaunchPreferenceOrderForCurrentOS()
{
#if JUCE_LINUX
return 1;
#else
return 0;
#endif
}
bool isPossibleForCurrentProject() { return true; }
bool launchProject() { return false; }
bool usesMMFiles() const { return false; }
bool isLinux() const { return true; }
bool canCopeWithDuplicateFiles() { return false; }
void launchProject()
{
// what to do on linux?
}
void createPropertyEditors (PropertyListBuilder& props)
{
ProjectExporter::createPropertyEditors (props);


+ 6
- 12
extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h View File

@@ -83,15 +83,6 @@ public:
Value getPostBuildScriptValue() { return getSetting (Ids::postbuildCommand); }
String getPostBuildScript() const { return settings [Ids::postbuildCommand]; }
int getLaunchPreferenceOrderForCurrentOS()
{
#if JUCE_MAC
return iOS ? 1 : 2;
#else
return 0;
#endif
}
bool isAvailableOnCurrentOS()
{
#if JUCE_MAC
@@ -101,7 +92,6 @@ public:
#endif
}
bool isPossibleForCurrentProject() { return projectType.isGUIApplication() || ! iOS; }
bool usesMMFiles() const { return true; }
bool isXcode() const { return true; }
bool isOSX() const { return ! iOS; }
@@ -147,9 +137,13 @@ public:
"Some shell-script that will be run after a build completes.");
}
void launchProject()
bool launchProject()
{
getProjectBundle().startAsProcess();
#if JUCE_MAC
return getProjectBundle().startAsProcess();
#else
return false;
#endif
}
//==============================================================================


+ 2
- 20
extras/Introjucer/Source/Project Saving/jucer_ProjectExporter.cpp View File

@@ -104,25 +104,6 @@ ProjectExporter* ProjectExporter::createExporter (Project& project, const ValueT
return exp;
}
ProjectExporter* ProjectExporter::createPlatformDefaultExporter (Project& project)
{
ScopedPointer <ProjectExporter> best;
int bestPref = 0;
for (Project::ExporterIterator exporter (project); exporter.next();)
{
const int pref = exporter->getLaunchPreferenceOrderForCurrentOS();
if (pref > bestPref)
{
bestPref = pref;
best = exporter.exporter;
}
}
return best.release();
}
bool ProjectExporter::canProjectBeLaunched (Project* project)
{
if (project != nullptr)
@@ -137,7 +118,8 @@ bool ProjectExporter::canProjectBeLaunched (Project* project)
MSVCProjectExporterVC2008::getValueTreeTypeName(),
MSVCProjectExporterVC2010::getValueTreeTypeName(),
#elif JUCE_LINUX
MakefileProjectExporter::getValueTreeTypeName(),
// (this doesn't currently launch.. not really sure what it would do on linux)
//MakefileProjectExporter::getValueTreeTypeName(),
#endif
nullptr


+ 1
- 5
extras/Introjucer/Source/Project Saving/jucer_ProjectExporter.h View File

@@ -43,18 +43,14 @@ public:
static ProjectExporter* createNewExporter (Project&, const int index);
static ProjectExporter* createNewExporter (Project&, const String& name);
static ProjectExporter* createExporter (Project&, const ValueTree& settings);
static ProjectExporter* createPlatformDefaultExporter (Project&);
static bool canProjectBeLaunched (Project*);
static String getCurrentPlatformExporterName();
//=============================================================================
// return 0 if this can't be opened in the current OS, or a higher value, where higher numbers are more preferable.
virtual int getLaunchPreferenceOrderForCurrentOS() = 0;
virtual bool isPossibleForCurrentProject() = 0;
virtual bool usesMMFiles() const = 0;
virtual void createPropertyEditors (PropertyListBuilder&);
virtual void launchProject() = 0;
virtual bool launchProject() = 0;
virtual void create (const OwnedArray<LibraryModule>&) const = 0; // may throw a SaveError
virtual bool shouldFileBeCompiledByDefault (const RelativePath& path) const;
virtual bool canCopeWithDuplicateFiles() = 0;


+ 0
- 14
extras/Introjucer/Source/Project/jucer_Module.cpp View File

@@ -109,20 +109,6 @@ File ModuleList::getDefaultModulesFolder (Project* project)
{
if (project != nullptr)
{
{
// Try the platform default exporter first..
ScopedPointer <ProjectExporter> exp (ProjectExporter::createPlatformDefaultExporter (*project));
if (exp != nullptr)
{
const File f (getModulesFolderForExporter (*exp));
if (ModuleList::isModulesFolder (f))
return f;
}
}
// If that didn't work, try all the other exporters..
for (Project::ExporterIterator exporter (*project); exporter.next();)
{
const File f (getModulesFolderForExporter (*exporter));


+ 3
- 4
extras/Introjucer/Source/Project/jucer_ProjectContentComponent.cpp View File

@@ -452,10 +452,9 @@ void ProjectContentComponent::openInIDE()
{
if (project != nullptr)
{
ScopedPointer <ProjectExporter> exporter (ProjectExporter::createPlatformDefaultExporter (*project));
if (exporter != nullptr)
exporter->launchProject();
for (Project::ExporterIterator exporter (*project); exporter.next();)
if (exporter->launchProject())
break;
}
}


Loading…
Cancel
Save