native-maven-plugin : linkerSecondaryOutputExtensions behaviour - Has it changed recently?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

native-maven-plugin : linkerSecondaryOutputExtensions behaviour - Has it changed recently?

Chetan Minajagi
Hi,

Can you please let me know if the behaviour of this option linkerSecondaryOutputExtensions has been recently changed in the native-maven-plugin?


Our build script used to look like this earlier(see below) with two profiles and used to populate linkerSecondaryOutput with a particular value based on either Profile A or B.In one case it was empty/blank.

The way this used to work a few months ago was it used to always produce the dll and because of <linkerSecondaryOutputExtensions>lib</linkerSecondaryOutputExtensions>    would install corresponding artifact.lib into my local repo in the install phase.
In Profile A linkerSecondaryOutput  used to be set to pdb so <linkerSecondaryOutputExtensions>${linkerSecondaryOutput}</linkerSecondaryOutputExtensions> used to do the samething for corresponding artifact.pdb file. For Profile B this was empty so there would be no pdb file.



Now it looks like when the >${linkerSecondaryOutput} has value it seems to overwrite the earlier <linkerSecondaryOutputExtensions>lib</linkerSecondaryOutputExtensions>       config and thus I end up only getting the pdb in the local repo in this case and not the lib (which earlier used to be installed to my local repo no matter what).

I think I know the workaround now i.e.

  1.  knockoff the static <linkerSecondaryOutputExtensions>lib</linkerSecondaryOutputExtensions>
  2.  in the profile B have ${linkerSecondaryOutput} set to just lib and in profile A have ${linkerSecondaryOutput} set to lib,pdb

I would appreciate if anyone here  can let me know if this behavior got changed recently as I can then justify these pom changes to my team. Please let me know if you have any questions so I can try explaining the issue better.
Btw, we use Maven 3 and
<groupId>org.codehaus.mojo</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>1.0-alpha-7</version>
I don't quite remember if we have maven 2 earlier. Do you think it changed from maven 2 - maven 3.I doubt  as we have not changed the version of the native plugin being used.


Regards,
Chetan

      <profiles>
            <profile>
                  <id>B</id>
                        <properties>
                              <compilerOptions> /O2 /MT /GS </compilerOptions>
                              <linkerOptions> </linkerOptions>
                              <linkerSecondaryOutput> </linkerSecondaryOutput> <!-Empty because we don't generate the pdb in this case-- >
                        </properties>
            </profile>

            <profile>
                  <id>A</id>
                        <properties>
                              <compilerOptions> /Od /MTd /GS- </compilerOptions>
                              <linkerOptions> /DEBUG</linkerOptions>
                              <linkerSecondaryOutput>pdb</linkerSecondaryOutput>
                        </properties>
            </profile>
      </profiles>


<plugins>
                  <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>native-maven-plugin</artifactId>
                        <version>1.0-alpha-7</version>
                        <extensions>true</extensions>
                        <configuration>
                              <javahOS>win32</javahOS>
                           <envFactoryName>org.codehaus.mojo.natives.msvc.MSVC2008x86EnvFactory</envFactoryName>
                              <compilerProvider>msvc</compilerProvider>
                              <sources>
                                    <source>
                                          <directory>${basedir}</directory>
                                          <includes>
                                                <include>**\*.c</include>
                                          </includes>
                                    </source>

                              </sources>
                        <compilerOutputDirectory>${project.build.directory}/objs/${project.name}</compilerOutputDirectory>
                              <compilerStartOptions>
                                    <compilerStartOption> /D JVMINFO_EXPORTS </compilerStartOption>
                              </compilerStartOptions>
                              <compilerEndOptions>
                                    <compilerEndOption>${compilerOptions}</compilerEndOption>
                              </compilerEndOptions>
                              <!-- deploy the accompany .lib file as well -->
                              <linkerSecondaryOutputExtensions>lib</linkerSecondaryOutputExtensions> <!-produce the lib file with dll always -- >
                        <linkerSecondaryOutputExtensions>${linkerSecondaryOutput}</linkerSecondaryOutputExtensions> <!-produce the pdb file depending on the maven profile in use during build -- >

                              <linkerStartOptions>
                                    <linkerStartOption> /INCREMENTAL:NO /DLL   </linkerStartOption>
                                    <linkerStartOption>${linkerOptions}</linkerStartOption>
                              </linkerStartOp

This communication and all information contained in or attached to it is confidential, intended solely for the addressee, may be legally privileged and is the intellectual property
of one of the companies of NEX Group plc ("NEX") or third parties. If you are not the intended addressee or receive this message in error, please immediately delete all copies of
it and notify the sender.
 
We have taken precautions to minimise the risk of transmitting software viruses, but we advise you to carry out your own virus checks on any attachments. We do not accept liability
for any loss or damage caused by software viruses. NEX reserves the right to monitor all communications. We do not accept any legal responsibility for the content of communications,
and no communication shall be considered legally binding. Furthermore, if the content of this communication is personal or unconnected with our business, we accept no liability or
responsibility for it.
   
NEX Group plc is a public limited company registered in England and Wales under number 10013770 and certain of its affiliates are authorised and regulated by regulatory authorities.
NEX affiliates that are regulated by the UK Financial Conduct Authority ("FCA") are required to retain records of telephone conversations and other electronic communications for a period
of 5 years (7 years at the request of the FCA), copies of which are available on request (which may be subject to a fee). For further regulatory information please see www.NEX.com.