11## What is YANGA?
22
3- <!-- .slide: data-transition="none" -->
4-
5- --
6-
7- ## What is YANGA?
8-
9- <!-- .slide: data-transition="none" -->
103
11- It is a Python application.
4+ It is a Python application. <!-- .element: class="fragment" -->
125
136--
147
158## What is it for?
169
17- <!-- .slide: data-transition="none" -->
18-
19- Note:
20-
21- Why are we talking about a Line? A Product Line? A Software Product Line?
22-
23- --
24-
25- ## Software Product Line
10+ Software Product Lines <!-- .element: class="fragment" -->
2611
2712<!-- .slide: data-transition="none" -->
2813
@@ -65,7 +50,7 @@ Terminology <!-- .element: class="monospacesmall" -->
6550``` yaml [1-10]
6651pipeline :
6752 - install :
68- - step : RunScoop
53+ - step : InstallTools
6954 - gen :
7055 - step : FeatureModel
7156 - build :
@@ -84,7 +69,7 @@ yanga.yaml <!-- .element: class="monospacesmall" -->
8469` ` ` yaml [9-10]
8570pipeline :
8671 - install :
87- - step : RunScoop
72+ - step : InstallTools
8873 - gen :
8974 - step : FeatureModel
9075 - build :
@@ -103,7 +88,7 @@ yanga.yaml <!-- .element: class="monospacesmall" -->
10388` ` ` yaml [8-8]
10489pipeline :
10590 - install :
106- - step : RunScoop
91+ - step : InstallTools
10792 - gen :
10893 - step : FeatureModel
10994 - build :
@@ -120,7 +105,7 @@ pipeline:
120105` ` ` yaml [1-10]
121106pipeline :
122107 - install :
123- - step : RunScoop
108+ - step : InstallTools
124109 - gen :
125110 - step : FeatureModel
126111 - build :
@@ -294,29 +279,263 @@ components:
294279
295280---
296281
297- ## **SPL Demo**
282+ ## <img src="images/yanga.png" class="inline-image"> <a href="https://yanga.readthedocs.io">YANGA Internals</a>
298283
299- <!-- .slide: data-background-color="#4b8e4eff" -->
284+ --
300285
301- ---
286+ ## Architecture
287+
288+ - Domain Layer - Core business logic <!-- .element: class="fragment" -->
289+ - Interface Layer - CLI/GUI/Python interface <!-- .element: class="fragment" -->
290+ - Backend Layer - Build system generators <!-- .element: class="fragment" -->
291+
292+ --
293+
294+ ## Domain Layer
295+
296+ ` src/yanga/domain/` <!-- .element: class="monospacesmall" -->
297+
298+ - ExecutionContext - Shared information <!-- .element : class="fragment" -->
299+ - ProjectSlurper - Creates the domain model <!-- .element : class="fragment" -->
300+ - Component - Buildable units with sources & tests <!-- .element : class="fragment" -->
301+ - VariantConfig - SPL variant definition <!-- .element : class="fragment" -->
302+ - PlatformConfig - Platform settings <!-- .element : class="fragment" -->
303+
304+ --
305+
306+ # # Interface Layer
307+
308+ --
309+
310+ # # CLI
311+
312+ <div class="small-container">
313+ <img src="images/yanga_cli.png" height="400">
314+ </div>
315+
316+ --
317+
318+ # # GUI
319+
320+ <div class="small-container">
321+ <img src="images/yanga_gui.png" height="400">
322+ </div>
323+
324+ --
325+
326+ # # Python
327+
328+ ` ` ` python
329+ from pathlib import Path
330+ from yanga.commands.run import RunCommand, RunCommandConfig
331+
332+ RunCommand().do_run(
333+ RunCommandConfig(
334+ project_dir=Path.cwd(),
335+ platform=platform,
336+ variant_name=self.variant_name,
337+ not_interactive=True,
338+ target="report",
339+ )
340+ )
341+
342+ ` ` `
343+
344+ --
345+
346+ # # Backend Layer
347+
348+ `src/yanga/cmake/` <!-- .element : class="monospacesmall" -->
349+
350+ ` ` ` python
351+ class CMakeGenerator(ABC):
352+ @abstractmethod
353+ def generate(self) -> list[CMakeElement]:
354+ pass
355+
356+ class ExecutableCMakeGenerator(CMakeGenerator):
357+ def generate(self) -> list[CMakeElement]:
358+ # Generate CMake targets for executables
359+ ` ` `
360+
361+ <!-- .element : class="fragment" -->
362+
363+ --
364+
365+ # # Flow Chart
366+
367+ <div class="mermaid">
368+ <pre>
369+ flowchart LR
370+ %% User Interfaces (Top Level)
371+ CLI[🖥️ Command Line]
372+ GUI[🖱️ GUI App]
373+ API[🐍 Python Code]
374+
375+ %% All paths lead to the core
376+ CLI --> CORE
377+ GUI --> CORE
378+ API --> CORE
379+
380+ %% The Heart of Yanga
381+ CORE[⚙️ RunCommand]
382+
383+ %% Simple processing steps
384+ CORE --> CHOOSE[🎯 Choose What to Build<br/>variant + platform]
385+ CORE --> READ[📖 Read Project Config<br/>YAML files]
386+ CHOOSE --> PLAN[📋 Plan Build Steps<br/>create pipeline]
387+ READ --> PLAN
388+ PLAN --> BUILD[🔨 Execute Pipeline<br/>install, generate, build]
389+ </pre>
390+ </div>
391+
392+ --
393+
394+ # # Extension Points
395+
396+ - Pipeline Steps <!-- .element : class="fragment" -->
397+ - CMake Generators <!-- .element : class="fragment" -->
398+
399+ --
400+
401+ # # Pipeline Steps
402+
403+ - ScoopInstall* - install tool dependencies <!-- .element : class="fragment" -->
404+ - WestInstall - download all external components <!-- .element : class="fragment" -->
405+ - KConfigGen - KConfig code generation step <!-- .element : class="fragment" -->
406+ - GenerateBuildSystemFiles <!-- .element : class="fragment" -->
407+ - ExecuteBuild<!-- .element : class="fragment" -->
408+
409+ --
410+
411+ # # Extending
412+
413+ New step?
414+
415+ ` ` ` python
416+ class DeployArtifacts(PipelineStep[ExecutionContext]):
417+ def __init__(
418+ self,
419+ execution_context: ExecutionContext,
420+ ) -> None:
421+ pass
422+
423+ def run(self) -> int:
424+ pass
425+ ` ` `
426+ <!-- .element : class="fragment" -->
427+
428+ --
429+
430+ # # Extending
431+
432+ ` ` ` yaml
433+ pipeline:
434+ - step: DeployArtifacts
435+ module: deployment
436+ config:
437+ server: my_server.com
438+ ` ` `
439+
440+ --
441+
442+ # # CMake Generators
443+
444+ - CreateExecutable <!-- .element : class="fragment" -->
445+ - GTest <!-- .element : class="fragment" -->
446+ - CppCheck <!-- .element : class="fragment" -->
447+ - ObjectDeps <!-- .element : class="fragment" -->
448+ - TargetsData <!-- .element : class="fragment" -->
449+ - Report <!-- .element : class="fragment" -->
450+
451+ --
452+
453+ # # Extending
454+
455+ New cmake generator?
456+
457+ ` ` ` python
458+ class CreateHex(CMakeGenerator):
459+ def __init__(
460+ self,
461+ execution_context: ExecutionContext,
462+ ) -> None:
463+ pass
464+
465+ def generate(self) -> list[CMakeElement]:
466+ pass
467+ ` ` `
468+ <!-- .element : class="fragment" -->
469+
470+ --
471+
472+ # # Reports Generation
302473
303- ## Next steps
474+ --
475+
476+ # # What gets reported?
477+
478+ - 📖 Source Code Documentation (Clanguru) <!-- .element : class="fragment" -->
479+ - 🔍 Static Analysis (CppCheck) <!-- .element : class="fragment" -->
480+ - 📊 Coverage (gcovr) <!-- .element : class="fragment" -->
481+
482+ --
483+
484+ # # How?
485+
486+ ` ` ` yaml
487+ platforms:
488+ - name: gtest
489+ cmake_generators:
490+ - step: CppCheckCMakeGenerator
491+ - step: GTestCMakeGenerator
492+ # Shall run after all other generators that produce reports
493+ - step: ReportCMakeGenerator
494+ module: yanga.cmake.reports
495+ ` ` `
304496
305497--
306498
307- ## Multi-pipeline
499+ # # Extending
500+
501+ New report type?
308502
309- | | Build | Run | Release |
310- | ----- | ----- | --- | ------- |
311- | exe | ✅ | ✅ | |
312- | gtest | ✅ | ✅ | |
313- | hil | ✅ | ✅ | |
314- | ecu | ✅ | | ✅💰 |
503+ ` ` ` python [4-6]
504+ class MyAnalysisGenerator(CMakeGenerator):
505+ def generate(self):
506+ # Your custom analysis
507+ self.execution_context.data_registry.insert(
508+ ReportRelevantFiles(...)
509+ )
510+ ` ` `
511+ <!-- .element : class="fragment" -->
512+
513+ --
514+
515+ # # How?
516+
517+ ` ` ` yaml [6]
518+ platforms:
519+ - name: gtest
520+ cmake_generators:
521+ - step: CppCheckCMakeGenerator
522+ - step: GTestCMakeGenerator
523+ - step: MyAnalysisGenerator
524+ - step: ReportCMakeGenerator
525+ ` ` `
315526
316527---
317528
318- ## <img src="images/yanga.png" class="inline-image"> <a href="https://yanga.readthedocs.io">YANGA</a>
529+ # # **SPL Demo**
530+
531+ <!-- .slide : data-background-color="#4b8e4eff" -->
319532
320533---
321534
322- ## ❕Thank you❕
535+ # # Thank you❕
536+
537+ ---
538+
539+ # # Questions?
540+
541+ <img src="images/yanga.png" class="inline-image"> <a href="https://yanga.readthedocs.io">YANGA</a>
0 commit comments