diff --git a/README.md b/README.md index 3cd05ba93..5695ba3e5 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,20 @@ We encourage you to also contribute templates. The community supported templates | ![](https://raw.githubusercontent.com/toradex/vscode-torizon-templates-documentation/refs/heads/main/thumbnails/unogtk5.png?raw=true) | .NET 8 C# Uno 5 Platform Skia.GTK | .NET 8.0 | C# | ![](assets/img/arm32.png?raw=true&id=2) ![](assets/img/arm64.png?raw=true&id=2) | [dotnetUno5](./dotnetUno5) | ![](https://avatars.githubusercontent.com/u/2633321?v=4&s=64) [@microhobby](https://www.github.com/microhobby) | | ![](https://raw.githubusercontent.com/toradex/vscode-torizon-templates-documentation/refs/heads/main/thumbnails/unofbdrm5.png?raw=true) | .NET 8 C# Uno 5 Platform Frame Buffer | .NET 8.0 | C# | ![](assets/img/arm32.png?raw=true&id=2) ![](assets/img/arm64.png?raw=true&id=2) | [dotnetUno5FrameBuffer](./dotnetUno5FrameBuffer) | ![](https://avatars.githubusercontent.com/u/2633321?v=4&s=64) [@microhobby](https://www.github.com/microhobby) | +## Templates Status + +It's possible to check the current status of a template at the [templates.json](./templates.json) file, in the status property of the respective template. +There, the status can be: + +- `ok`: Which means the template is ready to be used on any of SoM, without any major known issues (but not necessarily tested on every SoM). There may still be some minor issue on the template, which can be found in the [issues part of the repository](https://github.com/torizon/vscode-torizon-templates/issues). + +- `incomplete`: Which means that the template may have a known issue that affects it's usability for some SoMs. A summarized description of the issue can be found in the `customMessage` property of the template, but also a more detailed description will be at the [issues part of the repository](https://github.com/torizon/vscode-torizon-templates/issues). + +- `notok`: Which means that the template may have an issue that affects it's usability for most or all SoMs, and therefore should not be used or updated to yet. A summarized description of the issue can be found in the `customMessage` property of the template, but also a more detailed description will be at the [issues part of the repository](https://github.com/torizon/vscode-torizon-templates/issues). + +Also, the template can be deprecated. In this case, it will be at the [deprecatedTemplates.json](./deprecatedTemplates.json) file, and it's status will be `deprecated`. + + # List of Deprecated templates | TEMPLATE | DESCRIPTION | RUNTIME | LANGUAGE | HW ARCH | FOLDER | CONTRIBUTOR | diff --git a/cppSlint/Dockerfile b/cppSlint/Dockerfile index 4a7c70ef8..649da6d16 100644 --- a/cppSlint/Dockerfile +++ b/cppSlint/Dockerfile @@ -3,7 +3,7 @@ # Base container version # Using Slint v1.7.2 base images ## -ARG CROSS_SDK_BASE_TAG=3.3.1-bookworm-1.7.2 +ARG CROSS_SDK_BASE_TAG=3.3.1-bookworm-1.9.1 ARG BASE_VERSION=3.3.1 ## diff --git a/cppSlint/Dockerfile.debug b/cppSlint/Dockerfile.debug index 1baf11e06..66ebc432e 100644 --- a/cppSlint/Dockerfile.debug +++ b/cppSlint/Dockerfile.debug @@ -8,7 +8,7 @@ ARG IMAGE_ARCH= # Base container version # Using the Slint v1.7.2 base images ## -ARG BASE_VERSION=3.3.1-bookworm-1.7.2 +ARG BASE_VERSION=3.3.1-bookworm-1.9.1 ## # Application root directory inside the container diff --git a/cppSlint/Dockerfile.sdk b/cppSlint/Dockerfile.sdk index f8de09a1c..73eab3a18 100644 --- a/cppSlint/Dockerfile.sdk +++ b/cppSlint/Dockerfile.sdk @@ -2,7 +2,7 @@ ## # Using the Slint v1.7.2 base images ## -ARG CROSS_SDK_BASE_TAG=3.3.1-bookworm-1.7.2 +ARG CROSS_SDK_BASE_TAG=3.3.1-bookworm-1.9.1 ## # Board architecture diff --git a/cspell.json b/cspell.json index 835510251..66f934807 100644 --- a/cspell.json +++ b/cspell.json @@ -14,6 +14,7 @@ "Fleetid", "listenport", "netsh", + "notok", "Oster", "ostree", "portproxy", diff --git a/deprecatedTemplates.json b/deprecatedTemplates.json new file mode 100644 index 000000000..c5ea50569 --- /dev/null +++ b/deprecatedTemplates.json @@ -0,0 +1,28 @@ +{ + "DeprecatedTemplates": [ + { + "img": "unogtk.png", + "folder": "dotnetUno", + "description": ".NET 6 C# Uno Platform Skia.GTK", + "runtime": ".net 6.0", + "language": "C#", + "debugSSHPort": "2225", + "multiContainer": true, + "support": "Toradex", + "status": "deprecated", + "customMessage": "Deprecated due to the EOL of .NET 6.0" + }, + { + "img": "unofbdrm.png", + "folder": "dotnetUnoFrameBuffer", + "description": ".NET 6 C# Uno Platform Frame Buffer", + "runtime": ".net 6.0", + "language": "C#", + "debugSSHPort": "2226", + "multiContainer": true, + "support": "Community", + "status": "deprecated", + "customMessage": "Deprecated due to the EOL of .NET 6.0" + } + ] +} diff --git a/rustSlint/Cargo.toml b/rustSlint/Cargo.toml index 407a4883e..0f8691cbf 100644 --- a/rustSlint/Cargo.toml +++ b/rustSlint/Cargo.toml @@ -7,7 +7,7 @@ build = "build.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -slint = { version = "1.7.*", features = [ "backend-linuxkms-noseat", "renderer-skia" ] } +slint = { version = "1.9.*", features = [ "backend-linuxkms-noseat", "renderer-skia" ] } [build-dependencies] -slint-build = { version = "1.7.*" } +slint-build = { version = "1.9.*" } diff --git a/rustSlint/Dockerfile b/rustSlint/Dockerfile index 66f3d936c..562764612 100644 --- a/rustSlint/Dockerfile +++ b/rustSlint/Dockerfile @@ -3,7 +3,7 @@ # Base container version # Using Slint v1.7.2 base images ## -ARG CROSS_SDK_BASE_TAG=3.3.1-bookworm-1.7.2 +ARG CROSS_SDK_BASE_TAG=3.3.1-bookworm-1.9.1 ARG BASE_VERSION=3.3.1 ## diff --git a/rustSlint/Dockerfile.debug b/rustSlint/Dockerfile.debug index fee5e634f..8bf4ab158 100644 --- a/rustSlint/Dockerfile.debug +++ b/rustSlint/Dockerfile.debug @@ -8,7 +8,7 @@ ARG IMAGE_ARCH= # Base container version # Using Slint v1.7.2 base images ## -ARG BASE_VERSION=3.3.1-bookworm-1.7.2 +ARG BASE_VERSION=3.3.1-bookworm-1.9.1 ## # Directory of the application inside container diff --git a/rustSlint/Dockerfile.sdk b/rustSlint/Dockerfile.sdk index 54faeae3f..59c03c753 100644 --- a/rustSlint/Dockerfile.sdk +++ b/rustSlint/Dockerfile.sdk @@ -8,7 +8,7 @@ ARG IMAGE_ARCH= # Base container version # Using Slint v1.7.2 base images ## -ARG CROSS_SDK_BASE_TAG=3.3.1-bookworm-1.7.2 +ARG CROSS_SDK_BASE_TAG=3.3.1-bookworm-1.9.1 ## # Directory of the application inside container diff --git a/scripts/createFromTemplate.ps1 b/scripts/createFromTemplate.ps1 index e4eb66fe7..6b35f73ca 100644 --- a/scripts/createFromTemplate.ps1 +++ b/scripts/createFromTemplate.ps1 @@ -78,9 +78,9 @@ Write-Host "Project Name -> $projectName" Write-Host "Container Name -> $containerName" # get the metadata -$_metadata = Get-Content "$templateFolder/../templates.json" | ConvertFrom-Json +$_templatesJson = Get-Content "$templateFolder/../templates.json" | ConvertFrom-Json $_templateMetadata = - $_metadata.Templates | + $_templatesJson.Templates | Where-Object { $_.folder -eq $template } # send telemetry @@ -211,9 +211,17 @@ if (-not (Test-Path "$location/.gitlab-ci.yml")) { Copy-Item "$templateFolder/../assets/gitlab/.gitlab-ci.yml" "$location/.gitlab-ci.yml" } -# create a dot file to store the template that was used -Write-Output "$template" | Out-File -FilePath "$location/.conf/.template" -Write-Output "$containerName" | Out-File -FilePath "$location/.conf/.container" +# create a metadata.json to store the name of the template, the name of the container, and the base Torizon OS Version +$_metadataJson = New-Object PSObject + +$_metadataJson | Add-Member -MemberType NoteProperty -Name "templateName" -Value $template +$_metadataJson | Add-Member -MemberType NoteProperty -Name "containerName" -Value $containerName +$_torizonOSMajor = $_templatesJson.TorizonOSMajor +$_metadataJson | Add-Member -MemberType NoteProperty -Name "torizonOSMajor" -Value $_torizonOSMajor + + +# Save the modified JSON object to a file +Set-Content -Path "$location/.conf/metadata.json" -Value ($_metadataJson | ConvertTo-Json) -Encoding UTF8 Write-Host -ForegroundColor DarkGreen "✅ Scripts copy done" diff --git a/scripts/initWorkspace.ps1 b/scripts/initWorkspace.ps1 index 48248be9a..98f1fa50f 100644 --- a/scripts/initWorkspace.ps1 +++ b/scripts/initWorkspace.ps1 @@ -43,7 +43,7 @@ if (!(Test-Path $env:HOME/.tcd/target.json)) { } # check if the workspace is valid -if (!(Test-Path ./.conf/.template)) { +if (!(Get-Content ./.conf/metadata.json | ConvertFrom-Json).templateName -and !(Test-Path ./.conf/.template)) { Write-Host -ForegroundColor Red "❌ :: This folder does not have a valid Torizon project Workspace :: ❌" Write-Host "" exit 400 diff --git a/scripts/projectUpdater.ps1 b/scripts/projectUpdater.ps1 index 5af2ef0c4..93b901d13 100644 --- a/scripts/projectUpdater.ps1 +++ b/scripts/projectUpdater.ps1 @@ -102,29 +102,7 @@ if ([string]::IsNullOrEmpty($acceptAll)) { } } -# copy the new one and make the subs -$templateName = Get-Content $projectFolder/.conf/.template -$containerName = Get-Content $projectFolder/.conf/.container - -# check first if the folder already exists -if (-not (Test-Path $projectFolder/.conf/tmp)) { - mkdir $projectFolder/.conf/tmp -} - -# get the metadata -$_metadata = Get-Content "$Env:HOME/.apollox/templates.json" | ConvertFrom-Json -$_templateMetadata = - $_metadata.Templates | - Where-Object { $_.folder -eq $templateName } - -# ----------------------------------------------------------- ALWAYS ACCEPT NEW -# UPDATE.JSON: -Copy-Item ` - $Env:HOME/.apollox/$templateName/.conf/update.json ` - $projectFolder/.conf/update.json - - -# PROJECT UPDATER: +# PROJECT UPDATER - The first thing is to update it if ( -not (_checkIfFileContentIsEqual ` $Env:HOME/.apollox/scripts/projectUpdater.ps1 ` @@ -150,6 +128,100 @@ if ( exit $LASTEXITCODE } +# get the metadata of templates.json +$_templatesJson = Get-Content "$Env:HOME/.apollox/templates.json" | ConvertFrom-Json + +# Replace the the .template and .container with metadata.json +if ((Test-Path "$projectFolder/.conf/.template") -and (Test-Path "$projectFolder/.conf/.container")) { + $templateName = Get-Content $projectFolder/.conf/.template + $containerName = Get-Content $projectFolder/.conf/.container + + $_metadataJson = New-Object PSObject + $_metadataJson | Add-Member -MemberType NoteProperty -Name "templateName" -Value $templateName + $_metadataJson | Add-Member -MemberType NoteProperty -Name "containerName" -Value $containerName + # If this property doesn't exist, then we are on Torizon 6 + if ($null -eq $_templatesJson.TorizonOSMajor) { + $_torizonOSMajor = "6" + } else { + $_torizonOSMajor = $_templatesJson.TorizonOSMajor + } + $_metadataJson | Add-Member -MemberType NoteProperty -Name "torizonOSMajor" -Value $_torizonOSMajor + + # Save the modified JSON object to a file + Set-Content -Path "$projectFolder/.conf/metadata.json" -Value ($_metadataJson | ConvertTo-Json) -Encoding UTF8 + + Remove-Item -Path $projectFolder/.conf/.template -Force + Remove-Item -Path $projectFolder/.conf/.container -Force +} + +# get the metadata of the project +$_metadataJson = Get-Content "$projectFolder/.conf/metadata.json" | ConvertFrom-Json +$templateName = $_metadataJson.templateName +$containerName = $_metadataJson.containerName +$_torizonOSMajor = $_metadataJson.TorizonOSMajor + +# If it's not the current version, it's because the person has torizon.templatesBranch setting set +if ($_templatesJson.TorizonOSMajor -ne "7") { + Write-Host -ForegroundColor DarkYellow "The current Torizon OS version is 7. If you want to upgrade to the current version, remove the torizon.templatesBranch setting." +} + +$_templatesJsonTorizonMajor = $_templatesJson.TorizonOSMajor + +# Major update on the template +if ($_torizonOSMajor -ne $_templatesJsonTorizonMajor) { + + Write-Host -ForegroundColor DarkRed "Your template is on Torizon OS version ${_torizonOSMajor} and you are updating it to a template in Torizon OS version ${_templatesJsonTorizonMajor}" + $_sure = Read-Host -Prompt "Are you sure you want to proceed with the update? [y/n]" + + if ($_sure -ne "y") { + Write-Host -ForegroundColor DarkRed "If you want to stick to a specific Torizon OS version, set the torizon.templatesBranch on settings.json: https://developer.toradex.com/torizon/application-development/ide-extension/reference-documentation/workspace-settings#torizontemplatesbranch" + exit 0 + } +} + +# check first if the folder already exists +if (-not (Test-Path $projectFolder/.conf/tmp)) { + mkdir $projectFolder/.conf/tmp +} + +# get the metadata of deprecatedTemplates.json +$_deprecatedMetadata = Get-Content "$Env:HOME/.apollox/deprecatedTemplates.json" | ConvertFrom-Json +$_deprecatedTemplateMetadata = + $_deprecatedMetadata.DeprecatedTemplates | + Where-Object { $_.folder -eq $templateName } + +# If the template is deprecated or broken, it cannot be updated. If it is incomplete the user should be made aware of the problem and choose to proceed or not. +if ($null -ne $_deprecatedTemplateMetadata) { + Write-Host -ForegroundColor DarkRed "This template is deprecated in the most recent version of the Torizon IDE Extension. For details, check https://github.com/torizon/vscode-torizon-templates/blob/dev/DEPRECATED.md" + exit 69 +} + +$_templateMetadata = + $_templatesJson.Templates | + Where-Object { $_.folder -eq $templateName } + +if ($_templateMetadata.status -eq "notok") { + Write-Host -ForegroundColor DarkRed "This template is broken in the most recent version of the Torizon IDE Extension. Reason:" + Write-Host -ForegroundColor DarkRed $_templateMetadata.customMessage + exit 69 + +} elseif ($_templateMetadata.status -eq "incomplete") { + Write-Host -ForegroundColor DarkRed "This template is incomplete in the most recent version of the Torizon IDE Extension. Reason:" + Write-Host -ForegroundColor DarkRed $_templateMetadata.customMessage + $_sure = Read-Host -Prompt "Are you sure you want to proceed with the update? [y/n]" + + if ($_sure.ToLower() -ne "y") { + exit 0 + } +} + +# ----------------------------------------------------------- ALWAYS ACCEPT NEW +# UPDATE.JSON: +Copy-Item ` + $Env:HOME/.apollox/$templateName/.conf/update.json ` + $projectFolder/.conf/update.json + + # TASKS.PS1: Copy-Item ` $Env:HOME/.apollox/scripts/tasks.ps1 ` diff --git a/tcb/.conf/bashrc.tcb b/tcb/.conf/bashrc.tcb new file mode 100644 index 000000000..67d399fb5 --- /dev/null +++ b/tcb/.conf/bashrc.tcb @@ -0,0 +1,2 @@ +source .conf/tcb-env-setup.sh -s ${STORAGE_DIR} -t ${TCB_VERSION} +source ~/.bashrc diff --git a/tcb/.conf/update.json b/tcb/.conf/update.json index c2a714b51..0b6b147d5 100644 --- a/tcb/.conf/update.json +++ b/tcb/.conf/update.json @@ -10,5 +10,9 @@ { "source": "tcbuild.yaml", "target": "tcbuild.yaml" + }, + { + "source": ".conf/bashrc.tcb", + "target": ".conf/bashrc.tcb" } ] diff --git a/tcb/.vscode/tasks.json b/tcb/.vscode/tasks.json index 57ed2e70d..60c5771a3 100644 --- a/tcb/.vscode/tasks.json +++ b/tcb/.vscode/tasks.json @@ -668,6 +668,40 @@ "panel": "dedicated" } }, + { + "label": "run-tcb-in-terminal", + "detail": "", + "hide": false, + "command": "DOCKER_HOST=", + "type": "shell", + "options": { + "cwd": "${workspaceFolder}", + "env": { + "TCB_VERSION": "${config:tcb.version}", + "STORAGE_DIR": "${workspaceFolder}/storage", + } + }, + "args": [ + "bash", + "--init-file", + ".conf/bashrc.tcb", + ], + "problemMatcher": [ + "$tsc" + ], + "dependsOrder": "sequence", + "icon": { + "id": "note", + "color": "terminal.ansiYellow" + }, + "presentation": { + "echo": true, + "reveal": "always", + "focus": true, + "panel": "shared", + "group": "tcb-setup", + } + }, ], "inputs": [ { diff --git a/templates.json b/templates.json index f1ddb419c..c99e577eb 100644 --- a/templates.json +++ b/templates.json @@ -1,4 +1,5 @@ { + "TorizonOSMajor": "7", "Templates": [ { "img": "genericTemplate.png", @@ -8,7 +9,8 @@ "language": "None", "multiContainer": true, "support": "Toradex", - "deprecated": false + "status": "ok", + "customMessage": "" }, { "img": "dotnetconsole.png", @@ -19,7 +21,8 @@ "debugSSHPort": "2222", "multiContainer": true, "support": "Toradex", - "deprecated": false, + "status": "ok", + "customMessage": "", "tests": { "debuggers": { "local": ["Local Debug"], @@ -41,7 +44,8 @@ "debugSSHPort": "2222", "multiContainer": true, "support": "Toradex", - "deprecated": false, + "status": "ok", + "customMessage": "", "tests": { "debuggers": { "local": ["Local Debug"], @@ -64,7 +68,8 @@ "debugSSHPort": "2223", "multiContainer": true, "support": "Community", - "deprecated": false, + "status": "ok", + "customMessage": "", "tests": { "debuggers": { "local": ["Local Debug"], @@ -87,7 +92,8 @@ "debugSSHPort": "2224", "multiContainer": true, "support": "Community", - "deprecated": false, + "status": "ok", + "customMessage": "", "tests": { "debuggers": { "amd64": ["Torizon AMD64"], @@ -109,7 +115,8 @@ "debugSSHPort": "2225", "multiContainer": true, "support": "Community", - "deprecated": false, + "status": "ok", + "customMessage": "", "tests": { "debuggers": { "local": ["Local Debug"], @@ -131,7 +138,8 @@ "debugSSHPort": "2226", "multiContainer": true, "support": "Community", - "deprecated": false, + "status": "ok", + "customMessage": "", "tests": { "debuggers": { "arm64": ["Torizon ARMv8"], @@ -153,7 +161,8 @@ "debugSSHPort": "2227", "multiContainer": true, "support": "Community", - "deprecated": false, + "status": "ok", + "customMessage": "", "tests" : { "debuggers": { "local": ["Mono Local"], @@ -178,7 +187,8 @@ "debugSSHPort": "2228", "multiContainer": true, "support": "Community", - "deprecated": false, + "status": "ok", + "customMessage": "", "tests": { "debuggers": { "local": ["Debug Main Process"], @@ -202,7 +212,8 @@ "debugSSHPort": "2229", "multiContainer": true, "support": "Community", - "deprecated": false, + "status": "ok", + "customMessage": "", "tests": { "debuggers": { "local": ["Node Local"], @@ -225,7 +236,8 @@ "debugSSHPort": "2230", "multiContainer": true, "support": "Toradex", - "deprecated": false, + "status": "ok", + "customMessage": "", "tests" : { "debuggers": { "local": ["Local AMD64"], @@ -247,7 +259,8 @@ "debugSSHPort": "2230", "multiContainer": true, "support": "Toradex", - "deprecated": false, + "status": "ok", + "customMessage": "", "tests" : { "debuggers": { "local": ["Local AMD64"], @@ -269,7 +282,8 @@ "debugSSHPort": "2230", "multiContainer": true, "support": "Community", - "deprecated": false, + "status": "ok", + "customMessage": "", "tests" : { "debuggers": { "local": ["Local AMD64"], @@ -294,7 +308,8 @@ "debugSSHPort": "2231", "multiContainer": true, "support": "Toradex", - "deprecated": false, + "status": "ok", + "customMessage": "", "tests": { "debuggers": { "local": ["Local AMD64"], @@ -318,7 +333,8 @@ "debugSSHPort": "2234", "multiContainer": true, "support": "Community", - "deprecated": false, + "status": "ok", + "customMessage": "", "tests" : { "debuggers": { "local": ["Run Local"], @@ -340,7 +356,8 @@ "debugSSHPort": "2299", "multiContainer": true, "support": "Community", - "deprecated": false, + "status": "ok", + "customMessage": "", "tests" : { "debuggers": { "local": ["Local AMD64"], @@ -362,7 +379,8 @@ "debugSSHPort": "2250", "multiContainer": true, "support": "Community", - "deprecated": false + "status": "ok", + "customMessage": "" }, { "img": "python3console.png", @@ -374,7 +392,8 @@ "debugSSHPort": "6502", "multiContainer": true, "support": "Toradex", - "deprecated": false, + "status": "ok", + "customMessage": "", "tests": { "debuggers": { "local": ["Python Local"], @@ -397,7 +416,8 @@ "debugSSHPort": "6502", "multiContainer": true, "support": "Community", - "deprecated": false, + "status": "ok", + "customMessage": "", "tests": { "debuggers": { "local": ["Python Local"], @@ -421,20 +441,22 @@ "multiContainer": false, "mergeCommon": false, "support": "Toradex", - "deprecated": false + "status": "ok", + "customMessage": "" }, { "img": "slint-cpp.png", "folder": "cppSlint", "description": "C++ Slint Application", - "runtime": "Slint 1.0", + "runtime": "Slint 1.x", "language": "C++", "debugPort": "2232", "debugPort2": "2233", "debugSSHPort": "2231", "multiContainer": true, "support": "Partner", - "deprecated": false, + "status": "ok", + "customMessage": "", "tests": { "debuggers": { "local": ["Local AMD64"], @@ -452,14 +474,15 @@ "img": "slint-rust.png", "folder": "rustSlint", "description": "Rust Slint Application", - "runtime": "Slint 1.0", + "runtime": "Slint 1.x", "language": "Rust", "debugPort": "2232", "debugPort2": "2233", "debugSSHPort": "2231", "multiContainer": true, "support": "Partner", - "deprecated": false, + "status": "ok", + "customMessage": "", "tests": { "debuggers": { "local": ["Debug executable "], @@ -482,7 +505,8 @@ "debugSSHPort": "2320", "multiContainer": true, "support": "Community", - "deprecated": false, + "status": "ok", + "customMessage": "", "tests" : { "debuggers": { "local": ["Local AMD64"], @@ -504,7 +528,8 @@ "debugSSHPort": "2222", "multiContainer": true, "support": "Community", - "deprecated": false, + "status": "ok", + "customMessage": "", "tests": { "debuggers": { "local": [".NET Slint Local"],