You are viewing a plain text version of this content. The canonical link for it is here.
Posted to npanday-commits@incubator.apache.org by lc...@apache.org on 2012/01/16 21:47:33 UTC
svn commit: r1232177 [1/2] - in /incubator/npanday/trunk: ./ components/
components/dotnet-core/src/main/java/npanday/
components/dotnet-executable/src/main/java/npanday/executable/
components/dotnet-executable/src/main/java/npanday/executable/impl/ co...
Author: lcorneliussen
Date: Mon Jan 16 21:47:30 2012
New Revision: 1232177
URL: http://svn.apache.org/viewvc?rev=1232177&view=rev
Log:
[NPANDAY-493] Xml Document Transform (XDT) support for web and application packaging
Added:
incubator/npanday/trunk/components/dotnet-msbuild/
incubator/npanday/trunk/components/dotnet-msbuild/pom.xml
incubator/npanday/trunk/components/dotnet-msbuild/src/
incubator/npanday/trunk/components/dotnet-msbuild/src/main/
incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/
incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/
incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/
incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/MsbuildException.java
incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/MsbuildInvocationParameters.java
incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/MsbuildInvocationResult.java
incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/MsbuildInvoker.java
incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/xdt/
incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/xdt/XmlDocumentTransformException.java
incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/xdt/XmlDocumentTransformer.java
incubator/npanday/trunk/components/dotnet-msbuild/src/main/resources/
incubator/npanday/trunk/components/dotnet-msbuild/src/main/resources/META-INF/
incubator/npanday/trunk/components/dotnet-msbuild/src/main/resources/META-INF/npanday/
incubator/npanday/trunk/components/dotnet-msbuild/src/main/resources/META-INF/npanday/executable-plugins.xml
incubator/npanday/trunk/components/dotnet-msbuild/src/main/resources/META-INF/plexus/
incubator/npanday/trunk/components/dotnet-msbuild/src/main/resources/META-INF/plexus/components.xml
incubator/npanday/trunk/components/dotnet-msbuild/src/main/resources/msbuild/
incubator/npanday/trunk/components/dotnet-msbuild/src/main/resources/msbuild/xdt.msbuild.xml
incubator/npanday/trunk/components/dotnet-msbuild/src/test/
incubator/npanday/trunk/components/dotnet-msbuild/src/test/groovy/
incubator/npanday/trunk/plugins/application-maven-plugin/src/it/
incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT001_TransformAppConfig/
incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT001_TransformAppConfig/app.config
incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT001_TransformAppConfig/app.package.config
incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT001_TransformAppConfig/goals.txt
incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT001_TransformAppConfig/pom.xml
incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT001_TransformAppConfig/verify.groovy
incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT002_TransformFurtherConfigs/
incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT002_TransformFurtherConfigs/connectionStrings.config
incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT002_TransformFurtherConfigs/connectionStrings.package.config
incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT002_TransformFurtherConfigs/goals.txt
incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT002_TransformFurtherConfigs/pom.xml
incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT002_TransformFurtherConfigs/verify.groovy
incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT003_CopyAppConfig/
incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT003_CopyAppConfig/app.config
incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT003_CopyAppConfig/goals.txt
incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT003_CopyAppConfig/pom.xml
incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT003_CopyAppConfig/verify.groovy
incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/
incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/config.otherhint.xml
incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/config.package.xml
incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/config.xml
incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/excluded.xml
incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/goals.txt
incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/pom.xml
incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/verify.groovy
incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/AbstractNPandayMojo.java
- copied, changed from r1230518, incubator/npanday/trunk/plugins/azure-maven-plugin/src/main/java/npanday/plugin/azure/AbstractNPandayMojo.java
incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/AbstractNPandaySettingsAwareMojo.java
- copied, changed from r1230518, incubator/npanday/trunk/plugins/azure-maven-plugin/src/main/java/npanday/plugin/azure/AbstractNPandaySettingsAwareMojo.java
incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/PackagePreparedPackageFoldersMojo.java
- copied, changed from r1231089, incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/PackagePreparedPackageFolders.java
incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/ProcessAppConfigsMojo.java
- copied, changed from r1231089, incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/ProcessAppConfigMojo.java
incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/
incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/connectionStrings.config
incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/connectionStrings.package.config
incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/different_extension/
incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/different_extension/config.otherhint.xml
incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/different_extension/config.package.xml
incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/different_extension/config.xml
incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/different_extension/excluded.xml
incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/goals.txt
incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/pom.xml
incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/sublevel/
incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/sublevel/web.config
incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/sublevel/web.package.config
incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/verify.groovy
incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/web.config
incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/web.package.config
incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/AbstractNPandayMojo.java
incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/AbstractNPandaySettingsAwareMojo.java
incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/ProcessWebConfigsMojo.java
- copied, changed from r1231089, incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/ProcessWebConfigMojo.java
Removed:
incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/PackagePreparedPackageFolders.java
incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/ProcessAppConfigMojo.java
incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/ProcessWebConfigMojo.java
Modified:
incubator/npanday/trunk/components/dotnet-core/src/main/java/npanday/PathUtil.java
incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/ExecutableRequirement.java
incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/CapabilityMatcherImpl.java
incubator/npanday/trunk/components/dotnet-packaging/pom.xml
incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/packaging/ConfigFileHandler.java
incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/packaging/MixinAsssemblyReader.java
incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/VendorRequirement.java
incubator/npanday/trunk/components/pom.xml
incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Converter/Algorithms/ASPNetPomConverter.cs
incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Converter/Algorithms/AzureWorkerPomConverter.cs
incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/MvcApplication1/MvcApplication1/pom.test
incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/NPANDAY_480_AzureSupportOneWebRole/HelloWorld_WebRole/pom.test
incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/NPANDAY_480_CloudServiceWithMultipleRoles/HelloWorld_WebRole/pom.test
incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/NPANDAY_480_CloudServiceWithMultipleRoles/HelloWorld_WorkerRole/pom.test
incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/NPANDAY_480_CloudServiceWithWorkerRole/HelloWorld_WorkerRole/pom.test
incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/NPANDAY_488/NPANDAY_488_MSDeployPackageSimpleWebApp/pom.test
incubator/npanday/trunk/plugins/application-maven-plugin/pom.xml
incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/AssemblePackageFilesMojo.java
incubator/npanday/trunk/plugins/application-maven-plugin/src/site/apt/usage.apt.vm
incubator/npanday/trunk/plugins/aspnet-maven-plugin/pom.xml
incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/site/apt/usage.apt.vm
incubator/npanday/trunk/plugins/msdeploy-maven-plugin/src/main/java/npanday/plugin/msdeploy/MsDeployCreatePackageMojo.java
incubator/npanday/trunk/plugins/msdeploy-maven-plugin/src/site/apt/usage.apt.vm
incubator/npanday/trunk/plugins/pom.xml
incubator/npanday/trunk/plugins/wix-maven-plugin/pom.xml
incubator/npanday/trunk/pom.xml
incubator/npanday/trunk/site/src/site/apt/guide/advanced/application-packaging.apt.vm
Modified: incubator/npanday/trunk/components/dotnet-core/src/main/java/npanday/PathUtil.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-core/src/main/java/npanday/PathUtil.java?rev=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-core/src/main/java/npanday/PathUtil.java (original)
+++ incubator/npanday/trunk/components/dotnet-core/src/main/java/npanday/PathUtil.java Mon Jan 16 21:47:30 2012
@@ -19,6 +19,7 @@ package npanday;
* under the License.
*/
+import com.google.common.base.Preconditions;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
import org.apache.maven.project.MavenProject;
Modified: incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/ExecutableRequirement.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/ExecutableRequirement.java?rev=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/ExecutableRequirement.java (original)
+++ incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/ExecutableRequirement.java Mon Jan 16 21:47:30 2012
@@ -31,8 +31,8 @@ import npanday.vendor.VendorRequirement;
* @see CapabilityMatcher
*/
public class ExecutableRequirement
- extends VendorRequirement
{
+ private VendorRequirement vendor;
private String profile;
@@ -46,9 +46,7 @@ public class ExecutableRequirement
public ExecutableRequirement(
String vendorName, String vendorVersion, String frameworkVersion, String profile, String executableVersion )
{
- super( vendorName, vendorVersion, frameworkVersion );
- this.profile = profile;
- this.executableVersion = executableVersion;
+ this(new VendorRequirement( vendorName, vendorVersion, frameworkVersion ), profile, executableVersion);
}
public ExecutableRequirement( Vendor vendor, String vendorVersion, String frameworkVersion, String profile )
@@ -59,11 +57,25 @@ public class ExecutableRequirement
public ExecutableRequirement(
Vendor vendor, String vendorVersion, String frameworkVersion, String profile, String executableVersion )
{
- super( vendor, vendorVersion, frameworkVersion );
+ this(new VendorRequirement( vendor, vendorVersion, frameworkVersion ), profile, executableVersion);
+ }
+
+ public ExecutableRequirement( VendorRequirement vendor, String profile, String executableVersion )
+ {
+ this.vendor = vendor;
this.profile = profile;
this.executableVersion = executableVersion;
}
+ public ExecutableRequirement( VendorRequirement vendor, String identifier )
+ {
+ this(vendor, identifier, null);
+ }
+
+ public VendorRequirement getVendorRequirement(){
+ return vendor;
+ }
+
public String getProfile()
{
return profile;
Modified: incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/CapabilityMatcherImpl.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/CapabilityMatcherImpl.java?rev=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/CapabilityMatcherImpl.java (original)
+++ incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/CapabilityMatcherImpl.java Mon Jan 16 21:47:30 2012
@@ -30,6 +30,7 @@ import npanday.executable.compiler.Compi
import npanday.registry.RepositoryRegistry;
import npanday.vendor.StateMachineProcessor;
import npanday.vendor.VendorInfo;
+import npanday.vendor.VendorRequirement;
import org.codehaus.plexus.logging.AbstractLogEnabled;
import java.util.ArrayList;
@@ -72,7 +73,7 @@ public class CapabilityMatcherImpl
matchPolicies = new ArrayList<ExecutableMatchPolicy>();
}
- VendorInfo vendorInfo = matchVendorInfo(compilerRequirement);
+ VendorInfo vendorInfo = matchVendorInfo(compilerRequirement.getVendorRequirement());
if ( matchPolicies == null )
{
matchPolicies = new ArrayList<ExecutableMatchPolicy>();
@@ -121,7 +122,7 @@ public class CapabilityMatcherImpl
List<ExecutableMatchPolicy> matchPolicies )
throws PlatformUnsupportedException
{
- VendorInfo vendorInfo = matchVendorInfo(executableRequirement);
+ VendorInfo vendorInfo = matchVendorInfo(executableRequirement.getVendorRequirement());
if ( matchPolicies == null )
{
matchPolicies = new ArrayList<ExecutableMatchPolicy>();
@@ -171,7 +172,7 @@ public class CapabilityMatcherImpl
return matchingCapabilities.get( 0 );
}
- private VendorInfo matchVendorInfo(ExecutableRequirement executableRequirement)
+ private VendorInfo matchVendorInfo(VendorRequirement executableRequirement)
throws PlatformUnsupportedException
{
VendorInfo vendorInfo;
Added: incubator/npanday/trunk/components/dotnet-msbuild/pom.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-msbuild/pom.xml?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/components/dotnet-msbuild/pom.xml (added)
+++ incubator/npanday/trunk/components/dotnet-msbuild/pom.xml Mon Jan 16 21:47:30 2012
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.npanday</groupId>
+ <version>1.5.0-incubating-SNAPSHOT</version>
+ <artifactId>dotnet-components</artifactId>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>dotnet-msbuild</artifactId>
+ <name>NPanday :: MSBuild</name>
+ <description>Shared logic for executing MSBuild in the context of Mojos.</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.npanday</groupId>
+ <artifactId>dotnet-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.npanday</groupId>
+ <artifactId>dotnet-artifact</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.npanday</groupId>
+ <artifactId>dotnet-model-executable-plugins</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.npanday</groupId>
+ <artifactId>dotnet-model-compiler-plugins</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.npanday</groupId>
+ <artifactId>dotnet-executable</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.npanday</groupId>
+ <artifactId>dotnet-vendor</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-exec</artifactId>
+ <version>1.1</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <!-- enable groovy testing -->
+ <groupId>org.codehaus.gmaven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/MsbuildException.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/MsbuildException.java?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/MsbuildException.java (added)
+++ incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/MsbuildException.java Mon Jan 16 21:47:30 2012
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.msbuild;
+
+/**
+ * Something went wrong while instrumenting or executing MSBuild.
+ *
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ */
+public class MsbuildException
+ extends Exception
+{
+ public MsbuildException()
+ {
+ }
+
+ public MsbuildException( String message )
+ {
+ super( message );
+ }
+
+ public MsbuildException( String message, Throwable cause )
+ {
+ super( message, cause );
+ }
+
+ public MsbuildException( Throwable cause )
+ {
+ super( cause );
+ }
+}
Added: incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/MsbuildInvocationParameters.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/MsbuildInvocationParameters.java?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/MsbuildInvocationParameters.java (added)
+++ incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/MsbuildInvocationParameters.java Mon Jan 16 21:47:30 2012
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.msbuild;
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import npanday.vendor.VendorRequirement;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ */
+public class MsbuildInvocationParameters
+{
+ private VendorRequirement vendor;
+
+ private File file;
+
+ private Map<String, String> properties = Maps.newHashMap();
+
+ public MsbuildInvocationParameters(
+ VendorRequirement vendor, File file )
+ {
+ Preconditions.checkArgument( vendor != null, "vendor was null!" );
+ Preconditions.checkArgument( file != null, "file was null!" );
+
+ this.vendor = vendor;
+ this.file = file;
+ }
+
+ public void setProperty( String name, String value )
+ {
+ Preconditions.checkArgument( name != null, "name was null!" );
+ Preconditions.checkArgument( value != null, "value was null!" );
+
+ properties.put( name, value );
+ }
+
+ public VendorRequirement getVendorRequirement()
+ {
+ return vendor;
+ }
+
+ public Collection<String> buildCommands()
+ {
+ List<String> commands = Lists.newArrayList();
+
+ // TODO: support /target, /maxcpucount, /toolsversion, /verbosity
+
+ for ( Map.Entry<String, String> propEntry : properties.entrySet() )
+ {
+ commands.add( "/p:" + propEntry.getKey() + "=" + propEntry.getValue() );
+ }
+
+ commands.add( file.getAbsolutePath() );
+
+ return commands;
+ }
+}
Added: incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/MsbuildInvocationResult.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/MsbuildInvocationResult.java?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/MsbuildInvocationResult.java (added)
+++ incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/MsbuildInvocationResult.java Mon Jan 16 21:47:30 2012
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.msbuild;
+
+/**
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ */
+public class MsbuildInvocationResult
+{
+ // TODO: this should contain output parameters, as we get there.
+}
+
Added: incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/MsbuildInvoker.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/MsbuildInvoker.java?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/MsbuildInvoker.java (added)
+++ incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/MsbuildInvoker.java Mon Jan 16 21:47:30 2012
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.msbuild;
+
+import com.google.common.collect.Lists;
+import npanday.PlatformUnsupportedException;
+import npanday.executable.ExecutableRequirement;
+import npanday.executable.ExecutionException;
+import npanday.executable.NetExecutable;
+import npanday.executable.NetExecutableFactory;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ * @plexus.component role="npanday.msbuild.MsbuildInvoker"
+ */
+public class MsbuildInvoker
+{
+ /**
+ * @plexus.requirement
+ */
+ protected NetExecutableFactory netExecutableFactory;
+
+ public MsbuildInvocationResult invoke( MsbuildInvocationParameters parameters ) throws
+ PlatformUnsupportedException,
+ MsbuildException
+ {
+ final NetExecutable executable = netExecutableFactory.getNetExecutableFor(
+ new ExecutableRequirement(parameters.getVendorRequirement(), "MSBUILD"
+ ), buildCommands( parameters ), null
+ );
+
+ try
+ {
+ executable.execute();
+ }
+ catch ( ExecutionException e )
+ {
+ throw new MsbuildException("NPANDAY-135-000: Exception on executing MSBuild with " + parameters, e);
+ }
+
+ return new MsbuildInvocationResult();
+ }
+
+ private List<String> buildCommands( MsbuildInvocationParameters parameters )
+ {
+ List<String> commands = Lists.newArrayList();
+
+ // TODO: we could change this to use a response file
+ commands.addAll( parameters.buildCommands() );
+
+ return commands;
+ }
+}
Added: incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/xdt/XmlDocumentTransformException.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/xdt/XmlDocumentTransformException.java?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/xdt/XmlDocumentTransformException.java (added)
+++ incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/xdt/XmlDocumentTransformException.java Mon Jan 16 21:47:30 2012
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.msbuild.xdt;
+
+/**
+ * Something went wrong while trying to transform a document.
+ *
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ */
+public class XmlDocumentTransformException
+ extends Exception
+{
+ public XmlDocumentTransformException()
+ {
+ }
+
+ public XmlDocumentTransformException( String message )
+ {
+ super( message );
+ }
+
+ public XmlDocumentTransformException( String message, Throwable cause )
+ {
+ super( message, cause );
+ }
+
+ public XmlDocumentTransformException( Throwable cause )
+ {
+ super( cause );
+ }
+}
Added: incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/xdt/XmlDocumentTransformer.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/xdt/XmlDocumentTransformer.java?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/xdt/XmlDocumentTransformer.java (added)
+++ incubator/npanday/trunk/components/dotnet-msbuild/src/main/java/npanday/msbuild/xdt/XmlDocumentTransformer.java Mon Jan 16 21:47:30 2012
@@ -0,0 +1,127 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.msbuild.xdt;
+
+import com.google.common.base.Preconditions;
+import com.google.common.io.ByteStreams;
+import com.google.common.io.Files;
+import com.google.common.io.InputSupplier;
+import com.google.common.io.OutputSupplier;
+import com.google.common.io.Resources;
+import npanday.PlatformUnsupportedException;
+import npanday.msbuild.MsbuildException;
+import npanday.msbuild.MsbuildInvocationParameters;
+import npanday.msbuild.MsbuildInvoker;
+import npanday.vendor.VendorRequirement;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+/**
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ * @plexus.component role="npanday.msbuild.xdt.XmlDocumentTransformer"
+ */
+public class XmlDocumentTransformer
+{
+ /**
+ * @plexus.requirement
+ */
+ private MsbuildInvoker msbuild;
+
+ private File workingFolder;
+
+ /**
+ * There will be some need for temporary files; these will be stored in this folder.
+ *
+ * @param workingFolder
+ */
+ public void setWorkingFolder( File workingFolder )
+ {
+ this.workingFolder = workingFolder;
+ }
+
+ public void transform(
+ VendorRequirement vendorRequirement, File baseFile, File transformationFile, File targetFile ) throws
+ PlatformUnsupportedException, XmlDocumentTransformException
+ {
+ Preconditions.checkArgument( baseFile != null, "Argument 'baseFile' was null!" );
+ Preconditions.checkArgument( transformationFile != null, "Argument 'baseFile' was null!" );
+ Preconditions.checkArgument( targetFile != null, "Argument 'baseFile' was null!" );
+
+ Preconditions.checkNotNull( workingFolder, "tempFolder was not yet specified!" );
+
+ final String resourceName = "/msbuild/xdt.msbuild.xml";
+ final File buildFile;
+ try
+ {
+ buildFile = extractResource( resourceName );
+ }
+ catch ( IOException e )
+ {
+ throw new XmlDocumentTransformException(
+ "NPANDAY-136-001: Error when extracting build file from resources: " + resourceName, e
+ );
+ }
+
+ final MsbuildInvocationParameters parameters = new MsbuildInvocationParameters(
+ vendorRequirement, buildFile
+ );
+
+ parameters.setProperty( "Source", baseFile.getAbsolutePath() );
+ parameters.setProperty( "Transform", transformationFile.getAbsolutePath() );
+ parameters.setProperty( "Destination", targetFile.getAbsolutePath() );
+
+ targetFile.getParentFile().mkdirs();
+
+ try
+ {
+ msbuild.invoke( parameters );
+ }
+ catch ( MsbuildException e )
+ {
+ throw new XmlDocumentTransformException(
+ "NPANDAY-136-000: Error occured while trying to transform '" + baseFile.getName() + "' with "
+ + transformationFile.getName(), e
+ );
+ }
+ }
+
+ private File extractResource( String resourceName ) throws IOException
+ {
+ final URL resource = Resources.getResource( getClass(), resourceName );
+ final InputSupplier<InputStream> in = Resources.newInputStreamSupplier(
+ resource
+ );
+
+ final File outFile = new File( new File( workingFolder, "tmp" ), resourceName );
+ outFile.getParentFile().mkdirs();
+ outFile.createNewFile();
+ final OutputSupplier<FileOutputStream> out = Files.newOutputStreamSupplier(
+ outFile
+ );
+
+ ByteStreams.copy( in, out );
+
+ return outFile;
+ }
+}
Added: incubator/npanday/trunk/components/dotnet-msbuild/src/main/resources/META-INF/npanday/executable-plugins.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-msbuild/src/main/resources/META-INF/npanday/executable-plugins.xml?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/components/dotnet-msbuild/src/main/resources/META-INF/npanday/executable-plugins.xml (added)
+++ incubator/npanday/trunk/components/dotnet-msbuild/src/main/resources/META-INF/npanday/executable-plugins.xml Mon Jan 16 21:47:30 2012
@@ -0,0 +1,36 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<executablePlugins>
+ <executablePlugin>
+ <profile>MSBUILD</profile>
+ <pluginClass>npanday.executable.impl.DefaultNetExecutable</pluginClass>
+ <vendor>MICROSOFT</vendor>
+ <executable>msbuild</executable>
+ <frameworkVersions>
+ <frameworkVersion>4.0</frameworkVersion>
+ <frameworkVersion>3.5</frameworkVersion>
+ <frameworkVersion>2.0.50727</frameworkVersion>
+ </frameworkVersions>
+ <platforms>
+ <platform>
+ <operatingSystem>Windows</operatingSystem>
+ </platform>
+ </platforms>
+ </executablePlugin>
+</executablePlugins>
Added: incubator/npanday/trunk/components/dotnet-msbuild/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-msbuild/src/main/resources/META-INF/plexus/components.xml?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/components/dotnet-msbuild/src/main/resources/META-INF/plexus/components.xml (added)
+++ incubator/npanday/trunk/components/dotnet-msbuild/src/main/resources/META-INF/plexus/components.xml Mon Jan 16 21:47:30 2012
@@ -0,0 +1,23 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<component-set>
+ <components>
+ <!-- created through annotations -->
+ </components>
+</component-set>
Added: incubator/npanday/trunk/components/dotnet-msbuild/src/main/resources/msbuild/xdt.msbuild.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-msbuild/src/main/resources/msbuild/xdt.msbuild.xml?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/components/dotnet-msbuild/src/main/resources/msbuild/xdt.msbuild.xml (added)
+++ incubator/npanday/trunk/components/dotnet-msbuild/src/main/resources/msbuild/xdt.msbuild.xml Mon Jan 16 21:47:30 2012
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0" DefaultTargets="Transform">
+ <UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll"/>
+
+ <!--
+ Input Parameters:
+ - Source
+ - Transform
+ - Destination
+ -->
+
+ <Target Name="Transform">
+ <TransformXml Source="$(Source)" Transform="$(Transform)" Destination="$(Destination)"/>
+ </Target>
+</Project>
\ No newline at end of file
Modified: incubator/npanday/trunk/components/dotnet-packaging/pom.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-packaging/pom.xml?rev=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-packaging/pom.xml (original)
+++ incubator/npanday/trunk/components/dotnet-packaging/pom.xml Mon Jan 16 21:47:30 2012
@@ -36,6 +36,10 @@
<artifactId>dotnet-core</artifactId>
</dependency>
<dependency>
+ <groupId>org.apache.npanday</groupId>
+ <artifactId>dotnet-msbuild</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
Modified: incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/packaging/ConfigFileHandler.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/packaging/ConfigFileHandler.java?rev=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/packaging/ConfigFileHandler.java (original)
+++ incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/packaging/ConfigFileHandler.java Mon Jan 16 21:47:30 2012
@@ -19,43 +19,204 @@
package npanday.packaging;
+import com.google.common.base.Joiner;
+import com.google.common.base.Splitter;
+import com.google.common.collect.Lists;
+import npanday.PlatformUnsupportedException;
+import npanday.msbuild.xdt.XmlDocumentTransformException;
+import npanday.msbuild.xdt.XmlDocumentTransformer;
+import npanday.vendor.VendorRequirement;
import org.apache.maven.plugin.MojoFailureException;
import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.util.DirectoryScanner;
import org.codehaus.plexus.util.FileUtils;
import java.io.File;
import java.io.IOException;
+import java.util.List;
/**
- * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ * Common configuration file handling for the various packaging formats/mojos.
*
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
* @plexus.component role="npanday.packaging.ConfigFileHandler"
*/
public class ConfigFileHandler
extends AbstractLogEnabled
{
- public void handleConfigFile( File sourceConfigFile, File targetConfigFile ) throws MojoFailureException
+ public static final String[] DEFAULT_EXCLUDES = new String[]{ "pom.xml" };
+
+ /**
+ * @plexus.requirement
+ */
+ private XmlDocumentTransformer xdt;
+
+ private File workingFolder;
+
+ public void setWorkingFolder( File workingFolder )
{
+ this.workingFolder = workingFolder;
+ }
+
+ /**
+ * Will either transform or copy the selected config file.
+ */
+ public void handleConfigFile(
+ VendorRequirement vendorRequirement, File sourceConfigFile, String transformationHint, File targetConfigFile ) throws MojoFailureException
+ {
+ xdt.setWorkingFolder(workingFolder);
+
if ( !sourceConfigFile.exists() )
{
getLogger().warn( "NPANDAY-133-001: The configuration file '" + sourceConfigFile + "' couldn't be found" );
return;
}
- // TODO: add XDT-support here
+ File transformationFile = null;
- getLogger().info( "NPANDAY-133-004: Transforming/copying config file for packaging" );
+ final String sourceConfigFileName = sourceConfigFile.getName();
- try
+ if ( transformationHint != null )
{
- getLogger().debug( "NPANDAY-133-002: Copying config file '" + sourceConfigFile + "' to '" + targetConfigFile + "'" );
- FileUtils.copyFile( sourceConfigFile, targetConfigFile );
+ int extensionStart = sourceConfigFileName.lastIndexOf( "." );
+ String transformationFileName =
+ sourceConfigFileName.substring( 0, extensionStart ) + "." + transformationHint
+ + sourceConfigFileName.substring( extensionStart );
+
+ final File probingFile = new File( sourceConfigFile.getParentFile(), transformationFileName );
+ if ( probingFile.exists() )
+ {
+ getLogger().debug(
+ "NPANDAY-133-006: Found transformation file for " + sourceConfigFileName + ": "
+ + probingFile.getAbsolutePath()
+ );
+
+ transformationFile = probingFile;
+ }
+ else
+ {
+ getLogger().warn(
+ "NPANDAY-133-007: Could not find transformation file for " + sourceConfigFileName + "; tried: "
+ + probingFile.getAbsolutePath()
+ );
+ }
}
- catch ( IOException e )
+
+ if ( transformationFile != null )
+ {
+ getLogger().info(
+ "NPANDAY-133-004: Transforming " + sourceConfigFileName + " with " + transformationFile
+ + " for packaging"
+ );
+
+ try
+ {
+ getLogger().debug(
+ "NPANDAY-133-002: Copying config file '" + sourceConfigFile + "' to '" + targetConfigFile + "'"
+ );
+ xdt.transform( vendorRequirement, sourceConfigFile, transformationFile, targetConfigFile );
+ }
+ catch ( PlatformUnsupportedException e )
+ {
+ throw new MojoFailureException(
+ "NPANDAY-133-008: Unable to transform config file '" + sourceConfigFile + "'", e
+ );
+ }
+ catch ( XmlDocumentTransformException e )
+ {
+ throw new MojoFailureException(
+ "NPANDAY-133-009: Unable to transform config file '" + sourceConfigFile + "'", e
+ );
+ }
+ }
+ else
+ {
+ getLogger().info( "NPANDAY-133-005: Copying " + sourceConfigFileName + " for packaging" );
+
+ try
+ {
+ getLogger().debug(
+ "NPANDAY-133-010: Copying config file '" + sourceConfigFile + "' to '" + targetConfigFile + "'"
+ );
+ FileUtils.copyFile( sourceConfigFile, targetConfigFile );
+ }
+ catch ( IOException e )
+ {
+ throw new MojoFailureException(
+ "NPANDAY-133-011: Unable to copy config file '" + sourceConfigFile + "' to '" + targetConfigFile
+ + "'"
+ );
+ }
+ }
+ }
+
+ public void handleConfigFiles(
+ VendorRequirement vendorRequirement, File baseDir, String[] includes, String[] excludes, String transformationHint, File targetFolder ) throws
+ MojoFailureException
+ {
+ DirectoryScanner scanner = new DirectoryScanner();
+ scanner.setBasedir( baseDir );
+ scanner.setIncludes( includes );
+
+ List<String> excludesList = Lists.newArrayList(excludes);
+ excludesList.addAll( Lists.newArrayList( DEFAULT_EXCLUDES ) );
+ scanner.setExcludes( excludesList.toArray( new String[0] ) );
+
+ getLogger().debug(
+ "NPANDAY-133-012: Config file includes: " + Lists.newArrayList( includes )
+ );
+ getLogger().debug(
+ "NPANDAY-133-013: Config file excludes: " + excludes
+ );
+
+ scanner.scan();
+
+ for ( String configFilePath : scanner.getIncludedFiles() )
{
- throw new MojoFailureException(
- "NPANDAY-133-003: Unable to copy config file '" + sourceConfigFile + "' to '" + targetConfigFile + "'"
+ File configFile = new File( configFilePath );
+
+
+ if ( isTransformationFile( configFile ) )
+ {
+ getLogger().debug(
+ "NPANDAY-133-014: Skipped file, because it seems to be a transformation: "
+ + configFile.getName()
+ );
+ continue;
+ }
+
+ final File targetConfigFile = new File( targetFolder, relativize(configFile, baseDir) );
+
+ handleConfigFile(
+ vendorRequirement, configFile, transformationHint, targetConfigFile
);
}
}
+
+ private String relativize( File file, File base )
+ {
+ return base.toURI().relativize(file.toURI()).getPath();
+ }
+
+ private Splitter SPLIT_ON_DOTS = Splitter.on( '.' );
+ private Joiner JOIN_WITH_DOTS = Joiner.on( '.' );
+
+
+ public boolean isTransformationFile( File filePath )
+ {
+ String fileName = filePath.getName();
+ List<String> parts = Lists.newArrayList( SPLIT_ON_DOTS.split( fileName ) );
+
+ if (parts.size() < 3)
+ return false;
+
+ // remove the transformation hint between name and extension
+ parts.remove( parts.size()-2 );
+
+ // and check if a target file exists
+ if (new File( filePath.getParent(), JOIN_WITH_DOTS.join( parts ) ).exists())
+ return true;
+
+ return false;
+ }
}
Modified: incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/packaging/MixinAsssemblyReader.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/packaging/MixinAsssemblyReader.java?rev=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/packaging/MixinAsssemblyReader.java (original)
+++ incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/packaging/MixinAsssemblyReader.java Mon Jan 16 21:47:30 2012
@@ -28,10 +28,10 @@ import java.io.File;
/**
* @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
- *
* @plexus.component role="npanday.packaging.MixinAsssemblyReader"
*/
-public class MixinAsssemblyReader extends DefaultAssemblyReader
+public class MixinAsssemblyReader
+ extends DefaultAssemblyReader
{
private String[] componentDescriptors;
@@ -46,14 +46,14 @@ public class MixinAsssemblyReader extend
*
*/
@Override
- protected void mergeComponentsWithMainAssembly( Assembly assembly, File assemblyDir,
- AssemblerConfigurationSource configSource )
- throws AssemblyReadException
+ protected void mergeComponentsWithMainAssembly(
+ Assembly assembly, File assemblyDir, AssemblerConfigurationSource configSource ) throws AssemblyReadException
{
appendComponentDescriptors( assembly );
- super.mergeComponentsWithMainAssembly( assembly, assemblyDir,
- configSource ); //To change body of overridden methods use File | Settings | File Templates.
+ super.mergeComponentsWithMainAssembly(
+ assembly, assemblyDir, configSource
+ ); //To change body of overridden methods use File | Settings | File Templates.
}
/**
@@ -61,8 +61,12 @@ public class MixinAsssemblyReader extend
*/
protected void appendComponentDescriptors( Assembly assembly )
{
- for (String componentDescriptor : componentDescriptors){
- getLogger().debug( "NPANDAY-110-001: Mixing in component descriptor '" + componentDescriptor + "' to assembly with id '" + assembly.getId() + "'.");
+ for ( String componentDescriptor : componentDescriptors )
+ {
+ getLogger().debug(
+ "NPANDAY-110-001: Mixing in component descriptor '" + componentDescriptor + "' to assembly with id '"
+ + assembly.getId() + "'."
+ );
assembly.addComponentDescriptor( componentDescriptor );
}
}
Modified: incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/VendorRequirement.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/VendorRequirement.java?rev=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/VendorRequirement.java (original)
+++ incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/VendorRequirement.java Mon Jan 16 21:47:30 2012
@@ -130,6 +130,10 @@ public class VendorRequirement
return vendor != null && vendorVersion != null && frameworkVersion != null;
}
+ public VendorRequirement clone(){
+ return new VendorRequirement( vendor, vendorVersion, frameworkVersion);
+ }
+
public String toString()
{
return "[" + getClass().getSimpleName() + " for vendor " + visibleNullString( vendor ) + " version "
Modified: incubator/npanday/trunk/components/pom.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/pom.xml?rev=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/components/pom.xml (original)
+++ incubator/npanday/trunk/components/pom.xml Mon Jan 16 21:47:30 2012
@@ -42,6 +42,7 @@
<module>dotnet-registry</module>
<module>dotnet-vendor</module>
<module>dotnet-packaging</module>
+ <module>dotnet-msbuild</module>
</modules>
<dependencies>
<dependency>
Modified: incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Converter/Algorithms/ASPNetPomConverter.cs
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Converter/Algorithms/ASPNetPomConverter.cs?rev=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Converter/Algorithms/ASPNetPomConverter.cs (original)
+++ incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Converter/Algorithms/ASPNetPomConverter.cs Mon Jan 16 21:47:30 2012
@@ -40,20 +40,13 @@ namespace NPanday.ProjectImporter.Conver
List<string> goals = new List<string>();
goals.Add("assemble-package-files");
- goals.Add("process-web-config");
+ goals.Add("process-configs");
Plugin aspnetPlugin = AddPlugin("org.apache.npanday.plugins", "aspnet-maven-plugin", null, false);
AddPluginExecution(aspnetPlugin, "prepare-package", goals.ToArray(), null);
- if (!string.IsNullOrEmpty(projectDigest.WebConfig))
- {
- AddPluginConfiguration(aspnetPlugin, "webConfig", "Web." + projectDigest.WebConfig + ".config");
- }
- else
- {
- // TODO: until XDT works, just use Web.config itself
- AddPluginConfiguration(aspnetPlugin, "webConfig", "Web.config");
- }
+ // TODO: make it optional to configure "release" instead of "package" here
+ // Maybe set transformationHint to projectDigest.WebConfig???
Plugin msdeployPlugin = AddPlugin("org.apache.npanday.plugins", "msdeploy-maven-plugin", null, false);
AddPluginExecution(msdeployPlugin, "create-msdeploy-package", new string[] { "create-package" }, null);
Modified: incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Converter/Algorithms/AzureWorkerPomConverter.cs
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Converter/Algorithms/AzureWorkerPomConverter.cs?rev=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Converter/Algorithms/AzureWorkerPomConverter.cs (original)
+++ incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Converter/Algorithms/AzureWorkerPomConverter.cs Mon Jan 16 21:47:30 2012
@@ -40,15 +40,12 @@ namespace NPanday.ProjectImporter.Conver
List<string> goals = new List<string>();
goals.Add("assemble-package-files");
- goals.Add("process-app-config");
- goals.Add("package");
+ goals.Add("process-configs");
+ goals.Add("create-package");
Plugin plugin = AddPlugin("org.apache.npanday.plugins", "application-maven-plugin", null, false);
AddPluginExecution(plugin, "package-application", goals.ToArray(), null);
- // TODO: until XDT works, just use Web.config itself
- AddPluginConfiguration(plugin, "appConfig", "app.config");
-
if (writePom)
{
PomHelperUtility.WriteModelToPom(new FileInfo(Path.GetDirectoryName(projectDigest.FullFileName) + @"\pom.xml"), Model);
Modified: incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/MvcApplication1/MvcApplication1/pom.test
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/MvcApplication1/MvcApplication1/pom.test?rev=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/MvcApplication1/MvcApplication1/pom.test (original)
+++ incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/MvcApplication1/MvcApplication1/pom.test Mon Jan 16 21:47:30 2012
@@ -33,13 +33,10 @@
<id>prepare-package</id>
<goals>
<goal>assemble-package-files</goal>
- <goal>process-web-config</goal>
+ <goal>process-configs</goal>
</goals>
</execution>
</executions>
- <configuration>
- <webConfig>Web.config</webConfig>
- </configuration>
</plugin>
<plugin>
<groupId>org.apache.npanday.plugins</groupId>
Modified: incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/NPANDAY_480_AzureSupportOneWebRole/HelloWorld_WebRole/pom.test
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/NPANDAY_480_AzureSupportOneWebRole/HelloWorld_WebRole/pom.test?rev=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/NPANDAY_480_AzureSupportOneWebRole/HelloWorld_WebRole/pom.test (original)
+++ incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/NPANDAY_480_AzureSupportOneWebRole/HelloWorld_WebRole/pom.test Mon Jan 16 21:47:30 2012
@@ -33,13 +33,10 @@
<id>prepare-package</id>
<goals>
<goal>assemble-package-files</goal>
- <goal>process-web-config</goal>
+ <goal>process-configs</goal>
</goals>
</execution>
</executions>
- <configuration>
- <webConfig>Web.config</webConfig>
- </configuration>
</plugin>
<plugin>
<groupId>org.apache.npanday.plugins</groupId>
Modified: incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/NPANDAY_480_CloudServiceWithMultipleRoles/HelloWorld_WebRole/pom.test
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/NPANDAY_480_CloudServiceWithMultipleRoles/HelloWorld_WebRole/pom.test?rev=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/NPANDAY_480_CloudServiceWithMultipleRoles/HelloWorld_WebRole/pom.test (original)
+++ incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/NPANDAY_480_CloudServiceWithMultipleRoles/HelloWorld_WebRole/pom.test Mon Jan 16 21:47:30 2012
@@ -33,13 +33,10 @@
<id>prepare-package</id>
<goals>
<goal>assemble-package-files</goal>
- <goal>process-web-config</goal>
+ <goal>process-configs</goal>
</goals>
</execution>
</executions>
- <configuration>
- <webConfig>Web.config</webConfig>
- </configuration>
</plugin>
<plugin>
<groupId>org.apache.npanday.plugins</groupId>
Modified: incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/NPANDAY_480_CloudServiceWithMultipleRoles/HelloWorld_WorkerRole/pom.test
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/NPANDAY_480_CloudServiceWithMultipleRoles/HelloWorld_WorkerRole/pom.test?rev=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/NPANDAY_480_CloudServiceWithMultipleRoles/HelloWorld_WorkerRole/pom.test (original)
+++ incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/NPANDAY_480_CloudServiceWithMultipleRoles/HelloWorld_WorkerRole/pom.test Mon Jan 16 21:47:30 2012
@@ -33,14 +33,11 @@
<id>package-application</id>
<goals>
<goal>assemble-package-files</goal>
- <goal>process-app-config</goal>
- <goal>package</goal>
+ <goal>process-configs</goal>
+ <goal>create-package</goal>
</goals>
</execution>
</executions>
- <configuration>
- <appConfig>app.config</appConfig>
- </configuration>
</plugin>
</plugins>
</build>
Modified: incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/NPANDAY_480_CloudServiceWithWorkerRole/HelloWorld_WorkerRole/pom.test
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/NPANDAY_480_CloudServiceWithWorkerRole/HelloWorld_WorkerRole/pom.test?rev=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/NPANDAY_480_CloudServiceWithWorkerRole/HelloWorld_WorkerRole/pom.test (original)
+++ incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/NPANDAY_480_CloudServiceWithWorkerRole/HelloWorld_WorkerRole/pom.test Mon Jan 16 21:47:30 2012
@@ -33,14 +33,11 @@
<id>package-application</id>
<goals>
<goal>assemble-package-files</goal>
- <goal>process-app-config</goal>
- <goal>package</goal>
+ <goal>process-configs</goal>
+ <goal>create-package</goal>
</goals>
</execution>
</executions>
- <configuration>
- <appConfig>app.config</appConfig>
- </configuration>
</plugin>
</plugins>
</build>
Modified: incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/NPANDAY_488/NPANDAY_488_MSDeployPackageSimpleWebApp/pom.test
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/NPANDAY_488/NPANDAY_488_MSDeployPackageSimpleWebApp/pom.test?rev=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/NPANDAY_488/NPANDAY_488_MSDeployPackageSimpleWebApp/pom.test (original)
+++ incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/resource/NPANDAY_488/NPANDAY_488_MSDeployPackageSimpleWebApp/pom.test Mon Jan 16 21:47:30 2012
@@ -33,13 +33,10 @@
<id>prepare-package</id>
<goals>
<goal>assemble-package-files</goal>
- <goal>process-web-config</goal>
+ <goal>process-configs</goal>
</goals>
</execution>
</executions>
- <configuration>
- <webConfig>Web.config</webConfig>
- </configuration>
</plugin>
<plugin>
<groupId>org.apache.npanday.plugins</groupId>
Modified: incubator/npanday/trunk/plugins/application-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/pom.xml?rev=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/pom.xml (original)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/pom.xml Mon Jan 16 21:47:30 2012
@@ -68,38 +68,4 @@
</plugins>
</pluginManagement>
</build>
-
- <profiles>
- <profile>
- <id>run-its</id>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-invoker-plugin</artifactId>
- <version>1.5</version>
- <configuration>
- <projectsDirectory>src/it</projectsDirectory>
- <cloneProjectsTo>target/it</cloneProjectsTo>
- <pomIncludes>
- <pomInclude>*/pom.xml</pomInclude>
- </pomIncludes>
- <!-- Can't use localRepositoryPath or -Dmaven.repo.local with NPanday
- See https://issues.apache.org/jira/browse/NPANDAY-284
- <localRepositoryPath>target/local-repo</localRepositoryPath> -->
- <postBuildHookScript>verify</postBuildHookScript>
- </configuration>
- <executions>
- <execution>
- <id>integration-test</id>
- <goals>
- <goal>install</goal>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
</project>
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT001_TransformAppConfig/app.config
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT001_TransformAppConfig/app.config?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT001_TransformAppConfig/app.config (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT001_TransformAppConfig/app.config Mon Jan 16 21:47:30 2012
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<configuration>
+ <connectionStrings>
+ <add name="name" connectionString="original"/>
+ </connectionStrings>
+</configuration>
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT001_TransformAppConfig/app.package.config
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT001_TransformAppConfig/app.package.config?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT001_TransformAppConfig/app.package.config (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT001_TransformAppConfig/app.package.config Mon Jan 16 21:47:30 2012
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
+ <connectionStrings>
+ <add name="name"
+ connectionString="from-package-transform"
+
+ xdt:Transform="Replace"
+ xdt:Locator="Match(name)"/>
+ </connectionStrings>
+</configuration>
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT001_TransformAppConfig/goals.txt
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT001_TransformAppConfig/goals.txt?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT001_TransformAppConfig/goals.txt (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT001_TransformAppConfig/goals.txt Mon Jan 16 21:47:30 2012
@@ -0,0 +1 @@
+clean prepare-package
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT001_TransformAppConfig/pom.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT001_TransformAppConfig/pom.xml?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT001_TransformAppConfig/pom.xml (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT001_TransformAppConfig/pom.xml Mon Jan 16 21:47:30 2012
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>@project.groupId@.@project.artifactId@-its</groupId>
+ <artifactId>IT001_TransformAppConfig</artifactId>
+ <version>@project.version@</version>
+ <packaging>pom</packaging>
+
+ <properties>
+ <frameworkVersion>4.0</frameworkVersion>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>@project.groupId@</groupId>
+ <artifactId>@project.artifactId@</artifactId>
+ <version>@project.version@</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>process-configs</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT001_TransformAppConfig/verify.groovy
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT001_TransformAppConfig/verify.groovy?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT001_TransformAppConfig/verify.groovy (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT001_TransformAppConfig/verify.groovy Mon Jan 16 21:47:30 2012
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+def packageDir = new File(basedir, "target\\packages\\IT001_TransformAppConfig")
+assert packageDir.exists()
+
+// is null.config, because it is neither dll or exe, but pom
+def configFile = new File(packageDir, "IT001_TransformAppConfig.null.config")
+assert configFile.exists();
+
+def xml = new XmlSlurper().parse(configFile)
+assert xml.connectionStrings[0].add[0].@connectionString == "from-package-transform"
+
+assert !new File(packageDir, "app.package.config").exists()
+assert !new File(packageDir, "app.config").exists()
+
+return true;
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT002_TransformFurtherConfigs/connectionStrings.config
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT002_TransformFurtherConfigs/connectionStrings.config?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT002_TransformFurtherConfigs/connectionStrings.config (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT002_TransformFurtherConfigs/connectionStrings.config Mon Jan 16 21:47:30 2012
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<configuration>
+ <connectionStrings>
+ <add name="name" connectionString="original"/>
+ </connectionStrings>
+</configuration>
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT002_TransformFurtherConfigs/connectionStrings.package.config
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT002_TransformFurtherConfigs/connectionStrings.package.config?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT002_TransformFurtherConfigs/connectionStrings.package.config (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT002_TransformFurtherConfigs/connectionStrings.package.config Mon Jan 16 21:47:30 2012
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
+ <connectionStrings>
+ <add name="name"
+ connectionString="from-package-transform"
+
+ xdt:Transform="Replace"
+ xdt:Locator="Match(name)"/>
+ </connectionStrings>
+</configuration>
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT002_TransformFurtherConfigs/goals.txt
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT002_TransformFurtherConfigs/goals.txt?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT002_TransformFurtherConfigs/goals.txt (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT002_TransformFurtherConfigs/goals.txt Mon Jan 16 21:47:30 2012
@@ -0,0 +1 @@
+clean prepare-package
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT002_TransformFurtherConfigs/pom.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT002_TransformFurtherConfigs/pom.xml?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT002_TransformFurtherConfigs/pom.xml (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT002_TransformFurtherConfigs/pom.xml Mon Jan 16 21:47:30 2012
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>@project.groupId@.@project.artifactId@-its</groupId>
+ <artifactId>IT002_TransformFurtherConfigs</artifactId>
+ <version>@project.version@</version>
+ <packaging>pom</packaging>
+
+ <properties>
+ <frameworkVersion>4.0</frameworkVersion>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>@project.groupId@</groupId>
+ <artifactId>@project.artifactId@</artifactId>
+ <version>@project.version@</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>process-configs</goal>
+ </goals>
+ <configuration>
+ <configIncludes>
+ <include>*.config</include>
+ </configIncludes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT002_TransformFurtherConfigs/verify.groovy
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT002_TransformFurtherConfigs/verify.groovy?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT002_TransformFurtherConfigs/verify.groovy (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT002_TransformFurtherConfigs/verify.groovy Mon Jan 16 21:47:30 2012
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+
+
+def packageDir = new File(basedir, "target\\packages\\IT002_TransformFurtherConfigs")
+assert packageDir.exists()
+
+// is null.config, because it is neither dll or exe, but pom
+def configFile = new File(packageDir, "connectionStrings.config")
+assert configFile.exists();
+
+def xml = new XmlSlurper().parse(configFile)
+assert xml.connectionStrings[0].add[0].@connectionString == "from-package-transform"
+
+assert new File(packageDir, "connectionStrings.package.config").exists() == false
+
+return true;
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT003_CopyAppConfig/app.config
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT003_CopyAppConfig/app.config?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT003_CopyAppConfig/app.config (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT003_CopyAppConfig/app.config Mon Jan 16 21:47:30 2012
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<configuration>
+ <connectionStrings>
+ <add name="name" connectionString="original"/>
+ </connectionStrings>
+</configuration>