Page 1 of 1

Order of assembly references in Phalanger.CompilerTask

PostPosted: January 9th, 2016, 2:48 am
by weirdan
It seems msbuild compiler task, unlike command-line compiler, is sensitive to the order in which references are specified in the <ItemGroup>. For example, the following build snippet builds fine:
Code: Select all
    <ItemGroup Condition="'$(AppType)' == 'Gtk'">
        <Compile Include="src/View/Gtk/App.php"/>
        <!-- ....... -->
        <Reference Include="ICSharpCode.NRefactory">
            <Private>true</Private>
        </Reference>
        <Reference Include="Mono.TextEditor">
            <Private>true</Private>
        </Reference>
        <!-- ....... -->
    </ItemGroup>

while the following fails (note the order):
Code: Select all
    <ItemGroup Condition="'$(AppType)' == 'Gtk'">
        <Compile Include="src/View/Gtk/App.php"/>
        <!-- ....... -->
        <Reference Include="Mono.TextEditor">
            <Private>true</Private>
        </Reference>
        <Reference Include="ICSharpCode.NRefactory">
            <Private>true</Private>
        </Reference>
        <!-- ....... -->
    </ItemGroup>


Is this expected behavior? Am I supposed to do topological sort based on the dependencies myself?

'strace xbuild' shows that when the build fails, NRefactory assembly is searched in weird places like xbuild directories, even though the exact path to the assembly is specified in References parameter to the compiler task, albeit after the assembly that requires it (Mono.TextEditor).