Skip to content

Commit 0b751d1

Browse files
committed
Copy root file "logo.(png|svg)" when compiling a component github:16003
1 parent 91e3d53 commit 0b751d1

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

Build4D/Project/Sources/Classes/Component.4dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Class constructor($customSettings : Object)
2222
"severity"; Error message))
2323
End if
2424

25+
This._rootFileNames:=["logo.png"; "logo.svg"]
2526

2627
//MARK:-
2728

Build4D/Project/Sources/Classes/_core.4dm

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ property _currentProjectPackage : 4D.Folder
3030
property _projectPackage : 4D.Folder
3131
property _structureFolder : 4D.Folder
3232
property _target : Text
33+
property _rootFileNames : Collection
3334

3435
property logs : Collection
3536

@@ -66,6 +67,7 @@ Class constructor($target : Text; $customSettings : Object)
6667
This._validInstance:=True
6768
This._isCurrentProject:=True
6869

70+
This._rootFileNames:=[]
6971
This._projectFile:=File(Structure file(*); fk platform path)
7072
This._currentProjectPackage:=Folder(Folder("/PACKAGE/"; *).platformPath; fk platform path)
7173
If (($settings#Null) && ($settings.projectFile#Null) && \
@@ -525,6 +527,15 @@ Function _createStructure() : Boolean
525527

526528
This._projectFile.parent.copyTo($structureFolder; fk overwrite)
527529

530+
var $rootFile : 4D.File
531+
var $rootFiles : Collection
532+
$rootFiles:=This._rootFileNames.map(Formula($2._currentProjectPackage.file($1.value)); This)
533+
For each ($rootFile; $rootFiles)
534+
If ($rootFile.exists)
535+
$rootFile.copyTo($structureFolder; fk overwrite)
536+
End if
537+
End for each
538+
528539
// Remove source methods
529540
$deletePaths:=New collection
530541
$deletePaths.push($structureFolder.folder("Project/Sources/Classes/"))

0 commit comments

Comments
 (0)