Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Catch changes in the develop branch
Browse files Browse the repository at this point in the history
  • Loading branch information
takezoe committed Jul 3, 2017
1 parent 4f52d4c commit 3f9dc60
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 110 deletions.
95 changes: 47 additions & 48 deletions LICENSE.txt
Expand Up @@ -1360,12 +1360,12 @@ Binary distribution bundles
Binary distribution bundles

org.slf4j # slf4j-api # 1.7.18 (https://www.slf4j.org/)
org.slf4j # slf4j-api # 1.7.16 (https://www.slf4j.org/)
org.slf4j # slf4j-api # 1.7.14 (https://www.slf4j.org/)
org.slf4j # slf4j-api # 1.7.10 (https://www.slf4j.org/)
org.slf4j # slf4j-api # 1.7.2 (https://www.slf4j.org/)
org.slf4j # slf4j-api # 1.7.5 (https://www.slf4j.org/)
org.slf4j # slf4j-api # 1.7.7 (https://www.slf4j.org/)
org.slf4j # slf4j-log4j12 # 1.7.18 (https://www.slf4j.org/)
org.slf4j # slf4j-log4j12 # 1.7.5 (https://www.slf4j.org/)
org.slf4j # slf4j-log4j12 # 1.7.10 (https://www.slf4j.org/)

