Save library project as compiled library

fh6
2017-08-01
2017-08-01
  • fh6 - 2017-08-01

    How can a library project save as compiled library?

    A little example for whah I have so far:

    \# Pythonscript to create compiled library from SVN Repro
    from __future__ import print_function
    import os
    import glob
    \# Path for temporary files
    tmppath = "D:\\tmp\\CodesysTMP\\" 
    print("TMP Path",projectpath);
    \#Checkout form SVN
    URL = "https://xxx";
    proj = svn.checkout(URL, projectpath, "xxx", as_library=True);
    \#Clean and build
    projects.primary.clean_all();
    projects.primary.check_all_pool_objects();
    \#Create Boot Application
    app.create_boot_application("D:\\tmp\bootapp.wrp");
    \#Save compiled Library
    \#????
    \#Close and Delete
    proj.close();
    files = glob.glob("D:\\tmp\\CodesysTMP\\*");
    for f in files:
    Β  Β  os.remove(f)
    print("DONE");
    

    Thanks

     
  • mkeller - 2017-08-01

    Hi feragfh6.

    project.save_as_compiled_library(destination_name)
    

    Save the current project as a compiled library. (This command currently only works for the primary project.)

    Note:
    The destination_name has the following semantics: If it is omitted or the empty string, the full project path will be used, with the extension changed to ”.compiled_library”. If the name of an existing directory is given, the library will be saved there, using the project base name and the extension changed to ”.compiled_library”. Otherwise, the destination name will be interpreted as the path relative to where the current project is.

    BR
    Martin

     

Log in to post a comment.