BuildStep-CopyFiles can not copy folder under Linux

Hi!

I noticed that the CopyFiles BuildStep is able to copy folders under MacOs. Under Linux this is not possible: I can not choose a folder in the Dialog Window. Is there any Workaround available?

Best
Florian

Have you tried drag and drop?

Hi Paul!

Unfortunately drag and drop is neither working for files nor for folders. I am using Ubuntu 18.04 - if that matters.

Thank You!
Florian

You may need to write an IDE script with cp.

Hi Beatrix!

Thanks for the input! Do you know if it is possible to use a relative path (relative to the project folder) with a build script? I only found solutions with absolute paths which is not ideal when more than one developer is working on the project.

Thank You!
Florian

see https://documentation.xojo.com/topics/build_automation/ide_scripting/introduction.html_Constants
there are a bunch of predefined constants you can use in your scripts that permit you to use a relative path

The IDE scripts are bit of a pain. But they don’t disappear like the CopyScripts when the file isn’t there. Here is an example from my wonderful Russian doll of an app:

[code]'prepare
dim CountSlashes as Integer = CountFields(ProjectShellPath, “/”)
dim ProjectName as string = NthField(ProjectShellPath, “/”, CountSlashes)
dim ProjectPath as String = Left(ProjectShellPath, Len(ProjectShellPath) - Len(ProjectName))

'copy uninstaller into extras folder
dim cmd as String, theOutput as string
cmd = "ditto " + ProjectPath + "Builds\ -\ max\ uninstaller.xojo_xml_project/OS\ X\ 64\ bit " + CurrentBuildLocation + “/Extras”
theOutput = doShellCommand(cmd)
if theOutput <> “” then print theOutput

'copy everything from the extras folder next to the project to the final build location
cmd = "ditto " + ProjectPath + "/Extras " + CurrentBuildLocation + “/Extras”
theOutput = doShellCommand(cmd)
if theOutput <> “” then print theOutput

'and copy to final build
CountSlashes = CountFields(CurrentBuildLocation, “/”)
dim AppName as string = NthField(CurrentBuildLocation, “/”, CountSlashes)
dim BuildPath as String = Left(CurrentBuildLocation, Len(CurrentBuildLocation) - Len(AppName))

cmd = "ditto " + ProjectPath + "/Extras " + BuildPath + “final/Extras”
theOutput = doShellCommand(cmd)
if theOutput <> “” then print theOutput

cmd = "ditto " + ProjectPath + "Builds\ -\ max\ uninstaller.xojo_xml_project/OS\ X\ 64\ bit " + BuildPath + “final/Extras”
theOutput = doShellCommand(cmd)
if theOutput <> “” then print theOutput[/code]

Right now, your only option is to create the CopyFiles step(s) on Windows or macOS.

According to Feedback reports <https://xojo.com/issue/43602> and <https://xojo.com/issue/43626>, it looks like these may be sorted in the next release.

Norman, Beatrix, Tim thank you for your answers!

The page mentioned by Norman unfortunately does not list a path constant. But Beatrix’ solution works :slight_smile:

The docs are kind of spread out in a few places unfortunately
https://documentation.xojo.com/Category:User_Guide_Build_Automation