2018R4 ide script for compilation

  1. ‹ Older
  2. 8 months ago

    Sergio T

    13 Dec 2018 Pre-Release Testers, Xojo Pro Europe (Italy, Brescia)

    @Beatrix W The build folder should have been deleted anyways before building. Copy your apps somewhere else.

    Ok, so I have to do this operations manually when before was all automated. So that script is unusable now...
    Thanks for the sad answer.

    I understand that before the IDE was giving errors if the build folder already existing but... Now I'm gonna try with xojoscript if that can be helpful...

  3. Beatrix W

    13 Dec 2018 Pre-Release Testers Europe (Germany)
    Edited 8 months ago

    I'm still not sure what the problem is. You relied on an error. And you don't need to do anything manually. Ditto is working fine for this type of stuff.

  4. Greg O

    13 Dec 2018 Xojo Inc

    At the end of your script, use DoShellCommand to copy the build results.

  5. Sergio T

    18 Dec 2018 Pre-Release Testers, Xojo Pro Europe (Italy, Brescia)

    @Beatrix W I'm still not sure what the problem is. You relied on an error. And you don't need to do anything manually. Ditto is working fine for this type of stuff.

    Sorry but this is not true. Before my builds folder contains all my builds and now only the last one. Have you tried my script?

  6. Sergio T

    18 Dec 2018 Pre-Release Testers, Xojo Pro Europe (Italy, Brescia)

    @Greg OLone At the end of your script, use DoShellCommand to copy the build results.

    I think this is the only way, but I can't find any help about this command... Any suggestion? I have to copy the build outside the build folder I think...

  7. Emile S

    18 Dec 2018 Europe (France, Strasbourg)

    Beware of the potential name collision(s)…

  8. Greg O

    18 Dec 2018 Xojo Inc

    @SergioTamborini I think this is the only way, but I can't find any help about this command... Any suggestion? I have to copy the build outside the build folder I think...

    You can see the available build script commands here:
    http://developer.xojo.com/userguide/ide-scripting-commands

    You’ll need to manually build a path as a string and then provide it to DoShellCommand as part of a command. For instance, on macOS you would use:

    dim builtApp as String = CurrentBuildLocation + “/“ + CurrentBuildAppName + “.app”

    To get the full path to the bundle.

    If you are moving the app within the same drive, you can probably use the “mv “ command to move it.

    dim cmd as string = “mv “ + builtApp + “ your/new/path”
  9. Sergio T

    25 Dec 2018 Pre-Release Testers, Xojo Pro Europe (Italy, Brescia)
    Edited 8 months ago

    @Greg OLone You can see the available build script commands here:
    http://developer.xojo.com/userguide/ide-scripting-commands

    You’ll need to manually build a path as a string and then provide it to DoShellCommand as part of a command. For instance, on macOS you would use:

    dim builtApp as String = CurrentBuildLocation + “/“ + CurrentBuildAppName + “.app”

    To get the full path to the bundle.

    If you are moving the app within the same drive, you can probably use the “mv “ command to move it.
    dim cmd as string = “mv “ + builtApp + “ your/new/path”

    ok, seems good but... why my script do nothing? I've put under the macos build... the second question is: how can I debug it?

    dim builtApp as String
    dim cmd as string
    dim s As String
    
    builtApp = CurrentBuildLocation + "/" + CurrentBuildAppName + ".app"
    cmd = "mv " + builtApp + " /Users/sergio/Documents/Work/Work\ Inprogress/Gest-L/Builds\ -\ Gest\ 2010.xojo_binary_project/Compiled"
    s = doshellcommand(cmd)

    I tried with this too

    cmd = "mv """ + builtApp + """ /Users/sergio/Documents/Work/Work\ Inprogress/Gest-L/Builds\ -\ Gest\ 2010.xojo_binary_project/Compiled"
  10. Tim J

    25 Dec 2018 Pre-Release Testers, Xojo Pro Dehydrating in AZ

    It is possible that the DoShellCommand is timing out before the move completes. Change the command to:

    s = DoShellCommand(cmd, 30000)
    Print s
  11. Beatrix W

    25 Dec 2018 Pre-Release Testers Europe (Germany)

    Debugging those scripts is a pain in the behind.

    First make sure that the script executes fine in the Terminal.
    Then copy them verbatim to the IDE script.
    Then start replacing the paths with relative paths. Sprinkle with "print cmd" before running the IDE script and "print s" after the script.

    And use ditto instead of mv to preserve everything.

  12. Tim J

    25 Dec 2018 Pre-Release Testers, Xojo Pro Dehydrating in AZ

    @Beatrix Willius And use ditto instead of mv to preserve everything.

    The macOS mv and cp commands now preserve everything that's needed for modern (10.6+) versions of macOS. Using ditto is no longer required. One of the few bug reports that I filed in RADAR back in the 10.4 days that finally got implemented.

  13. Sergio T

    25 Dec 2018 Pre-Release Testers, Xojo Pro Answer Europe (Italy, Brescia)

    Ok, I've got it!!!

    Thanks for the help... print s and print cmd was a great debug mode... Now, my problem was that in my app name there was one space... So, the right script is the following (posted if anyone other needs this help). Note the "-f" parameter for the mv command.

    dim builtApp as String
    dim cmd as string
    dim s As String
    
    builtApp = CurrentBuildLocation + "/" + replaceall(CurrentBuildAppName," ","\ ") + ".app"
    cmd = "mv -f " + builtApp + " /Users/sergio/Documents/Lavoro/Lavori\ Realbasic/Gest-L/Builds\ -\ Gest\ 2010.xojo_binary_project/Compilati/"'"+ CurrentBuildAppName + ".app"
    s = doshellcommand(cmd,3000)
    'print s
    'print cmd

    So I'm trying for the windows built.

  14. Sergio T

    25 Dec 2018 Pre-Release Testers, Xojo Pro Europe (Italy, Brescia)

    And this variant is for windows build

    dim builtApp as String
    dim cmd as string
    dim s As String
    
    builtApp = CurrentBuildLocation + "/"
    cmd = "mv -f " + builtApp + " /Users/sergio/Documents/Lavoro/Lavori\ Realbasic/Gest-L/Builds\ -\ Gest\ 2010.xojo_binary_project/Compilati/"'"+ CurrentBuildAppName + ".app"
    s = doshellcommand(cmd,3000)
    'print s
    'print cmd
  15. 6 months ago

    David Y

    11 Feb 2019 Pre-Release Testers, Xojo Pro Doncaster, UK

    Just updated to 2018r4 and now, because the IDE deletes all folders inside the build folder, my IDE scripts are useless. Also, it follows any alias's in there and deletes them too, even if they're outside the build folder! Thank f**k for time machine backups etc. Good grief. Why oh why did you do this. Hours of work ahead of me now, for nowt. Gah.

  16. Sergio T

    11 Feb 2019 Pre-Release Testers, Xojo Pro Europe (Italy, Brescia)

    @David Y Just updated to 2018r4 and now, because the IDE deletes all folders inside the build folder, my IDE scripts are useless. Also, it follows any alias's in there and deletes them too, even if they're outside the build folder! Thank f**k for time machine backups etc. Good grief. Why oh why did you do this. Hours of work ahead of me now, for nowt. Gah.

    Sorry... if you read above there is an helpful solution for this "annoying" "new feature". I find useful to have an external build folder... I use for all my projects.

  17. David Y

    11 Feb 2019 Pre-Release Testers, Xojo Pro Doncaster, UK

    @SergioTamborini Sorry... if you read above there is an helpful solution for this "annoying" "new feature". I find useful to have an external build folder... I use for all my projects.

    Just so very frustrating that we get used to a certain way of working - them boom! All change - quite a major one. I have around 14 current projects that all have fairly complex IDE scripts - all of which will need modification to work. A nice simple checkbox in preferences 'don't empty build folder' would have been nice.

  18. Jürg O

    12 Feb 2019 Pre-Release Testers, Xojo Pro

    @David Y Just updated to 2018r4 and now, because the IDE deletes all folders inside the build folder.... Also, it follows any alias's in there and deletes them too,

    And a major flaw (well possible that this leads to data loss...!)...
    The Xojo IDE should never-ever delete files outside of the BuildFolder...!
    Thanks for mentioning this - I've just reported this as Feedback Case #54912

  19. David Y

    12 Feb 2019 Pre-Release Testers, Xojo Pro Doncaster, UK

    @Jürg O And a major flaw (well possible that this leads to data loss...!)...
    The Xojo IDE should never-ever delete files outside of the BuildFolder...!
    Thanks for mentioning this - I've just reported this as Feedback Case #54912

    It DID lead to major data loss! I'm just thankful I'm a backup maniac.

  20. Jay J

    12 Feb 2019 Alaska (until I can escape!)

    Maybe it's not a new feature. Report it as a bug.

  21. Sergio T

    12 Feb 2019 Pre-Release Testers, Xojo Pro Europe (Italy, Brescia)

    @David Y It DID lead to major data loss! I'm just thankful I'm a backup maniac.

    We all must be backup maniac... a lot of things (hunan or coding errors) may cause data loss...

or Sign Up to reply!