Release 1.0 #1
@@ -3,10 +3,26 @@ $Template = ""
|
||||
$IncDirs = [System.Collections.Hashtable]::new()
|
||||
$files = Get-ChildItem -Path $PSScriptRoot/../../Library -Recurse -Include '*.h' #-Name
|
||||
|
||||
/cmake/stm32cubemx
|
||||
$StartString = Select-String -Path $PSScriptRoot/../../cmake/stm32cubemx/CMakeLists.txt -Pattern "# Library folder"
|
||||
$StopString = Select-String -Path $PSScriptRoot/../../cmake/stm32cubemx/CMakeLists.txt -Pattern "# Library folder end"
|
||||
|
||||
if ($StartString.Count -eq 2 -and $StopString.Count -eq 1)
|
||||
{
|
||||
# Считываем содержимое файла
|
||||
$content = Get-Content $PSScriptRoot/../../cmake/stm32cubemx/CMakeLists.txt
|
||||
|
||||
# Указываем диапазон строк для удаления
|
||||
$startLine = $StartString[0].LineNumber
|
||||
$endLine = $StopString[0].LineNumber
|
||||
|
||||
# Удаляем строки в указанном диапазоне
|
||||
$content = $content[0..($startLine-2)] + $content[($endLine)..($content.Length)]
|
||||
|
||||
# Записываем обновленный файл
|
||||
$content | Out-File $PSScriptRoot/../../cmake/stm32cubemx/CMakeLists.txt -Encoding UTF8
|
||||
}
|
||||
|
||||
|
||||
Write-Output "" | Out-File -FilePath $PSScriptRoot/../../cmake/stm32cubemx/CMakeLists.txt -Append -Encoding utf8
|
||||
Write-Output "" | Out-File -FilePath $PSScriptRoot/../../cmake/stm32cubemx/CMakeLists.txt -Append -Encoding utf8
|
||||
Write-Output "# Library folder" | Out-File -FilePath $PSScriptRoot/../../cmake/stm32cubemx/CMakeLists.txt -Append -Encoding utf8
|
||||
Write-Output "set(DS_Include_Dirs" | Out-File -FilePath $PSScriptRoot/../../cmake/stm32cubemx/CMakeLists.txt -Append -Encoding utf8
|
||||
|
||||
@@ -52,5 +68,6 @@ foreach($file in $files)
|
||||
|
||||
Write-Output ')' | Out-File -FilePath $PSScriptRoot/../../cmake/stm32cubemx/CMakeLists.txt -Append -Encoding utf8
|
||||
Write-Output 'target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${DS_Application_Src})' | Out-File -FilePath $PSScriptRoot/../../cmake/stm32cubemx/CMakeLists.txt -Append -Encoding utf8
|
||||
Write-Output "" | Out-File -FilePath $PSScriptRoot/../../cmake/stm32cubemx/CMakeLists.txt -Append -Encoding utf8
|
||||
Write-Output "# Library folder end" | Out-File -FilePath $PSScriptRoot/../../cmake/stm32cubemx/CMakeLists.txt -Append -Encoding utf8
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user