Esempio n. 1
0
void QmlProject::refresh(RefreshOptions options)
{
    parseProject(options);

    if (options & Files)
        m_rootNode->refresh();

    QmlJS::ModelManagerInterface::ProjectInfo pinfo(this);
    pinfo.sourceFiles = files();
    pinfo.importPaths = importPaths();
    QtSupport::BaseQtVersion *version = 0;
    if (activeTarget()) {
        if (QmlProjectRunConfiguration *rc = qobject_cast<QmlProjectRunConfiguration *>(activeTarget()->activeRunConfiguration()))
            version = rc->qtVersion();
        QList<ProjectExplorer::ToolChain *> tcList;
        if (version && !version->qtAbis().isEmpty())
              tcList = ProjectExplorer::ToolChainManager::instance()->findToolChains(version->qtAbis().at(0));
        if (!tcList.isEmpty())
            QtSupport::QmlDumpTool::pathAndEnvironment(this, version, tcList.first(), false, &pinfo.qmlDumpPath, &pinfo.qmlDumpEnvironment);
    }
    if (version) {
        pinfo.tryQmlDump = true;
        pinfo.qtImportsPath = version->versionInfo().value("QT_INSTALL_IMPORTS");
        pinfo.qtVersionString = version->qtVersionString();
    }
    m_modelManager->updateProjectInfo(pinfo);
}
void GoProject::refresh(RefreshOptions options)
{
    parseProject(options);

    if (options & Files)
        m_rootNode->refresh();

    QmlJS::ModelManagerInterface::ProjectInfo projectInfo =
            QmlJSTools::defaultProjectInfoForProject(this);
    projectInfo.importPaths = customImportPaths();

    m_modelManager->updateProjectInfo(projectInfo,this);
}
Esempio n. 3
0
void QmlProject::refresh(RefreshOptions options)
{
    parseProject(options);

    if (options & Files)
        m_rootNode->refresh();

    QmlJS::ModelManagerInterface::ProjectInfo pinfo(this);
    pinfo.sourceFiles = files();
    pinfo.importPaths = importPaths();
    QtSupport::BaseQtVersion *version = 0;
    if (activeTarget()) {
        if (QmlProjectRunConfiguration *rc = qobject_cast<QmlProjectRunConfiguration *>(activeTarget()->activeRunConfiguration()))
            version = rc->qtVersion();
        QtSupport::QmlDumpTool::pathAndEnvironment(this, version, false, &pinfo.qmlDumpPath, &pinfo.qmlDumpEnvironment);
    }
    m_modelManager->updateProjectInfo(pinfo);
}
bool AllneticImportHandler::startElement(const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts) {
    if (qName.compare(QString("project")) == 0) {
        _currentProject = parseProject(atts);
        _projects->push_back(_currentProject);
    }
    if (qName.compare(QString("task")) == 0) {
        _currentTask = parseTask(atts);
        _currentProject->addTask(_currentTask);
        if (errorOcurred()) {
            return false;
        }
    }
    if (qName.compare(QString("period")) == 0) {
        TaskLog* log = parseTaskLog(atts);
        _currentTask->addLog(log);
    }
    return true;
}
Esempio n. 5
0
void QbsBuildStep::buildingDone(bool success)
{
    m_lastWasSuccess = success;
    // Report errors:
    foreach (const qbs::ErrorItem &item, m_job->error().items())
        createTaskAndOutput(ProjectExplorer::Task::Error, item.description(),
                            item.codeLocation().filePath(), item.codeLocation().line());

    QbsProject *pro = static_cast<QbsProject *>(project());

    // Building can uncover additional target artifacts.
    pro->updateAfterBuild();

    // The reparsing, if it is necessary, has to be done before finished() is emitted, as
    // otherwise a potential additional build step could conflict with the parsing step.
    if (pro->parsingScheduled())
        parseProject();
    else
        finish();
}
Esempio n. 6
0
void main(int argc, char* argv[])
{
  srand( (unsigned)time( NULL ) );

  strList projectList = parseSolution( argv[1] );
  strList::iterator itProj = projectList.begin();
  while( itProj != projectList.end() )
  {
    printf("Project: %s\n", itProj->c_str());
    strList fileName = parseProject( itProj->c_str() );
    strList::iterator itFile = fileName.begin();
    while( itFile != fileName.end() )
    {
      printf("  File %s\n", itFile->c_str());
      performFile( itFile->c_str() );
      itFile++;
    }
    fileName.clear();
    itProj++;
  }

  projectList.clear();
}
void QmlProject::refresh(RefreshOptions options)
{
    parseProject(options);

    if (options & Files)
        m_rootNode->refresh();

    QmlJS::ModelManagerInterface::ProjectInfo pinfo(this);
    pinfo.sourceFiles = files();
    pinfo.importPaths = customImportPaths();
    QtSupport::BaseQtVersion *version = 0;
    if (activeTarget()) {
        ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(activeTarget()->kit());
        version = QtSupport::QtKitInformation::qtVersion(activeTarget()->kit());
        QtSupport::QmlDumpTool::pathAndEnvironment(this, version, tc, false, &pinfo.qmlDumpPath, &pinfo.qmlDumpEnvironment);
    }
    if (version) {
        pinfo.tryQmlDump = true;
        pinfo.qtImportsPath = version->qmakeProperty("QT_INSTALL_IMPORTS");
        pinfo.qtQmlPath = version->qmakeProperty("QT_INSTALL_QML");
        pinfo.qtVersionString = version->qtVersionString();
    }
    m_modelManager->updateProjectInfo(pinfo);
}
void MAudioMainWidget::setProject(std::shared_ptr<maudio::Project> project)
{
    mProject = project;
    parseProject();
}
Esempio n. 9
0
bool updateProject(Output* output, const char* path)
{
	auto start = std::chrono::high_resolution_clock::now();

    output->print("Updating %s:\n", path);

	std::unique_ptr<ProjectGroup> group = parseProject(output, path);
	if (!group)
		return false;

	removeFile(replaceExtension(path, ".qgc").c_str());

	output->print("Scanning project...\r");

	std::vector<FileInfo> files = getProjectGroupFiles(output, group.get());

	output->print("Building file table...\r");

	if (!buildFiles(output, path, files))
		return false;
	
	std::string targetPath = replaceExtension(path, ".qgd");
	std::string tempPath = targetPath + "_";

	UpdateStatistics stats = {};
	unsigned int totalChunks = 0;

	{
		BuildContext* builder = buildStart(output, tempPath.c_str(), files.size());
		if (!builder)
			return false;

		UpdateFileIterator fileit = {files, 0};

		// update contents using existing database (if any)
		if (!processFile(output, builder, fileit, stats, targetPath.c_str()))
		{
			buildFinish(builder);
			return false;
		}

		// update all unprocessed files
		while (fileit)
		{
			buildAppendFile(builder, fileit->path.c_str(), fileit->timeStamp, fileit->fileSize);
			++fileit;
			stats.filesAdded++;
		}

		totalChunks = buildFinish(builder);
	}

	output->print("\n");

	auto time = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock::now() - start);

	printStatistics(output, stats, totalChunks, time.count() / 1e3);
	
	if (!renameFile(tempPath.c_str(), targetPath.c_str()))
	{
		output->error("Error saving data file %s\n", targetPath.c_str());
		return false;
	}

	return true;
}