2018R4 ide script for compilation

  1. 2 months ago

    Sergio T

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

    Hi there... I have 2 big projects that have 3 variants of compilation... When I build my app I launch an IDE script that do something like this

    SelectWindow "Gest 2010.rbp"
    PropertyValue("App.MacOSXAppName") = "Gest-L autonoleggi"
    PropertyValue("App.WindowsAppName") = "Gest-L autonoleggi"
    ConstantValue("MAS.Trasporti") = "False"
    ConstantValue("MAS.Autonoleggio") = "True"
    ConstantValue("Server.ServerMode") = "False"
    ConstantValue("BundleID.MyBundleID") = "com.system-i.gestlautonol"
    PropertyValue("App.Application Identifier") = "com.system-i.gestlautonol"
    DoCommand "BuildApp"
    
    SelectWindow "Gest 2010.rbp"
    PropertyValue("App.MacOSXAppName") = "Gest-L trasporti"
    PropertyValue("App.WindowsAppName") = "Gest-L trasporti"
    ConstantValue("MAS.Autonoleggio") = "False"
    ConstantValue("MAS.Trasporti") = "True"
    ConstantValue("Server.ServerMode") = "False"
    ConstantValue("BundleID.MyBundleID") = "com.system-i.gestltrasp"
    PropertyValue("App.Application Identifier") = "com.system-i.gestltrasp"
    DoCommand "BuildApp"
    
    SelectWindow "Gest 2010.rbp"
    PropertyValue("App.MacOSXAppName") = "Gest-L"
    PropertyValue("App.WindowsAppName") = "Gest-L"
    ConstantValue("MAS.Trasporti") = "False"
    ConstantValue("Server.ServerMode") = "False"
    ConstantValue("BundleID.MyBundleID") = "com.system-i.gestl"
    PropertyValue("App.Application Identifier") = "com.system-i.gestl"
    DoCommand "BuildApp"

    So now that script is unusable, because the IDE, before every build, delete all the build folder content... Until 2018R3 in my build folder (after the build process) I can see my 3 subfolders with my builds... Is there any explanation for this? Is there a workaround or a solution?

    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.

  2. Beatrix W

    Dec 13 Pre-Release Testers Europe (Germany)

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

  3. Sergio T

    Dec 13 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...

  4. Beatrix W

    Dec 13 Pre-Release Testers Europe (Germany)
    Edited 2 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.

  5. Greg O

    Dec 13 Xojo Inc

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

  6. Sergio T

    Dec 18 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?

  7. Sergio T

    Dec 18 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...

  8. Emile S

    Dec 18 Europe (France, Strasbourg)

    Beware of the potential name collision(s)…

  9. Greg O

    Dec 18 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”
  10. 8 weeks ago

    Sergio T

    Dec 25 Pre-Release Testers, Xojo Pro Europe (Italy, Brescia)
    Edited 8 weeks 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"
  11. Tim J

    Dec 25 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
  12. Beatrix W

    Dec 25 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.

  13. Tim J

    Dec 25 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.

  14. Sergio T

    Dec 25 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.

  15. Sergio T

    Dec 25 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
  16. 6 days ago

    David Y

    Feb 11 Pre-Release Testers, Xojo Pro

    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.

  17. Sergio T

    Feb 11 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.

  18. David Y

    Feb 11 Pre-Release Testers, Xojo Pro

    @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.

  19. 4 days ago

    Jürg O

    Feb 12 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

  20. David Y

    Feb 12 Pre-Release Testers, Xojo Pro

    @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.

  21. Newer ›

or Sign Up to reply!