You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wave-commits@incubator.apache.org by wi...@apache.org on 2016/04/29 16:22:56 UTC
incubator-wave git commit: fix license issue for server project and
tune Apache rat bazel hooks.
Repository: incubator-wave
Updated Branches:
refs/heads/wavy 9bddff291 -> c97d5d575
fix license issue for server project and tune Apache rat bazel hooks.
Project: http://git-wip-us.apache.org/repos/asf/incubator-wave/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-wave/commit/c97d5d57
Tree: http://git-wip-us.apache.org/repos/asf/incubator-wave/tree/c97d5d57
Diff: http://git-wip-us.apache.org/repos/asf/incubator-wave/diff/c97d5d57
Branch: refs/heads/wavy
Commit: c97d5d57507722d8c111a7ccd26e860a6684bd08
Parents: 9bddff2
Author: wisebaldone <wi...@apache.org>
Authored: Sat Apr 30 00:22:39 2016 +1000
Committer: wisebaldone <wi...@apache.org>
Committed: Sat Apr 30 00:22:39 2016 +1000
----------------------------------------------------------------------
TODO.md | 2 +-
rat.bzl | 9 ++++-----
server/.rat-excludes | 7 +++++++
server/BUILD | 23 +++++++++++++++++++++++
server/README.md | 5 +++--
server/main.go | 16 ++++++++++++++++
server/main_test.go | 16 ++++++++++++++++
website/BUILD | 2 +-
website/README.md | 1 +
9 files changed, 72 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/c97d5d57/TODO.md
----------------------------------------------------------------------
diff --git a/TODO.md b/TODO.md
index ba98293..70fd243 100644
--- a/TODO.md
+++ b/TODO.md
@@ -2,7 +2,7 @@ While the project is being setup a few todo's will be added and removed here
to track tasks which must be completed before full development can start.
# Apache Related
-- Intergrate Apache Rat & Whisker with Bazel
+
# Project Related
- Create initial Android base
http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/c97d5d57/rat.bzl
----------------------------------------------------------------------
diff --git a/rat.bzl b/rat.bzl
index 55df539..d6e07b1 100644
--- a/rat.bzl
+++ b/rat.bzl
@@ -15,11 +15,10 @@ def rat_repositories():
build_file_content = RAT_TOOLCHAIN_BUILD_FILE
)
-
def _rat_report_impl(ctx):
cmd = "java -jar %s -d %s" % (ctx.file._rat.path, ctx.attr.dir)
- if ctx.file.exclude != None:
- cmd += " -E " + ctx.file.exclude.path
+ if ctx.file.exclude_file != None:
+ cmd += " -E " + ctx.file.exclude_file.path
cmd += (" > %s" % (ctx.outputs.report.path))
ctx.action(
command = cmd,
@@ -30,10 +29,10 @@ rat_report = rule(
implementation = _rat_report_impl,
attrs = {
'dir': attr.string(
- default = ".",
+ default = "",
mandatory = False
),
- 'exclude': attr.label(
+ 'exclude_file': attr.label(
allow_files=True,
single_file=True),
'_rat': attr.label(
http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/c97d5d57/server/.rat-excludes
----------------------------------------------------------------------
diff --git a/server/.rat-excludes b/server/.rat-excludes
new file mode 100644
index 0000000..a308f9f
--- /dev/null
+++ b/server/.rat-excludes
@@ -0,0 +1,7 @@
+CHANGES
+LICENSE
+NOTICE
+THANKS
+README.md
+.rat-excludes
+vendor/*
http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/c97d5d57/server/BUILD
----------------------------------------------------------------------
diff --git a/server/BUILD b/server/BUILD
index 2a8868b..6c8eb33 100644
--- a/server/BUILD
+++ b/server/BUILD
@@ -1,4 +1,21 @@
+# 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.
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_test")
+load("/rat", "rat_report")
go_binary (
name = "server",
@@ -9,3 +26,9 @@ go_test (
name = "test",
srcs = glob(["**/*_test.go"])
)
+
+rat_report(
+ name = "rat",
+ dir = "server",
+ exclude_file = ".rat-excludes"
+)
http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/c97d5d57/server/README.md
----------------------------------------------------------------------
diff --git a/server/README.md b/server/README.md
index e50fd67..0b5f5f1 100644
--- a/server/README.md
+++ b/server/README.md
@@ -21,8 +21,9 @@ Optional:
| Task | Description |
| --- | --- |
-| bazel build //server:server | Builds the server for the current platform |
-| bazel test //server:test | Builds and runs all the server tests |
+| bazel build //server:**server** | Builds the server for the current platform. |
+| bazel test //server:**test** | Builds and runs all the server tests. |
+| bazel build //server:**rat** | Generates Apache Rat report. |
Note: some tasks will require the optional dependencies, these will be noted by
the task.
http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/c97d5d57/server/main.go
----------------------------------------------------------------------
diff --git a/server/main.go b/server/main.go
index 596aac8..4ccae48 100644
--- a/server/main.go
+++ b/server/main.go
@@ -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://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 main
import (
http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/c97d5d57/server/main_test.go
----------------------------------------------------------------------
diff --git a/server/main_test.go b/server/main_test.go
index 1fc7a73..e6947d7 100644
--- a/server/main_test.go
+++ b/server/main_test.go
@@ -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://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 main
import (
http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/c97d5d57/website/BUILD
----------------------------------------------------------------------
diff --git a/website/BUILD b/website/BUILD
index e4d4310..f082ed2 100644
--- a/website/BUILD
+++ b/website/BUILD
@@ -21,5 +21,5 @@ sh_binary(
rat_report(
name = "rat",
dir = "website",
- exclude = ".rat-excludes"
+ exclude_file = ".rat-excludes"
)
http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/c97d5d57/website/README.md
----------------------------------------------------------------------
diff --git a/website/README.md b/website/README.md
index 8d5068f..59a80ad 100644
--- a/website/README.md
+++ b/website/README.md
@@ -27,6 +27,7 @@ which will install the gems that have been defined in the website repo.
| bazel run //website:**website** | Builds the website |
| bazel run //website:**live** | Runs a website live reload server locally |
| bazel run //website:**install** | Installs missing gems |
+| bazel build //server:**rat** | Generates Apache Rat report. |
## More Info