You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ju...@apache.org on 2010/10/17 18:30:17 UTC

svn commit: r1023522 - in /sling/trunk: ./ launchpad/builder/ launchpad/test-services-war/ launchpad/testing/ launchpad/testing/src/test/config/ launchpad/testing/src/test/rules/ maven/maven-launchpad-plugin/ parent/

Author: justin
Date: Sun Oct 17 16:30:16 2010
New Revision: 1023522

URL: http://svn.apache.org/viewvc?rev=1023522&view=rev
Log:
SLING-1803 - adding emma report. runs with -P emma

Added:
    sling/trunk/launchpad/testing/src/test/config/
    sling/trunk/launchpad/testing/src/test/config/sling.properties
    sling/trunk/launchpad/testing/src/test/rules/emma.drl
Modified:
    sling/trunk/.gitignore
    sling/trunk/launchpad/builder/pom.xml
    sling/trunk/launchpad/test-services-war/pom.xml
    sling/trunk/launchpad/testing/pom.xml
    sling/trunk/maven/maven-launchpad-plugin/pom.xml
    sling/trunk/parent/pom.xml

Modified: sling/trunk/.gitignore
URL: http://svn.apache.org/viewvc/sling/trunk/.gitignore?rev=1023522&r1=1023521&r2=1023522&view=diff
==============================================================================
--- sling/trunk/.gitignore (original)
+++ sling/trunk/.gitignore Sun Oct 17 16:30:16 2010
@@ -7,3 +7,6 @@ derby.log
 *.iml
 *.ipr
 *.iws
+coverage.em
+coverage.ec
+coverage/

Modified: sling/trunk/launchpad/builder/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/builder/pom.xml?rev=1023522&r1=1023521&r2=1023522&view=diff
==============================================================================
--- sling/trunk/launchpad/builder/pom.xml (original)
+++ sling/trunk/launchpad/builder/pom.xml Sun Oct 17 16:30:16 2010
@@ -74,7 +74,7 @@
             <plugin>
                 <groupId>org.apache.sling</groupId>
                 <artifactId>maven-launchpad-plugin</artifactId>
-                <version>2.0.5-SNAPSHOT</version>
+                <version>2.0.7-SNAPSHOT</version>
                 <executions>
                     <execution>
                         <id>prepare-package-war</id>
@@ -246,6 +246,15 @@
                     </preparationGoals>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>emma-maven-plugin</artifactId>
+                <configuration>
+                    <filters>
+                        <filter>-*</filter>
+                    </filters>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
     <reporting>

Modified: sling/trunk/launchpad/test-services-war/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services-war/pom.xml?rev=1023522&r1=1023521&r2=1023522&view=diff
==============================================================================
--- sling/trunk/launchpad/test-services-war/pom.xml (original)
+++ sling/trunk/launchpad/test-services-war/pom.xml Sun Oct 17 16:30:16 2010
@@ -60,6 +60,14 @@
                             <goal>manifest</goal>
                         </goals>
                     </execution>
+                    <execution>
+                        <id>emma-bundle</id>
+                        <configuration>
+                            <supportedProjectTypes>
+                                <supportedProjectType>bundle</supportedProjectType>
+                            </supportedProjectTypes>
+                        </configuration>
+                    </execution>
                 </executions>
                 <configuration>
                     <instructions>
@@ -92,6 +100,16 @@
                     </webResources>
                 </configuration>
             </plugin>
+
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>emma-maven-plugin</artifactId>
+                <configuration>
+                    <filters>
+                        <filter>-*</filter>
+                    </filters>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
     <dependencies>

Modified: sling/trunk/launchpad/testing/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/testing/pom.xml?rev=1023522&r1=1023521&r2=1023522&view=diff
==============================================================================
--- sling/trunk/launchpad/testing/pom.xml (original)
+++ sling/trunk/launchpad/testing/pom.xml Sun Oct 17 16:30:16 2010
@@ -92,6 +92,7 @@
                                 <include>cachedir</include>
                                 <include>sling</include>
                                 <include>jackrabbit</include>
+                                <include>coverage.ec</include>
                             </includes>
                         </fileset>
                     </filesets>
@@ -153,6 +154,16 @@
                     </defaultBundleList>
                 </configuration>
             </plugin>
+
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>emma-maven-plugin</artifactId>
+                <configuration>
+                    <filters>
+                        <filter>-*</filter>
+                    </filters>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
     <reporting>
@@ -349,6 +360,72 @@
                 </plugins>
             </build>
         </profile>
+        <profile>
+            <id>emma</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.sling</groupId>
+                        <artifactId>maven-launchpad-plugin</artifactId>
+                        <configuration>
+                            <rewriteRuleFiles combine.children="append">
+                                <rewriteRuleFile>
+                                    ${basedir}/src/test/rules/emma.drl
+                                </rewriteRuleFile>
+                            </rewriteRuleFiles>
+                        </configuration>
+                        <dependencies>
+                            <dependency>
+                                <groupId>emma</groupId>
+                                <artifactId>emma</artifactId>
+                                <version>2.0.5312</version>
+                            </dependency>
+                        </dependencies>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
+            <id>emma-report</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>exec-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>emma-report</id>
+                                <phase>validate</phase>
+                                <goals>
+                                    <goal>java</goal>
+                                </goals>
+                                <configuration>
+                                    <mainClass>emma</mainClass>
+                                    <arguments>
+                                        <argument>report</argument>
+                                        <argument>-r</argument>
+                                        <argument>html</argument>
+                                        <argument>-in</argument>
+                                        <argument>${user.dir}/coverage.em,${user.dir}/coverage.ec</argument>
+                                        <argument>-sp</argument>
+                                        <argument>${sourceDirs}</argument>
+                                    </arguments>
+                                    <includePluginDependencies>true</includePluginDependencies>
+                                    <includeProjectDependencies>false</includeProjectDependencies>
+                                </configuration>
+                            </execution>
+                        </executions>
+                        <dependencies>
+                            <dependency>
+                                <groupId>emma</groupId>
+                                <artifactId>emma</artifactId>
+                                <version>2.0.5312</version>
+                            </dependency>
+                        </dependencies>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
     </profiles>
 
     <dependencies>

