forked from qt-creator/qt-creator
Python: Create a default BuildSystem for Python targets
This makes sure the project can be parsed even if we do not have a valid
build configuration for that target.
Amends 09e94ae4ac
Change-Id: I92214474f581af228bd5c2aaf2f3e4b620ffc9d5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -129,6 +129,16 @@ PythonBuildSystem::PythonBuildSystem(PythonBuildConfiguration *buildConfig)
|
||||
requestParse();
|
||||
}
|
||||
|
||||
PythonBuildSystem::PythonBuildSystem(ProjectExplorer::Target *target)
|
||||
: BuildSystem(target)
|
||||
{
|
||||
connect(project(),
|
||||
&Project::projectFileIsDirty,
|
||||
this,
|
||||
&PythonBuildSystem::requestDelayedParse);
|
||||
requestParse();
|
||||
}
|
||||
|
||||
bool PythonBuildSystem::supportsAction(Node *context, ProjectAction action, const Node *node) const
|
||||
{
|
||||
if (node->asFileNode()) {
|
||||
|
||||
@@ -13,6 +13,7 @@ class PythonBuildSystem : public ProjectExplorer::BuildSystem
|
||||
{
|
||||
public:
|
||||
explicit PythonBuildSystem(PythonBuildConfiguration *buildConfig);
|
||||
explicit PythonBuildSystem(ProjectExplorer::Target *target);
|
||||
|
||||
bool supportsAction(ProjectExplorer::Node *context,
|
||||
ProjectExplorer::ProjectAction action,
|
||||
|
||||
@@ -23,6 +23,8 @@ PythonProject::PythonProject(const FilePath &fileName)
|
||||
setId(PythonProjectId);
|
||||
setProjectLanguages(Context(ProjectExplorer::Constants::PYTHON_LANGUAGE_ID));
|
||||
setDisplayName(fileName.completeBaseName());
|
||||
|
||||
setBuildSystemCreator([](Target *t) { return new PythonBuildSystem(t); });
|
||||
}
|
||||
|
||||
Project::RestoreResult PythonProject::fromMap(const Store &map, QString *errorMessage)
|
||||
|
||||
Reference in New Issue
Block a user