Skip to content

Commit

Permalink
[PIO-26] Integrate Apache RAT for license checking
Browse files Browse the repository at this point in the history
Closes apache#279

Squashed commit of the following:

commit 53c4080
Author: Chan Lee <[email protected]>
Date:   Fri Aug 19 15:25:31 2016 -0700

    Fix license header location for html files

    All comments should come after @import and <!DOCTYPE html> declaration

commit 4a86904
Author: Chan Lee <[email protected]>
Date:   Fri Aug 19 13:34:34 2016 -0700

    Configure RAT Apache license checker to run on travis

commit 0beb4be
Author: Chan Lee <[email protected]>
Date:   Fri Aug 19 10:47:53 2016 -0700

    Add apache license to source files in docs/

commit 1ab32d1
Author: Chan Lee <[email protected]>
Date:   Fri Aug 19 10:10:19 2016 -0700

    Add apache license to engine source files used for integration testing

commit d3cb62f
Author: Chan Lee <[email protected]>
Date:   Fri Aug 19 10:07:50 2016 -0700

    Add apache license to more build.sbt files in examples/

commit 0d18dda
Author: Chan Lee <[email protected]>
Date:   Thu Aug 18 17:41:16 2016 -0700

    Add apache license for empty __init__.py files

commit 473df0a
Author: Chan Lee <[email protected]>
Date:   Thu Aug 18 17:39:20 2016 -0700

    Add apache license for integration test files

commit 7a2d97a
Author: Chan Lee <[email protected]>
Date:   Thu Aug 18 17:34:15 2016 -0700

    Add apache license to some html files

commit 611a3ef
Author: Chan Lee <[email protected]>
Date:   Thu Aug 18 17:11:15 2016 -0700

    Add apache license for travis files

commit a422c44
Author: Chan Lee <[email protected]>
Date:   Thu Aug 18 17:05:40 2016 -0700

    Change indentation for bin/semver.sh

commit b0a3d3c
Author: Chan Lee <[email protected]>
Date:   Thu Aug 18 16:57:46 2016 -0700

    Put file description before apache license

commit 1e6399f
Author: Chan Lee <[email protected]>
Date:   Thu Aug 18 16:47:05 2016 -0700

    Add apache license for build.sbt files in examples/
  • Loading branch information
chanlee514 authored and dszeto committed Aug 21, 2016
1 parent 050d894 commit 19a8739
Show file tree
Hide file tree
Showing 84 changed files with 1,534 additions and 111 deletions.
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@
# please add the following to your local git config:
# git config merge.ours.driver true
##########
#
# 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:https://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.
#

branches:
only:
Expand Down
189 changes: 92 additions & 97 deletions bin/semver.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env sh

#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
Expand All @@ -18,130 +17,126 @@
#

function semverParseInto() {
local RE='[^0-9]*\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)\([0-9A-Za-z-]*\)'
#MAJOR
eval $2=`echo $1 | sed -e "s#$RE#\1#"`
#MINOR
eval $3=`echo $1 | sed -e "s#$RE#\2#"`
#MINOR
eval $4=`echo $1 | sed -e "s#$RE#\3#"`
#SPECIAL
eval $5=`echo $1 | sed -e "s#$RE#\4#"`
local RE='[^0-9]*\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)\([0-9A-Za-z-]*\)'
#MAJOR
eval $2=`echo $1 | sed -e "s#$RE#\1#"`
#MINOR
eval $3=`echo $1 | sed -e "s#$RE#\2#"`
#MINOR
eval $4=`echo $1 | sed -e "s#$RE#\3#"`
#SPECIAL
eval $5=`echo $1 | sed -e "s#$RE#\4#"`
}