which are available under the MIT license (http://opensource.org/licenses/mit-license.php)

Expand Down Expand Up @@ -1420,7 +1420,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
Binary distribution bundles

com.github.scopt # scopt_2.10 # 3.5.0 (https://github.com/scopt/scopt)
com.github.scopt # scopt_2.11 # 3.5.0 (https://github.com/scopt/scopt)

which are available under the MIT license (http://opensource.org/licenses/mit-license.php)

Expand All @@ -1432,45 +1432,6 @@ The above copyright notice and this permission notice shall be included in all c

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.
--------------------------------------------------------------------------------
Binary distribution bundles

jline # jline # 0.9.94 (http://jline.sourceforge.net)

which is available under the BSD license (http://jline.sourceforge.net/license.html)

Copyright (c) 2002-2006, Marc Prud'hommeaux <mwp1@cornell.edu>
All rights reserved.

Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions are met:

Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with
the distribution.

Neither the name of JLine nor the names of its contributors
may be used to endorse or promote products derived from this
software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
Binary distribution bundles

com.esotericsoftware # kryo # 3.0.3 (https://github.com/EsotericSoftware/kryo)
Expand Down Expand Up @@ -1673,7 +1634,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
Binary distribution bundles

org.clapper # grizzled-slf4j_2.10 # 1.0.2 (http://software.clapper.org/grizzled-slf4j/)
org.clapper # grizzled-slf4j_2.11 # 1.0.2 (http://software.clapper.org/grizzled-slf4j/)

which is available under the BSD license (http://www.opensource.org/licenses/bsd-license.php)

Expand Down Expand Up @@ -1741,10 +1702,14 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
Binary distribution bundles

org.scala-lang # scala-library # 2.10.6 (http://scala-lang.org/)
org.scala-lang # scala-compiler # 2.10.6 (http://scala-lang.org/)
org.scala-lang # scala-reflect # 2.10.6 (http://scala-lang.org/)
org.scala-lang # scalap # 2.10.6 (http://scala-lang.org/)
org.scala-lang # scala-library # 2.11.8 (http://scala-lang.org/)
org.scala-lang # scala-compiler # 2.11.8 (http://scala-lang.org/)
org.scala-lang # scala-reflect # 2.11.8 (http://scala-lang.org/)
org.scala-lang # scalap # 2.11.8 (http://scala-lang.org/)
org.scala-lang.modules # scala-java8-compat_2.11 # 0.7.0 (http://scala-lang.org/)
org.scala-lang.modules # scala-parser-combinators_2.11 # 1.0.4 (http://scala-lang.org/)
org.scala-lang.modules # scala-xml_2.11 # 1.0.3 (http://scala-lang.org/)
org.scala-lang.modules # scala-xml_2.11 # 1.0.4 (http://scala-lang.org/)

which is available under the BSD license (http://www.scala-lang.org/downloads/license.html)

Expand Down Expand Up @@ -1777,6 +1742,40 @@ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
Binary distribution bundles

org.fusesource.leveldbjni # leveldbjni-all # 1.8 (https://github.com/fusesource/leveldbjni)

which is available under the BSD license (http://www.opensource.org/licenses/BSD-3-Clause)

Copyright (c) 2011 FuseSource Corp. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of FuseSource Corp. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
The following libraries are from the public domain.

com.github.stephenc.high-scale-lib # high-scale-lib # 1.1.1 (https://github.com/stephenc/high-scale-lib)
Expand Down
109 changes: 50 additions & 59 deletions tests/check_libraries.sh
Expand Up @@ -27,72 +27,63 @@ FILTERED_FILE="${REPORT_DIR}/licences-filtered.csv"
ERROR_FILE="${REPORT_DIR}/licences-errors.csv"

# Extract libraries which are not described in LICENSE.txt
check_undocumented_libraries() {
echo "Check library dependencies..."

# Generate license report
sbt/sbt clean
sbt/sbt dumpLicenseReport
echo "Check library dependencies..."

sbt/sbt storage/clean
sbt/sbt storage/dumpLicenseReport
# Generate license report
sbt/sbt clean
sbt/sbt dumpLicenseReport

# Clean up
mkdir -p ${REPORT_DIR}
sbt/sbt storage/clean
sbt/sbt storage/dumpLicenseReport

rm -f ${GATHERED_FILE}
rm -f ${FILTERED_FILE}
rm -f ${ERROR_FILE}
# Clean up
mkdir -p ${REPORT_DIR}

# Gather and filter reports
find . -name "*-licenses.csv" -exec cat {} >> ${GATHERED_FILE} \;
cat ${GATHERED_FILE} | sort | uniq | grep -v "Category,License,Dependency,Notes" | \
grep -v "Apache" | \
grep -v "ASL" | \
grep -v "org.apache" | \
grep -v "commons-" | \
grep -v "tomcat" | \
grep -v "org.codehaus.jettison" | \
grep -v "xml-apis" | \
grep -v "org.mortbay.jetty" | \
grep -v "com.google.guava" | \
grep -v "predictionio" > ${FILTERED_FILE}
rm -f ${GATHERED_FILE}
rm -f ${FILTERED_FILE}
rm -f ${ERROR_FILE}

# Check undocumented
cat ${FILTERED_FILE} | while read LINE
do
LIBRARY=`echo ${LINE} | cut -d ',' -f 3`
grep -q "$LIBRARY" "${FWDIR}/LICENSE.txt"
if [ $? -ne 0 ]; then
echo -e "\033[0;31m[error]\033[0;39m Undocumented dependency: $LINE"
echo $LINE >> ${ERROR_FILE}
fi
done
# Gather and filter reports
find . -name "*-licenses.csv" -exec cat {} >> ${GATHERED_FILE} \;
cat ${GATHERED_FILE} | sort | uniq | grep -v "Category,License,Dependency,Notes" | \
grep -v "Apache" | \
grep -v "ASL" | \
grep -v "org.apache" | \
grep -v "commons-" | \
grep -v "tomcat" | \
grep -v "org.codehaus.jettison" | \
grep -v "xml-apis" | \
grep -v "org.mortbay.jetty" | \
grep -v "com.google.guava" | \
grep -v "predictionio" > ${FILTERED_FILE}

if [ -f ${ERROR_FILE} ]; then
echo "Library checks failed."
exit 1
else
echo "Library checks passed."
exit 0
fi
}
# Check undocumented
cat ${FILTERED_FILE} | while read LINE
do
LIBRARY=`echo ${LINE} | cut -d ',' -f 3`
grep -q "$LIBRARY" "${FWDIR}/LICENSE.txt"
if [ $? -ne 0 ]; then
echo -e "\033[0;31m[error]\033[0;39m Undocumented dependency: $LINE"
echo "Undocumented dependency: $LINE" >> ${ERROR_FILE}
fi
done

# Extract libraries which are described in LICENSE.txt but not exist actually
check_documented_libraries(){
echo "Check libraries described in LICENSE.txt..."
echo "Check libraries described in LICENSE.txt..."

cat "${FWDIR}/LICENSE.txt" | grep "#" | sed -e 's/(.*)//' | sed -e '/^#/d' | while read LINE
do
grep -q "$LINE" ${GATHERED_FILE}
if [ $? -ne 0 ]; then
echo -e "\033[0;31m[error]\033[0;39m Can't find: $LINE"
fi
done
}
cat "${FWDIR}/LICENSE.txt" | grep "#" | sed -e 's/(.*)//' | sed -e '/^#/d' | while read LINE
do
grep -q "$LINE" ${GATHERED_FILE}
if [ $? -ne 0 ]; then
echo -e "\033[0;31m[error]\033[0;39m Can't find: $LINE"
echo "Unused dependency: $LINE" >> ${ERROR_FILE}
fi
done

if [ "$1" = "--confirm" ]; then
check_documented_libraries
else
check_undocumented_libraries
fi
if [ -f ${ERROR_FILE} ]; then
echo "Library checks failed."
exit 1
else
echo "Library checks passed."
exit 0
fi
6 changes: 3 additions & 3 deletions tests/unit.sh
Expand Up @@ -21,9 +21,6 @@ pushd /PredictionIO
# Run license check
./tests/check_license.sh

# Run library check
./tests/check_libraries.sh

# Prepare pio environment variables
set -a
source ./conf/pio-env.sh
Expand All @@ -44,4 +41,7 @@ sbt/sbt dataJdbc/compile test storage/test \
-Dhadoop.version=$PIO_HADOOP_VERSION \
-Delasticsearch.version=$PIO_ELASTICSEARCH_VERSION

# Run library check
./tests/check_libraries.sh

popd

0 comments on commit 3f9dc60

Please sign in to comment.