Added: sling/trunk/launchpad/testing/src/test/config/sling.properties
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/testing/src/test/config/sling.properties?rev=1023522&view=auto
==============================================================================
--- sling/trunk/launchpad/testing/src/test/config/sling.properties (added)
+++ sling/trunk/launchpad/testing/src/test/config/sling.properties Sun Oct 17 16:30:16 2010
@@ -0,0 +1,17 @@
+# 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.
+sling.system.packages.class.com.vladium.emma.rt.RT=com.vladium.emma.rt
\ No newline at end of file

Added: sling/trunk/launchpad/testing/src/test/rules/emma.drl
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/testing/src/test/rules/emma.drl?rev=1023522&view=auto
==============================================================================
--- sling/trunk/launchpad/testing/src/test/rules/emma.drl (added)
+++ sling/trunk/launchpad/testing/src/test/rules/emma.drl Sun Oct 17 16:30:16 2010
@@ -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.
+package org.apache.sling.launchpad.testing
+dialect "mvel"
+
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.*;
+
+rule "Add emma classifier to org.apache.sling SNAPSHOTs"
+    
+    when
+        $bundleList : BundleList()
+        $startLevel : StartLevel() from $bundleList.startLevels
+        $bundle : Bundle(groupId == "org.apache.sling" &&
+            type == "jar" &&
+            (version matches ".*-SNAPSHOT$" || version == "LATEST"))
+            from $startLevel.bundles
+    then
+        $bundle.classifier = "emma"
+        
+end
+

Modified: sling/trunk/maven/maven-launchpad-plugin/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/maven/maven-launchpad-plugin/pom.xml?rev=1023522&r1=1023521&r2=1023522&view=diff
==============================================================================
--- sling/trunk/maven/maven-launchpad-plugin/pom.xml (original)
+++ sling/trunk/maven/maven-launchpad-plugin/pom.xml Sun Oct 17 16:30:16 2010
@@ -66,6 +66,15 @@
                 </configuration>
             </plugin>
 
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>emma-maven-plugin</artifactId>
+                <configuration>
+                    <filters>
+                        <filter>-*</filter>
+                    </filters>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
 

Modified: sling/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/parent/pom.xml?rev=1023522&r1=1023521&r2=1023522&view=diff
==============================================================================
--- sling/trunk/parent/pom.xml (original)
+++ sling/trunk/parent/pom.xml Sun Oct 17 16:30:16 2010
@@ -172,6 +172,30 @@ on 64bit platforms: MAVEN_OPTS="-Xmx512M
             </plugin>
 
             <plugin>
+                <groupId>org.codehaus.groovy.maven</groupId>
+                <artifactId>gmaven-plugin</artifactId>
+                <executions>
+                    <!-- store the project's source dir in a comma-delimited list for the emma report. -->
+                    <execution>
+                        <id>save-bundle-metadata</id>
+                        <goals>
+                            <goal>execute</goal>
+                        </goals>
+                        <phase>validate</phase>
+                        <configuration>
+                            <source>
+                                if (!session.executionProperties.sourceDirs) {
+                                    session.executionProperties.sourceDirs = "${basedir}/src/main/java"
+                                } else {
+                                    session.executionProperties.sourceDirs += ",${basedir}/src/main/java"
+                                }
+                            </source>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>ianal-maven-plugin</artifactId>
                 <executions>
@@ -186,6 +210,24 @@ on 64bit platforms: MAVEN_OPTS="-Xmx512M
                     </execution>
                 </executions>
             </plugin>
+
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>emma-maven-plugin</artifactId>
+                <version>1.0-alpha-2</version>
+                <inherited>true</inherited>
+                <executions>
+                    <execution>
+                        <phase>prepare-package</phase>
+                        <goals>
+                            <goal>instrument</goal>
+                        </goals>
+                        <configuration>
+                            <metadataFile>${user.dir}/coverage.em</metadataFile>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
 
         <pluginManagement>
@@ -256,6 +298,7 @@ on 64bit platforms: MAVEN_OPTS="-Xmx512M
                     <version>2.0.1</version>
                     <inherited>true</inherited>
                     <configuration>
+                        <outputDirectory>${basedir}/target/classes</outputDirectory>
                         <instructions>
                             <Bundle-Category>sling</Bundle-Category>
                             <Bundle-DocURL>
@@ -265,6 +308,19 @@ on 64bit platforms: MAVEN_OPTS="-Xmx512M
                             <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                         </instructions>
                     </configuration>
+                    <executions>
+                        <execution>
+                            <id>emma-bundle</id>
+                            <goals>
+                                <goal>bundle</goal>
+                            </goals>
+                            <phase>package</phase>
+                            <configuration>
+                                <classifier>emma</classifier>
+                                <outputDirectory>${basedir}/target/generated-classes/emma/classes</outputDirectory>
+                            </configuration>
+                        </execution>
+                    </executions>
                 </plugin>
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>