[ 
https://issues.apache.org/jira/browse/NPANDAY-486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lars Corneliussen updated NPANDAY-486:
--------------------------------------

    Description: 
The current MSBuild integration is a hack. It was initially implemented as a 
dotnet-maven-plugin, but now also the Java binding has been forked from the 
originally generated source.

h2. How it works now
In order to "activate" MSBuild, the plugin 
{{{NPanday.Plugin.Msbuild.JavaBinding}}} must be configured:

{code}
<plugin>
<groupId>org.apache.npanday.plugins</groupId>
<artifactId>NPanday.Plugin.Msbuild.JavaBinding</artifactId>
  <executions>
    <execution>
      <goals>
        <goal>compile</goal>
      </goals>
    </execution>
  </executions>
</plugin>
{code}

Also currently, code generated by MSBuild seems to have to be included manually!
{code:title=from NPANDAY_328_VS2010WpfProjectSupportTest}
...
<includeSource>obj\x86\Debug\App.g.cs</includeSource>
...
{code}


It registers MsbuildMojo.java to the validate-phase, which performs these 
steps: 

* preExecute: If {{{copyDependencies}}} is {{{true}}} (is true by default), it 
will copy all dependencies of the current project to (!) {{{basedir/bin/Debug}}}
* preExecute: Then it adds all *.resource-files from (!) {{{obj/Debug}}} to 
project resources (using {{{project.addResource}}}
** (?) How can it even know theese, before having executed msbuild? Looks like 
this won't have any effect, before the second build runs.
* Execute: Calls into {{{MsbuildMojo.cs}}}
** Searches for {{{projectName.csproj/vbproj}}}
** Runs with: {{{/v:q /p:BuildProjectReferences=false 
/p:BuildingInsideVisualStudio=true}}}
** Deletes

h2. How it should work

This is still to be figured out. Let's collect some requirements:

h3. Functional Requirements (high-level)
* It must be possible to compile WPF-projects (with Xaml-files)
* any more?

h3. Conditions / Design Decisions
* The Maven principle of reproducible builds must be met.
* Dependencies from pom must override those specified in the build file
* Correct versions of dependencies must be ensured
* Project-references must be resolved inside the reactor, if possible.
* Generated code or resource must automatically be added to the POM (in-memory?)
* Msbuild targets should run in appropriate maven phase (not in validate!)
* Msbuild error-handling must

h3. Msbuild Default Lifecycle Draft

{color:red}red: changes to maven-compile-plugin lifecycle{color}
{color:green}green: msbuild concern{color}

*validate*
  - NPanday Plugins : maven-compile-plugin : initialize {color:red}Necessary?: 
runs {{{assemblyResolver.resolveTransitivelyFor}}} and 
{{{assemblerContext.init}}}{color}
  - NPanday Plugins : maven-resolver-plugin : resolve
  - NPanday Plugins : NPanday.Plugin.Settings.JavaBinding : generate-settings
  - {color:green}NPanday Plugins : msbuild-maven-plugin : initialize (finds the 
MSBuild file and validates that msbuild is available?){color}
  - {color:green}NPanday Plugins : msbuild-maven-plugin : *shaddow* (creates 
msbuild-file, overrides dependencies and output; figures out 
parametrization){color}
  - {color:green}NPanday Plugins : msbuild-maven-plugin : *shaddow-test* 
(creates msbuild-file for testing and figures out parametrization){color}

*on generate-sources*
  - {color:red}-NPanday Plugins : maven-compile-plugin : 
generate-assembly-info-{color}

*on process-sources*
  - {color:red}-NPanday Plugins : maven-compile-plugin : process-sources-{color}
  - {color:red}-NPanday Plugins : maven-compile-plugin : 
process-test-sources-{color}
  - {color:green}NPanday Plugins : msbuild-maven-plugin : 
*shadow-assembly-info* (should share code with generate-assembly-info){color}

*on process-resources*
  - NPanday Plugins : maven-resgen-plugin : copy-resources {color:red}Should 
this still be supported?{color}
  - NPanday Plugins : maven-resgen-plugin : generate
  - NPanday Plugins : maven-resgen-plugin : generate-existing-resx-to-resource

*on compile*
  - {color:red}-NPanday Plugins : maven-compile-plugin : compile-{color}
  - {color:green}NPanday Plugins : msbuild-maven-plugin : *build*{color}

*on test-compile*
  - {color:red}-NPanday Plugins : maven-compile-plugin : testCompile-{color}
  - {color:green}NPanday Plugins : msbuild-maven-plugin : *testBuild*{color}

*on test*
  - NPanday Plugins : maven-test-plugin : test

{color:green}*verify*{color}
  - {color:green}NPanday Plugins : msbuild-maven-plugin : *verify* (Make sure 
the main artifact was generated by msbuild){color}

*on install*
  - NPanday Plugins : maven-repository-plugin : convert-artifact
  - NPanday Plugins : maven-install-plugin : install
  - Maven Plugins : maven-install-plugin : install

*on deploy*
  - Maven Plugins : maven-deploy-plugin : deploy

  was:
The current MSBuild integration is a hack. It was initially implemented as a 
dotnet-maven-plugin, but now also the Java binding has been forked from the 
originally generated source.

h2. How it works now
In order to "activate" MSBuild, the plugin 
{{{NPanday.Plugin.Msbuild.JavaBinding}}} must be configured:

{code}
<plugin>
<groupId>org.apache.npanday.plugins</groupId>
<artifactId>NPanday.Plugin.Msbuild.JavaBinding</artifactId>
  <executions>
    <execution>
      <goals>
        <goal>compile</goal>
      </goals>
    </execution>
  </executions>
</plugin>
{code}

Also currently, code generated by MSBuild seems to have to be included manually!
{code:title=from NPANDAY_328_VS2010WpfProjectSupportTest}
...
<includeSource>obj\x86\Debug\App.g.cs</includeSource>
...
{code}


It registers MsbuildMojo.java to the validate-phase, which performs these 
steps: 

* preExecute: If {{{copyDependencies}}} is {{{true}}} (is true by default), it 
will copy all dependencies of the current project to (!) {{{basedir/bin/Debug}}}
* preExecute: Then it adds all *.resource-files from (!) {{{obj/Debug}}} to 
project resources (using {{{project.addResource}}}
** (?) How can it even know theese, before having executed msbuild? Looks like 
this won't have any effect, before the second build runs.
* Execute: Calls into {{{MsbuildMojo.cs}}}
** Searches for {{{projectName.csproj/vbproj}}}
** Runs with: {{{/v:q /p:BuildProjectReferences=false 
/p:BuildingInsideVisualStudio=true}}}
** Deletes

h2. How it should work

This is still to be figured out. Let's collect some requirements:

h3. Functional Requirements (high-level)
* It must be possible to compile WPF-projects (with Xaml-files)
* any more?

h3. Conditions / Design Decisions
* The Maven principle of reproducible builds must be met.
* Dependencies from pom must override those specified in the build file
* Correct versions of dependencies must be ensured
* Project-references must be resolved inside the reactor, if possible.
* Generated code or resource must automatically be added to the POM (in-memory?)
* Msbuild targets should run in appropriate maven phase (not in validate!)
* Msbuild error-handling must

h3. Msbuild Default Lifecycle Draft

{color:red}red: changes to maven-compile-plugin lifecycle{color}
{color:green}green: msbuild concern{color}

*validate*
  - NPanday Plugins : maven-compile-plugin : initialize {color:red}Necessary?: 
runs {{{assemblyResolver.resolveTransitivelyFor}}} and 
{{{assemblerContext.init}}}{color}
  - NPanday Plugins : maven-resolver-plugin : resolve
  - NPanday Plugins : NPanday.Plugin.Settings.JavaBinding : generate-settings
  - {color:green}NPanday Plugins : msbuild-maven-plugin : initialize (finds the 
MSBuild file and validates that msbuild is available?){color}
  - {color:green}NPanday Plugins : msbuild-maven-plugin : shaddow (creates 
msbuild-file and figures out parametrization){color}
  - {color:green}NPanday Plugins : msbuild-maven-plugin : shaddow-test (creates 
msbuild-file for testing and figures out parametrization){color}

*on generate-sources*
  - {color:red}-NPanday Plugins : maven-compile-plugin : 
generate-assembly-info-{color:red}

*on process-sources*
  - {color:red}-NPanday Plugins : maven-compile-plugin : process-sources-{color}
  - {color:red}-NPanday Plugins : maven-compile-plugin : 
process-test-sources-{color}
  - {color:green}NPanday Plugins : msbuild-maven-plugin : shadow-assembly-info 
(should share code with generate-assembly-info){color}

*on process-resources*
  - NPanday Plugins : maven-resgen-plugin : copy-resources {color:red}Should 
this still be supported?{color}
  - NPanday Plugins : maven-resgen-plugin : generate
  - NPanday Plugins : maven-resgen-plugin : generate-existing-resx-to-resource

*on compile*
  - {color:red}-NPanday Plugins : maven-compile-plugin : compile-{color}
  - {color:green}NPanday Plugins : msbuild-maven-plugin : build{color}

*on test-compile*
  - {color:red}-NPanday Plugins : maven-compile-plugin : testCompile-{color}
  - {color:green}NPanday Plugins : msbuild-maven-plugin : testBuild{color}

*on test*
  - NPanday Plugins : maven-test-plugin : test

{color:green}*verify*{color}
  - {color:green}NPanday Plugins : msbuild-maven-plugin : verify (Make sure the 
main artifact was generated by msbuild){color}

*on install*
  - NPanday Plugins : maven-repository-plugin : convert-artifact
  - NPanday Plugins : maven-install-plugin : install
  - Maven Plugins : maven-install-plugin : install

*on deploy*
  - Maven Plugins : maven-deploy-plugin : deploy

    
> Implement integrated XBuild/MSBuild lifecycle (superseeds current MSBuild 
> integration)
> --------------------------------------------------------------------------------------
>
>                 Key: NPANDAY-486
>                 URL: https://issues.apache.org/jira/browse/NPANDAY-486
>             Project: NPanday
>          Issue Type: New Feature
>          Components: Maven Plugins
>    Affects Versions: 1.4-incubating
>         Environment: Windows/.NET: MSBuild; Mono: Xbuild
>            Reporter: Lars Corneliussen
>            Assignee: Lars Corneliussen
>
> The current MSBuild integration is a hack. It was initially implemented as a 
> dotnet-maven-plugin, but now also the Java binding has been forked from the 
> originally generated source.
> h2. How it works now
> In order to "activate" MSBuild, the plugin 
> {{{NPanday.Plugin.Msbuild.JavaBinding}}} must be configured:
> {code}
> <plugin>
> <groupId>org.apache.npanday.plugins</groupId>
> <artifactId>NPanday.Plugin.Msbuild.JavaBinding</artifactId>
>   <executions>
>     <execution>
>       <goals>
>         <goal>compile</goal>
>       </goals>
>     </execution>
>   </executions>
> </plugin>
> {code}
> Also currently, code generated by MSBuild seems to have to be included 
> manually!
> {code:title=from NPANDAY_328_VS2010WpfProjectSupportTest}
> ...
> <includeSource>obj\x86\Debug\App.g.cs</includeSource>
> ...
> {code}
> It registers MsbuildMojo.java to the validate-phase, which performs these 
> steps: 
> * preExecute: If {{{copyDependencies}}} is {{{true}}} (is true by default), 
> it will copy all dependencies of the current project to (!) 
> {{{basedir/bin/Debug}}}
> * preExecute: Then it adds all *.resource-files from (!) {{{obj/Debug}}} to 
> project resources (using {{{project.addResource}}}
> ** (?) How can it even know theese, before having executed msbuild? Looks 
> like this won't have any effect, before the second build runs.
> * Execute: Calls into {{{MsbuildMojo.cs}}}
> ** Searches for {{{projectName.csproj/vbproj}}}
> ** Runs with: {{{/v:q /p:BuildProjectReferences=false 
> /p:BuildingInsideVisualStudio=true}}}
> ** Deletes
> h2. How it should work
> This is still to be figured out. Let's collect some requirements:
> h3. Functional Requirements (high-level)
> * It must be possible to compile WPF-projects (with Xaml-files)
> * any more?
> h3. Conditions / Design Decisions
> * The Maven principle of reproducible builds must be met.
> * Dependencies from pom must override those specified in the build file
> * Correct versions of dependencies must be ensured
> * Project-references must be resolved inside the reactor, if possible.
> * Generated code or resource must automatically be added to the POM 
> (in-memory?)
> * Msbuild targets should run in appropriate maven phase (not in validate!)
> * Msbuild error-handling must
> h3. Msbuild Default Lifecycle Draft
> {color:red}red: changes to maven-compile-plugin lifecycle{color}
> {color:green}green: msbuild concern{color}
> *validate*
>   - NPanday Plugins : maven-compile-plugin : initialize 
> {color:red}Necessary?: runs {{{assemblyResolver.resolveTransitivelyFor}}} and 
> {{{assemblerContext.init}}}{color}
>   - NPanday Plugins : maven-resolver-plugin : resolve
>   - NPanday Plugins : NPanday.Plugin.Settings.JavaBinding : generate-settings
>   - {color:green}NPanday Plugins : msbuild-maven-plugin : initialize (finds 
> the MSBuild file and validates that msbuild is available?){color}
>   - {color:green}NPanday Plugins : msbuild-maven-plugin : *shaddow* (creates 
> msbuild-file, overrides dependencies and output; figures out 
> parametrization){color}
>   - {color:green}NPanday Plugins : msbuild-maven-plugin : *shaddow-test* 
> (creates msbuild-file for testing and figures out parametrization){color}
> *on generate-sources*
>   - {color:red}-NPanday Plugins : maven-compile-plugin : 
> generate-assembly-info-{color}
> *on process-sources*
>   - {color:red}-NPanday Plugins : maven-compile-plugin : 
> process-sources-{color}
>   - {color:red}-NPanday Plugins : maven-compile-plugin : 
> process-test-sources-{color}
>   - {color:green}NPanday Plugins : msbuild-maven-plugin : 
> *shadow-assembly-info* (should share code with generate-assembly-info){color}
> *on process-resources*
>   - NPanday Plugins : maven-resgen-plugin : copy-resources {color:red}Should 
> this still be supported?{color}
>   - NPanday Plugins : maven-resgen-plugin : generate
>   - NPanday Plugins : maven-resgen-plugin : generate-existing-resx-to-resource
> *on compile*
>   - {color:red}-NPanday Plugins : maven-compile-plugin : compile-{color}
>   - {color:green}NPanday Plugins : msbuild-maven-plugin : *build*{color}
> *on test-compile*
>   - {color:red}-NPanday Plugins : maven-compile-plugin : testCompile-{color}
>   - {color:green}NPanday Plugins : msbuild-maven-plugin : *testBuild*{color}
> *on test*
>   - NPanday Plugins : maven-test-plugin : test
> {color:green}*verify*{color}
>   - {color:green}NPanday Plugins : msbuild-maven-plugin : *verify* (Make sure 
> the main artifact was generated by msbuild){color}
> *on install*
>   - NPanday Plugins : maven-repository-plugin : convert-artifact
>   - NPanday Plugins : maven-install-plugin : install
>   - Maven Plugins : maven-install-plugin : install
> *on deploy*
>   - Maven Plugins : maven-deploy-plugin : deploy

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to