creadur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r1403848 - in /creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/primary-license-with-copyright-notice: ./ descriptor.xml pom.xml verify.groovy
Date Tue, 30 Oct 2012 19:58:12 GMT
Author: rdonkin
Date: Tue Oct 30 19:58:12 2012
New Revision: 1403848

URL: http://svn.apache.org/viewvc?rev=1403848&view=rev
Log:
WHISKER-6 Test generation of license by maven plugin when descriptor has a subsidary copyright
notice.

Added:
    creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/primary-license-with-copyright-notice/
    creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/primary-license-with-copyright-notice/descriptor.xml
  (with props)
    creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/primary-license-with-copyright-notice/pom.xml
  (with props)
    creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/primary-license-with-copyright-notice/verify.groovy

Added: creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/primary-license-with-copyright-notice/descriptor.xml
URL: http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/primary-license-with-copyright-notice/descriptor.xml?rev=1403848&view=auto
==============================================================================
--- creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/primary-license-with-copyright-notice/descriptor.xml
(added)
+++ creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/primary-license-with-copyright-notice/descriptor.xml
Tue Oct 30 19:58:12 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.
+-->
+<!--
+Verify that output contains copyright notices for primary license.
+ -->
+<manifest>
+    <licenses>
+    <!--
+    MIT license requires a copyright notice
+     -->
+        <license name='MIT License' id='osi:mit'
+            url='http://www.opensource.org/licenses/mit-license.php'>
+            <text>
+Permission is hereby granted, free  of charge, to any person obtaining
+a  copy  of this  software  and  associated  documentation files  (the
+"Software"), to  deal in  the Software without  restriction, including
+without limitation  the rights to  use, copy, modify,  merge, publish,
+distribute,  sublicense, and/or sell  copies of  the Software,  and to
+permit persons to whom the Software  is furnished to do so, subject to
+the following conditions:
+
+The  above  copyright  notice  and  this permission  notice  shall  be
+included in all copies or substantial portions of the Software.
+
+THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
+EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
+MERCHANTABILITY,    FITNESS    FOR    A   PARTICULAR    PURPOSE    AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE,  ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+            </text>
+        </license>
+    </licenses>
+    <notices/>
+    <organisations>
+        <organisation
+            id='example.org'
+            name='The Hypothetical Example Foundation'
+            url='http://www.example.org'/>
+    </organisations>
+    <primary-license id='osi:mit'>
+        <!--
+        Copyright notice for the primary license
+        -->
+        <copyright-notice>Copyright (c) PRIMARY</copyright-notice>
+    </primary-license>
+    <primary-notice/>
+    <primary-organisation id='example.org'/>
+
+    <within dir='.'>
+        <with-license id='osi:mit'>
+            <by-organisation id='example.org'>
+                <resource name='some.text'/>
+            </by-organisation>
+        </with-license>
+        <with-license id='osi:mit'>
+            <copyright-notice>Copyright (c) DEPENDENT</copyright-notice>
+            <by-organisation id='example.org'>
+                <resource name='other.text'/>
+            </by-organisation>
+        </with-license>
+    </within>
+</manifest>

Propchange: creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/primary-license-with-copyright-notice/descriptor.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/primary-license-with-copyright-notice/pom.xml
URL: http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/primary-license-with-copyright-notice/pom.xml?rev=1403848&view=auto
==============================================================================
--- creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/primary-license-with-copyright-notice/pom.xml
(added)
+++ creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/primary-license-with-copyright-notice/pom.xml
Tue Oct 30 19:58:12 2012
@@ -0,0 +1,64 @@
+<?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/xsd/maven-4.0.0.xsd"
+>
+  <modelVersion>4.0.0</modelVersion>
+
+
+  <groupId>org.apache.creadur.whisker.it</groupId>
+  <artifactId>PrimaryLicenseWithCopyrightNotice</artifactId>
+  <version>@project.version@</version>
+
+  <name>Verify that copyright notices are output for primary license</name>
+  <description>
+  WHISKER-3 - ensure that copyright notices are output for primary licenses.
+  </description>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <target.jdk>1.5</target.jdk>
+  </properties>
+
+  <build>
+    <plugins>
+        <plugin>
+          <groupId>org.apache.creadur.whisker</groupId>
+            <artifactId>apache-whisker-plugin4maven</artifactId>
+            <version>@project.version@</version>
+            <executions>
+                <execution>
+                    <id>generate-stuff</id>
+                    <phase>package</phase>
+                    <goals>
+                        <goal>generate</goal>
+                    </goals>
+                </execution>
+            </executions>
+            <configuration>
+                <descriptor>descriptor.xml</descriptor>
+            </configuration>
+        </plugin>
+    </plugins>
+  </build>
+
+</project>
\ No newline at end of file

Propchange: creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/primary-license-with-copyright-notice/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/primary-license-with-copyright-notice/verify.groovy
URL: http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/primary-license-with-copyright-notice/verify.groovy?rev=1403848&view=auto
==============================================================================
--- creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/primary-license-with-copyright-notice/verify.groovy
(added)
+++ creadur/whisker/trunk/apache-whisker-plugin4maven/src/it/primary-license-with-copyright-notice/verify.groovy
Tue Oct 30 19:58:12 2012
@@ -0,0 +1,46 @@
+/**
+ * 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.
+ */
+
+assert !new File(basedir, "target/NOTICE").exists()
+
+def license = new File(basedir, "target/LICENSE")
+assert license.exists()
+
+def reader = new BufferedReader(new InputStreamReader(new FileInputStream(license), "UTF-8"))
+
+def primary = false
+def dependent = false
+
+def line = reader.readLine()
+while (line != null) {
+    if (line.contains("Copyright (c) PRIMARY")) {
+        primary = true
+    }
+    if (line.contains("Copyright (c) DEPENDENT")) {
+        dependent = true
+    }
+
+    line = reader.readLine()
+}
+
+assert primary
+assert dependent
+
+
+return true;
\ No newline at end of file



Mime
View raw message