Repository: samza Updated Branches: refs/heads/master 3a3c278a9 -> e0a24a78b
SAMZA-93; gradle check should fail if missing license headers Project: http://git-wip-us.apache.org/repos/asf/samza/repo Commit: http://git-wip-us.apache.org/repos/asf/samza/commit/e0a24a78 Tree: http://git-wip-us.apache.org/repos/asf/samza/tree/e0a24a78 Diff: http://git-wip-us.apache.org/repos/asf/samza/diff/e0a24a78 Branch: refs/heads/master Commit: e0a24a78b9afa56d61cc6c1ad8c894c5078d956c Parents: 3a3c278 Author: David Chen <[email protected]> Authored: Fri Feb 6 12:52:09 2015 -0800 Committer: Chris Riccomini <[email protected]> Committed: Fri Feb 6 12:52:09 2015 -0800 ---------------------------------------------------------------------- build.gradle | 60 +++++++++++--------- gradle/rat.gradle | 6 ++ .../samza/system/kafka/MockKafkaProducer.java | 19 +++++++ samza-test/src/main/python/templates.py | 17 ++++++ 4 files changed, 74 insertions(+), 28 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/samza/blob/e0a24a78/build.gradle ---------------------------------------------------------------------- diff --git a/build.gradle b/build.gradle index 4d0b44f..b803276 100644 --- a/build.gradle +++ b/build.gradle @@ -29,8 +29,7 @@ allprojects { repositories { mavenCentral() mavenLocal() - } - + } } apply from: file("gradle/dependency-versions.gradle") @@ -41,41 +40,46 @@ apply from: file('gradle/customize.gradle') rat { excludes = [ + '*.patch', + '**/*.eot', + '**/*.graffle', + '**/*.iml', + '**/*.ipr', + '**/*.iws', + '**/*.json', + '**/*.otf', + '**/*.svg', + '**/*.ttf', + '**/*.woff', + '**/.classpath', + '**/.cache/**', '**/.git/**', + '**/.gitignore', '**/.gradle/**', '**/.project', - '**/.settings', - '**/*.iml', - '**/*.iws', - '**/*.ipr', - 'gradle/wrapper/**', - '.reviewboardrc', - 'gradlew', - 'gradlew.bat', - 'README.md', - 'RELEASE.md', + '**/.settings/**', '**/.DS_Store/**', - '**/.gitignore', - '**/build/**', - 'docs/Gemfile.lock', - 'docs/sitemap.xml', - 'docs/_site/**', - 'samza-test/state/mystore/**', + '**/bootstrap.css.map', + '**/bootstrap.min.css', '**/bootstrap.min.js', + '**/build/**', + '**/font-awesome.min.css', '**/jquery-1.11.1.min.js', '**/jquery.tablesorter.min.js', - '**/bootstrap.css.map', - '**/bootstrap.min.css', + '**/non-responsive.less', '**/ropa-sans.css', - '**/font-awesome.min.css', '**/syntax.css', - '**/non-responsive.less', - '**/*.graffle', - '**/*.otf', - '**/*.woff', - '**/*.eot', - '**/*.svg', - '**/*.ttf' + '.reviewboardrc', + 'docs/_site/**', + 'docs/sitemap.xml', + 'docs/learn/documentation/*/api/javadocs/**', + 'docs/Gemfile.lock', + 'gradle/wrapper/**', + 'gradlew', + 'gradlew.bat', + 'samza-test/state/mystore/**', + 'README.md', + 'RELEASE.md', ] } http://git-wip-us.apache.org/repos/asf/samza/blob/e0a24a78/gradle/rat.gradle ---------------------------------------------------------------------- diff --git a/gradle/rat.gradle b/gradle/rat.gradle index 8c8ac5e..7d9ca77 100644 --- a/gradle/rat.gradle +++ b/gradle/rat.gradle @@ -52,11 +52,17 @@ class RatTask extends DefaultTask { def printUnknownFiles() { def ratXml = new XmlParser().parse(xmlReport) + def unknownLicenses = 0 ratXml.resource.each { resource -> if (resource.'license-approval'.@name[0] == "false") { println('Unknown license: ' + resource.@name) + unknownLicenses++ } } + if (unknownLicenses > 0) { + throw new GradleException("Found " + unknownLicenses + " files with " + + "unknown licenses.") + } } def generateHtmlReport() { http://git-wip-us.apache.org/repos/asf/samza/blob/e0a24a78/samza-kafka/src/test/scala/org/apache/samza/system/kafka/MockKafkaProducer.java ---------------------------------------------------------------------- diff --git a/samza-kafka/src/test/scala/org/apache/samza/system/kafka/MockKafkaProducer.java b/samza-kafka/src/test/scala/org/apache/samza/system/kafka/MockKafkaProducer.java index 6a2edf6..3b7d57a 100644 --- a/samza-kafka/src/test/scala/org/apache/samza/system/kafka/MockKafkaProducer.java +++ b/samza-kafka/src/test/scala/org/apache/samza/system/kafka/MockKafkaProducer.java @@ -1,3 +1,22 @@ +/* + * 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.samza.system.kafka; import java.util.ArrayList; http://git-wip-us.apache.org/repos/asf/samza/blob/e0a24a78/samza-test/src/main/python/templates.py ---------------------------------------------------------------------- diff --git a/samza-test/src/main/python/templates.py b/samza-test/src/main/python/templates.py index a85dc36..b4bc434 100644 --- a/samza-test/src/main/python/templates.py +++ b/samza-test/src/main/python/templates.py @@ -1,3 +1,20 @@ +# 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. + from contextlib import nested from jinja2 import Template