function semverEQ() {
local MAJOR_A=0
local MINOR_A=0
local PATCH_A=0
local SPECIAL_A=0
local MAJOR_A=0
local MINOR_A=0
local PATCH_A=0
local SPECIAL_A=0

local MAJOR_B=0
local MINOR_B=0
local PATCH_B=0
local SPECIAL_B=0

semverParseInto $1 MAJOR_A MINOR_A PATCH_A SPECIAL_A
semverParseInto $2 MAJOR_B MINOR_B PATCH_B SPECIAL_B

local MAJOR_B=0
local MINOR_B=0
local PATCH_B=0
local SPECIAL_B=0
if [ $MAJOR_A -ne $MAJOR_B ]; then
return 1
fi

if [ $MINOR_A -ne $MINOR_B ]; then
return 1
fi

semverParseInto $1 MAJOR_A MINOR_A PATCH_A SPECIAL_A
semverParseInto $2 MAJOR_B MINOR_B PATCH_B SPECIAL_B
if [ $PATCH_A -ne $PATCH_B ]; then
return 1
fi

if [ $MAJOR_A -ne $MAJOR_B ]; then
return 1
fi
if [[ "_$SPECIAL_A" != "_$SPECIAL_B" ]]; then
return 1
fi

if [ $MINOR_A -ne $MINOR_B ]; then
return 1
fi
return 0
}

if [ $PATCH_A -ne $PATCH_B ]; then
return 1
fi
function semverLT() {
local MAJOR_A=0
local MINOR_A=0
local PATCH_A=0
local SPECIAL_A=0

if [[ "_$SPECIAL_A" != "_$SPECIAL_B" ]]; then
return 1
fi
local MAJOR_B=0
local MINOR_B=0
local PATCH_B=0
local SPECIAL_B=0

semverParseInto $1 MAJOR_A MINOR_A PATCH_A SPECIAL_A
semverParseInto $2 MAJOR_B MINOR_B PATCH_B SPECIAL_B

if [ $MAJOR_A -lt $MAJOR_B ]; then
return 0
fi

}
if [[ $MAJOR_A -le $MAJOR_B && $MINOR_A -lt $MINOR_B ]]; then
return 0
fi

function semverLT() {
local MAJOR_A=0
local MINOR_A=0
local PATCH_A=0
local SPECIAL_A=0

local MAJOR_B=0
local MINOR_B=0
local PATCH_B=0
local SPECIAL_B=0

semverParseInto $1 MAJOR_A MINOR_A PATCH_A SPECIAL_A
semverParseInto $2 MAJOR_B MINOR_B PATCH_B SPECIAL_B

if [ $MAJOR_A -lt $MAJOR_B ]; then
return 0
fi

if [[ $MAJOR_A -le $MAJOR_B && $MINOR_A -lt $MINOR_B ]]; then
return 0
fi

if [[ $MAJOR_A -le $MAJOR_B && $MINOR_A -le $MINOR_B && $PATCH_A -lt $PATCH_B ]]; then
return 0
fi

if [[ "_$SPECIAL_A" == "_" ]] && [[ "_$SPECIAL_B" == "_" ]] ; then
return 1
fi
if [[ "_$SPECIAL_A" == "_" ]] && [[ "_$SPECIAL_B" != "_" ]] ; then
return 1
fi
if [[ "_$SPECIAL_A" != "_" ]] && [[ "_$SPECIAL_B" == "_" ]] ; then
return 0
fi

if [[ "_$SPECIAL_A" < "_$SPECIAL_B" ]]; then
return 0
fi
if [[ $MAJOR_A -le $MAJOR_B && $MINOR_A -le $MINOR_B && $PATCH_A -lt $PATCH_B ]]; then
return 0
fi

if [[ "_$SPECIAL_A" == "_" ]] && [[ "_$SPECIAL_B" == "_" ]] ; then
return 1
fi
if [[ "_$SPECIAL_A" == "_" ]] && [[ "_$SPECIAL_B" != "_" ]] ; then
return 1
fi
if [[ "_$SPECIAL_A" != "_" ]] && [[ "_$SPECIAL_B" == "_" ]] ; then
return 0
fi

if [[ "_$SPECIAL_A" < "_$SPECIAL_B" ]]; then
return 0
fi

return 1

}

