Files
qt-migration-legatus/qt5-before/dlbo/qav/create_qav_project.py
T
torstenandCopilot 7173785915 Qt6 Migration: Complete migration with DDS/RTI support and build validation
Major Changes:
- Merged latest Qt5 devel content from dlbo (292 files changed, 7 new dirs)
- Consolidated forward-declarations and include folders
- Removed unneeded modules per Niklas' repo check list

Build System Fixes:
- Fixed CMake VERSION_GREATER syntax in ParticipantManagement/CMakeLists.txt
- Added VLC packages (libvlc-dev, vlc-plugin-base) to docker_build.sh
- Added PostgreSQL dev packages (libpq-dev, postgresql-server-dev-all) to Dockerfile
- Fixed locale warnings (ANSI_X3.4-1968 → C.UTF-8)
- Fixed ArcGIS SDK path warnings when BUILD_ARCGIS=OFF

Code Generation Fixes:
- Fixed IDL enum collisions (PortType→CorePortType/DdsutPortType, PdmEventType)
- Fixed Grantlee template svc_translation.cpp.grantlee:
  - Changed {{ idl_enum.name }}_def:: to {{ idl_enum.name }}::
  - Fixed .underlying() calls for C++11 scoped enums (enum class)
- Removed generated files from repo (moc_*, *_dtc.h, *_ftc.h)

Validation:
- BUILD_RTI=ON: SUCCESS
- BUILD_RTI=OFF: SUCCESS
- C++17 standard maintained for RTI 7.7 compatibility
- Ubuntu 26.04 Docker environment verified

Remaining Warnings (expected):
- BgViewer, KDChart, KDReports, Poppler-Qt6 not found (optional features)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-09-15 18:20:26 +00:00

130 lines
5.2 KiB
Python
Executable File

#!/usr/bin/python
# coding: utf-8
#
import argparse
import fileinput
import glob
import inspect
import os
import shutil
import subprocess
import sys
parser = argparse.ArgumentParser( description='Perform cqm analysis of a component.')
parser.add_argument( 'projectName', help='Name of the project as shown in the server or in the gui.')
parser.add_argument( 'buildRoot', help='Absolute path to a preconfigured (cmake) build folder of the component to be analyzed..')
parser.add_argument( 'scriptFolder', help='Absolute path with qav helper scripts')
parser.add_argument( 'qafProjectRoot', help='Absolute path to generate the qav project files')
args = parser.parse_args()
scriptFolder = args.scriptFolder
if not os.path.isdir(args.scriptFolder):
print >> sys.stderr, "Given script folder does not exist: %s" % scriptFolder
sys.path.append(scriptFolder) # to make sure import createPrqaXmls200 works
# after sys.path.append
import createPrqaXmls200
import modifyJSON
scriptFolder = args.scriptFolder
qafProjectRoot = args.qafProjectRoot
qafConfigFolder = os.path.join(os.getenv('HOME'), '.config/PRQA/prqa-framework-2.1.1')
qafInstallFolder = os.path.join(os.getenv('HOME'), 'qav/prqa-framework-2.1.1')
qaCliExe = qafInstallFolder + "/common/bin/qacli"
qaGuiExe = qafInstallFolder + "/common/bin/qagui"
qaVerifyHost = "compile.defence-elec.de"
qaVerifyPort = "22230"
licenseServerAndPort = "5055@ubuntu-polarion.defence-elec.de"
###### PROJECT SPECIFIC CONFIGURATION
qafProjectXML = qafProjectRoot+"/prqaproject.xml"
acfFile = os.path.join( qafProjectRoot, args.projectName + ".acf" )
rcfFile = qafInstallFolder + "/config/rcf/RDE-CodingStandard.rcf"
cctfileCpp = qafInstallFolder + "/config/cct/GNU_GCC-g++_4.8-x86_64-generic-linux-C++-c++11.cct"
cctfileC = qafInstallFolder + "/config/cct/GNU_GCC-gcc_4.8-x86_64-generic-linux-C-c11.cct"
excludedSourceDirs = []
additionalIncludeDirs= []
excludedIncludeDirs = ['/opt'
]
analysisDefinitions = ['__PIC__',
'__x86_64__',
'__LP64__',
'__GNUC__=4',
'__GNUC_MINOR__=8',
'__cplusplus=201103',
]
# this stuff here is not used by qacli admin -F (or -j) ... so why do we need this?
defineOptionSyntax = [ '-D',
'/D'
]
includeOptionSyntax = [ '-I',
'/I',
'-i',
'-isystem'
]
###### PROJECT SPECIFIC CONFIGURATION
prqaProjectFileList = glob.glob( qafProjectRoot + "/prqaproject.xml*")
for prqaprojectFile in prqaProjectFileList:
os.remove( prqaprojectFile)
prqaConfigFolder = os.path.join(qafProjectRoot, 'prqa', 'config')
if not os.path.exists(prqaConfigFolder):
os.makedirs(prqaConfigFolder)
print( "######################################################")
print( "## QAF Projekt ANLEGEN " + qafProjectRoot)
print( "######################################################")
createPrqaXmls200.createACF(acfFile, additionalIncludeDirs, excludedIncludeDirs, analysisDefinitions)
os.system( qaCliExe+' admin --qaf-project-config --qaf-project '+ qafProjectRoot+' --cct '+cctfileCpp+' --cct '+cctfileC+' --rcf '+rcfFile+' --acf '+acfFile)
print( "######################################################")
print( "## XML FILES SCHREIBEN " + qafProjectRoot)
print( "######################################################")
createPrqaXmls200.createPrqaProjectXML(qafProjectXML, cctfileCpp, cctfileC, includeOptionSyntax, defineOptionSyntax, excludedSourceDirs, args.buildRoot, qafConfigFolder)
#print( "######################################################")
#print( "## SET LICENCE SERVER")
#print( "######################################################")
os.system( qaCliExe+' admin --set-license-server ' + licenseServerAndPort)
#print( "######################################################")
#print( "## ENABLE DEBUG INFO")
#print( "######################################################")
os.system( qaCliExe + " admin --debug-level DEBUG")
#print( "######################################################")
#print( "## REMOVE ALL LOCKS THAT MAY BE ACTIVE DUE TO DISTURBED ANALYZES")
#print( "######################################################")
os.system( qaCliExe + " admin --qaf-project \"" + qafProjectRoot + "\" --remove-locks")
print (qaCliExe + " admin --qaf-project \"" + qafProjectRoot + "\" --remove-locks")
#print( "######################################################")
#print( "## LIST FILES --- TEST")
#print( "######################################################")
os.system( qaCliExe + " admin -P \"" + qafProjectRoot + "\" --list-config-files")
#print( "######################################################")
#print( "## CMAKE CONFIGURE WITH JSON")
#print( "######################################################")
#print('####')
cc_json = os.path.join(args.buildRoot, 'compile_commands.json')
cc_txt = os.path.join(args.qafProjectRoot, 'compile_commands.txt')
if not modifyJSON.generate_compile_commands_from_json(cc_json, cc_txt, args.buildRoot):
sys.exit(1)
print(qaCliExe + ' admin -P ' + qafProjectRoot + ' -F ' + cc_txt)
os.system( qaCliExe + ' admin -P ' + qafProjectRoot + ' -F ' + cc_txt)
print('####')