Importing plugin sometimes fails in 1.6

BECOME PART OF THE COMMUNITY - Sign up here
  • I found in 1.6 is you import an unmodified plugin a second time it fails with the error:


    LUA: no reference to main function found for plugin Test


    The first time you either import via command line or via the import UI the plugin works, however if you import again without modifying the .lua file you get the above error.


    For example:


    XML Test.xml:

    XML
    <?xml version="1.0" encoding="UTF-8"?>
    <GMA3 DataVersion="1.6.1.3">
        <Plugin Name="Test" Author="hoss" Version="1.0.0.1">
            <ComponentLua Name="Test" FileName="Test.lua" />
        </Plugin>
    </GMA3>


    LUA Test.lua:

    Code
    local function Main()
       Printf("THIS IS A TEST")
    end
    return Main

    Macro 1:

    Import Plugin 1 "Test.xml"



    Steps to reproduce:

    • Delete Plugin 1 make sure nothing in slot 1
    • Import Plugin 1 "Test.xml" or Call Macro 1 or via the UI; plugin is imported
    • Call Plugin 1 plugin is successfully run
    • Import Plugin 1 "Test.xml" import plugin a second time in any way
    • Call Plugin 1 Error

    The above will continue to fail until you either modify Test.lua or you Delete the plugin and try again. For example is sufficient to add any whitespace character (space, new line, tab).


    I thought that updating the modification date of the file with copy Test.lua+ (windows) or touch Test.lua(mac, have not tested) might have worked but on windows at least it seems you have to actually change the file.


    The same failure does not happen in 1.5 or previous.