[ https://issues.apache.org/jira/browse/NPANDAY-486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lars Corneliussen updated NPANDAY-486: -------------------------------------- Fix Version/s: 1.5.0-incubating > 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 > Fix For: 1.5.0-incubating > > > The current MSBuild integration is a hack initially implemented to support > WPF projects (XAML code- and resources-generation) > It was initially implemented as a dotnet-maven-plugin, but now also the Java > binding has been forked from the originally generated source. Also, currently > sources are compiled twice; once via MSBuild and then later through NPanday. > h2. Functional Requirements (high-level) > * It must be possible to compile WPF-projects (with Xaml-files) > * It must be extensible though custom MSBuild > * any more? > h2. 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 the most appropriate maven phase > * MSBuild errors must be correctly reported > * (on) MSBuild-shadowing should be extensible (wildcard-include), means: > {{{target/msbuild/build.xml}}}, importing: > ** {{{use-generated-assembly-info.targets}}} > ** {{{override-output-paths.targets}}} > ** ... > * (on) We could suppress the actual C#/VB-compilation and all following > steps; then run msbuild in process-sources > ** hence: {{{skip-CoreCompile-and-following.targets}}} > h2. Two MSBuild Lifecycles > Trying to figure out, how MSBuild can be integrated with the standard Maven > lifecycle. > {color:red}red: changes to maven-compile-plugin lifecycle{color} > {color:green}green: msbuild concern{color} > h3. Integrated MSBuild Lifecycle Draft > This would run MSBuild up until short before compilation (CSC/VBC). > Generation of the final artifacts are then still left to NPanday. > Means more control, but could mean less compatibility. > *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} > *on generate-sources* > - {color:green}NPanday Plugins : msbuild-maven-plugin : *shaddow* (creates > msbuild-file, figures out parametrization){color} > -- {color:green}Should find 'integrated' contributors (through plexus) and > execute all of them{color} > -- {color:green}Replace {{{CoreCompile}}} target and skip following > targets{color} > -- ?? > - {color:green}NPanday Plugins : msbuild-maven-plugin : > *run-integrated*{color} > -- {color:green}Runs all MSBuild targets up to CoreCompile{color} > -- {color:green}Includes dynamically added sources from @(Compile) to > build/sources (apply excludes afterwards!){color} > -- {color:green}Includes dynamically added resources from @(Compile) to > build/resources (apply excludes afterwards!){color} > - NPanday Plugins : maven-compile-plugin : generate-assembly-info > *on process-sources* > - NPanday Plugins : maven-compile-plugin : process-sources > - NPanday Plugins : maven-compile-plugin : process-test-sources > - {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 > - NPanday Plugins : maven-resgen-plugin : generate > - NPanday Plugins : maven-resgen-plugin : generate-existing-resx-to-resource > *on compile* > - NPanday Plugins : maven-compile-plugin : compile > *on test-compile* > - NPanday Plugins : maven-compile-plugin : testCompile > *on test* > - NPanday Plugins : maven-test-plugin : test > *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 > h3. Delegating MSBuild Lifecycle Draft > This would use MSBuild to actually create the final artifact. Means more > compatibility, but lesser control. > *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} > *on generate-sources* > - {color:red}-NPanday Plugins : maven-compile-plugin : > generate-assembly-info-{color} > - {color:green}NPanday Plugins : msbuild-maven-plugin : *shaddow* (creates > msbuild-file, figures out parametrization){color} > -- {color:green}should find 'standalone' concerns (through plexus) and > execute all of them{color} > -- {color:green}Replaces the previous AssemblyInfo with the new, generated, > one {color} > -- {color:green}Applies source and resource includes/excludes from pom to > MSBuild{color} > -- {color:green}override dependencies / project dependencies{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} > *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 : > *run-standalone*{color} > *on test-compile* > - {color:red}-NPanday Plugins : maven-compile-plugin : testCompile-{color} > - {color:green}NPanday Plugins : msbuild-maven-plugin : > *run-standalone-test*{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 > h2. Just for reference: Current MSBuild integration > 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 -- 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