function semverGT() {
semverEQ $1 $2
local EQ=$?
semverEQ $1 $2
local EQ=$?

semverLT $1 $2
local LT=$?
semverLT $1 $2
local LT=$?

if [ $EQ -ne 0 ] && [ $LT -ne 0 ]; then
return 0
else
return 1
fi
if [ $EQ -ne 0 ] && [ $LT -ne 0 ]; then
return 0
else
return 1
fi
}

if [ "___semver.sh" == "___`basename $0`" ]; then
MAJOR=0
MINOR=0
PATCH=0
SPECIAL=""

MAJOR=0
MINOR=0
PATCH=0
SPECIAL=""

semverParseInto $1 MAJOR MINOR PATCH SPECIAL
echo "$1 -> M: $MAJOR m:$MINOR p:$PATCH s:$SPECIAL"

semverParseInto $2 MAJOR MINOR PATCH SPECIAL
echo "$2 -> M: $MAJOR m:$MINOR p:$PATCH s:$SPECIAL"
semverParseInto $1 MAJOR MINOR PATCH SPECIAL
echo "$1 -> M: $MAJOR m:$MINOR p:$PATCH s:$SPECIAL"

semverEQ $1 $2
echo "$1 == $2 -> $?."
semverParseInto $2 MAJOR MINOR PATCH SPECIAL
echo "$2 -> M: $MAJOR m:$MINOR p:$PATCH s:$SPECIAL"

semverLT $1 $2
echo "$1 < $2 -> $?."
semverEQ $1 $2
echo "$1 == $2 -> $?."

semverGT $1 $2
echo "$1 > $2 -> $?."
semverLT $1 $2
echo "$1 < $2 -> $?."

semverGT $1 $2
echo "$1 > $2 -> $?."
fi
5 changes: 2 additions & 3 deletions conf/pio-env.sh.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash

#
# Copy this file as pio-env.sh and edit it for your site's configuration.
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
Expand All @@ -17,8 +18,6 @@
# limitations under the License.
#

# Copy this file as pio-env.sh and edit it for your site's configuration.

# PredictionIO Main Configuration
#
# This section controls core behavior of PredictionIO. It is very likely that
Expand Down
8 changes: 4 additions & 4 deletions conf/pio-env.sh.travis
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash


#
# Copy this file as pio-env.sh and edit it for your site's configuration.
#
# 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.
Expand All @@ -15,8 +16,7 @@
# 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.

# Copy this file as pio-env.sh and edit it for your site's configuration.
#

# PredictionIO Main Configuration
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
<!--
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:https://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.
-->
<html>
<head>
<script type='text/javascript' src='https://www.google.com/jsapi'></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@
lastServingSec: Double
)
<!DOCTYPE html>
<!--
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:https://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.
-->
<html lang="en">
<head>
<title>@{engineInstance.engineFactory} (@{engineInstance.engineVariant}) - PredictionIO Engine Server at @{args.ip}:@{args.port}</title>
Expand Down
16 changes: 16 additions & 0 deletions docs/javadoc/javadoc-overview.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
<!--
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:https://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.
-->
<body>
<h1>
PredictionIO API Documentation
Expand Down
17 changes: 17 additions & 0 deletions docs/manual/Gemfile
Original file line number Diff line number Diff line change
@@ -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:https://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.
#

source 'https://rubygems.org'

gem 'middleman', '~> 3.3.10'
Expand Down
17 changes: 17 additions & 0 deletions docs/manual/Rakefile
Original file line number Diff line number Diff line change
@@ -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:https://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.
#

require 'middleman'
require 'nokogiri'
require 'rainbow/ext/string'
Expand Down
Loading

0 comments on commit 19a8739

Please sign in to comment.