From 341cf2fcdfd62af8b94ce871b34c5af34a0f1ecc Mon Sep 17 00:00:00 2001 From: Benjy Date: Tue, 1 Apr 2014 17:32:46 +0000 Subject: [PATCH] More BUILD file fixes for external twitter-commons java deps. --- 3rdparty/BUILD | 17 ++-------- 3rdparty/jvm/com/sun/jersey/BUILD | 12 ++++--- 3rdparty/jvm/com/twitter/common/BUILD | 32 +++++++++++++++++-- .../com/pants/examples/pingpong/main/BUILD | 15 +++++---- .../com/pants/examples/pingpong/handler/BUILD | 20 +++--------- .../pingpong/handler/PingHandlerTest.java | 23 +++---------- tests/java/com/pants/examples/usethrift/BUILD | 17 ++-------- .../examples/usethrift/UseThriftTest.java | 19 ++--------- 8 files changed, 62 insertions(+), 93 deletions(-) diff --git a/3rdparty/BUILD b/3rdparty/BUILD index 3d356ccd4d7..28223734f98 100644 --- a/3rdparty/BUILD +++ b/3rdparty/BUILD @@ -1,18 +1,5 @@ -# ================================================================================================== -# Copyright 2011 Twitter, Inc. -# -------------------------------------------------------------------------------------------------- -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this work except in compliance with the License. -# You may obtain a copy of the License in the LICENSE file, or 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. -# ================================================================================================== +# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). +# Licensed under the Apache License, Version 2.0 (see LICENSE). # This BUILD file defines common external library dependencies used across many modules. Modules # can use these jar_library deps by specifying pants('3rdparty:[name]') in their dependencies list. diff --git a/3rdparty/jvm/com/sun/jersey/BUILD b/3rdparty/jvm/com/sun/jersey/BUILD index 40cbe8db407..6bd2b5daaad 100644 --- a/3rdparty/jvm/com/sun/jersey/BUILD +++ b/3rdparty/jvm/com/sun/jersey/BUILD @@ -1,16 +1,20 @@ +# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). +# Licensed under the Apache License, Version 2.0 (see LICENSE). + +ORG = 'com.sun.jersey' REV = '1.12' jar_library(name='jersey-client', - dependencies=[jar(org='com.sun.jersey', name='jersey-client', rev=REV).with_sources()]) + dependencies=[jar(org=ORG, name='jersey-client', rev=REV).with_sources()]) jar_library(name='jersey-core', - dependencies=[jar(org='com.sun.jersey', name='jersey-core', rev=REV).with_sources()]) + dependencies=[jar(org=ORG, name='jersey-core', rev=REV).with_sources()]) jar_library(name='jersey-server', - dependencies=[jar(org='com.sun.jersey', name='jersey-server', rev=REV).with_sources()]) + dependencies=[jar(org=ORG, name='jersey-server', rev=REV).with_sources()]) jar_library(name='jersey-servlet', - dependencies=[jar(org='com.sun.jersey', name='jersey-servlet', rev=REV).with_sources()]) + dependencies=[jar(org=ORG, name='jersey-servlet', rev=REV).with_sources()]) jar_library(name='jersey-guice', dependencies=[jar(org='com.sun.jersey.contribs', name='jersey-guice', rev=REV).with_sources()]) diff --git a/3rdparty/jvm/com/twitter/common/BUILD b/3rdparty/jvm/com/twitter/common/BUILD index e988d0f31af..e00e57c575e 100644 --- a/3rdparty/jvm/com/twitter/common/BUILD +++ b/3rdparty/jvm/com/twitter/common/BUILD @@ -1,6 +1,34 @@ +# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). +# Licensed under the Apache License, Version 2.0 (see LICENSE). + +ORG = 'com.twitter.common' + +jar_library(name='application', + dependencies=[jar(org=ORG, name='application', rev='0.0.72').with_sources()]) + +jar_library(name='application-http', + dependencies=[jar(org=ORG, name='application-http', rev='0.0.58').with_sources()]) + +jar_library(name='application-module-http', + dependencies=[jar(org=ORG, name='application-module-http', rev='0.0.61').with_sources()]) + +jar_library(name='application-module-lifecycle', + dependencies=[jar(org=ORG, name='application-module-lifecyle', rev='0.0.47').with_sources()]) + +jar_library(name='application-module-log', + dependencies=[jar(org=ORG, name='application-module-log', rev='0.0.55').with_sources()]) + +jar_library(name='application-module-stats', + dependencies=[jar(org=ORG, name='application-module-stats', rev='0.0.43').with_sources()]) + +jar_library(name='args', + dependencies=[jar(org=ORG, name='args', rev='0.2.8').with_sources()]) jar_library(name='base', - dependencies=[jar(org='com.twitter.common', name='base', rev='0.0.85').with_sources()]) + dependencies=[jar(org=ORG, name='base', rev='0.0.85').with_sources()]) jar_library(name='stat', - dependencies=[jar(org='com.twitter.common', name='stat', rev='0.0.28').with_sources()]) \ No newline at end of file + dependencies=[jar(org=ORG, name='stat', rev='0.0.28').with_sources()]) + +jar_library(name='testing-easymock', + dependencies=[jar(org=ORG, name='testing-easymock', rev='0.0.3').with_sources()]) \ No newline at end of file diff --git a/src/java/com/pants/examples/pingpong/main/BUILD b/src/java/com/pants/examples/pingpong/main/BUILD index 3791a8ffcd9..ba3d5d15502 100644 --- a/src/java/com/pants/examples/pingpong/main/BUILD +++ b/src/java/com/pants/examples/pingpong/main/BUILD @@ -13,13 +13,14 @@ jvm_binary(name='main', pants('3rdparty/jvm/com/sun/jersey:jersey-guice'), pants('3rdparty/jvm/com/sun/jersey:jersey-server'), pants('3rdparty/jvm/com/sun/jersey:jersey-servlet'), + pants('3rdparty/jvm/com/twitter/common:application'), + pants('3rdparty/jvm/com/twitter/common:application-http'), + pants('3rdparty/jvm/com/twitter/common:application-module-http'), + pants('3rdparty/jvm/com/twitter/common:application-module-lifecycle'), + pants('3rdparty/jvm/com/twitter/common:application-module-log'), + pants('3rdparty/jvm/com/twitter/common:application-modules-stats'), + pants('3rdparty/jvm/com/twitter/common:args'), + pants('3rdparty/jvm/com/twitter/common:base'), pants('src/java/com/pants/examples/pingpong/handler'), - pants('src/java/com/twitter/common/application'), - pants('src/java/com/twitter/common/application/http'), - pants('src/java/com/twitter/common/application/modules:http'), - pants('src/java/com/twitter/common/application/modules:lifecycle'), - pants('src/java/com/twitter/common/application/modules:log'), - pants('src/java/com/twitter/common/application/modules:stats'), - pants('src/java/com/twitter/common/args'), ] ) diff --git a/tests/java/com/pants/examples/pingpong/handler/BUILD b/tests/java/com/pants/examples/pingpong/handler/BUILD index 19de3e9edb1..667b1e9761c 100644 --- a/tests/java/com/pants/examples/pingpong/handler/BUILD +++ b/tests/java/com/pants/examples/pingpong/handler/BUILD @@ -1,26 +1,14 @@ -# ================================================================================================== -# Copyright 2013 Twitter, Inc. -# -------------------------------------------------------------------------------------------------- -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this work except in compliance with the License. -# You may obtain a copy of the License in the LICENSE file, or 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. -# ================================================================================================== +# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). +# Licensed under the Apache License, Version 2.0 (see LICENSE). java_tests(name='handler', dependencies=[ pants('3rdparty:easymock'), pants('3rdparty:guava'), pants('3rdparty:junit'), + pants('3rdparty/jvm/com/twitter/common:base'), + pants('3rdparty/jvm/com/twitter/common:testing-easymock'), pants('src/java/com/twitter/common/examples/pingpong/handler'), - pants('src/java/com/twitter/common/testing'), ], sources=globs('*.java'), ) diff --git a/tests/java/com/pants/examples/pingpong/handler/PingHandlerTest.java b/tests/java/com/pants/examples/pingpong/handler/PingHandlerTest.java index 1c1e8392ed1..6367a97cff6 100644 --- a/tests/java/com/pants/examples/pingpong/handler/PingHandlerTest.java +++ b/tests/java/com/pants/examples/pingpong/handler/PingHandlerTest.java @@ -1,26 +1,13 @@ -// ================================================================================================= -// Copyright 2013 Twitter, Inc. -// ------------------------------------------------------------------------------------------------- -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this work except in compliance with the License. -// You may obtain a copy of the License in the LICENSE file, or 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 com.twitter.common.examples.pingpong.handler; +// Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). +// Licensed under the Apache License, Version 2.0 (see LICENSE). + +package com.pants.examples.pingpong.handler; import org.junit.Before; import org.junit.Test; import com.twitter.common.base.Closure; -import com.twitter.common.testing.EasyMockTest; +import com.twitter.common.testing.easymock.EasyMockTest; public class PingHandlerTest extends EasyMockTest { diff --git a/tests/java/com/pants/examples/usethrift/BUILD b/tests/java/com/pants/examples/usethrift/BUILD index 3fadd8e395f..d1d6a60a816 100644 --- a/tests/java/com/pants/examples/usethrift/BUILD +++ b/tests/java/com/pants/examples/usethrift/BUILD @@ -1,18 +1,5 @@ -# ================================================================================================== -# Copyright 2014 Twitter, Inc. -# -------------------------------------------------------------------------------------------------- -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this work except in compliance with the License. -# You may obtain a copy of the License in the LICENSE file, or 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. -# ================================================================================================== +# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). +# Licensed under the Apache License, Version 2.0 (see LICENSE). # This doesn't test much. It shows Pants-ly using Thrift from Java, though. diff --git a/tests/java/com/pants/examples/usethrift/UseThriftTest.java b/tests/java/com/pants/examples/usethrift/UseThriftTest.java index bf27997bbce..967d9b2d24a 100644 --- a/tests/java/com/pants/examples/usethrift/UseThriftTest.java +++ b/tests/java/com/pants/examples/usethrift/UseThriftTest.java @@ -1,22 +1,9 @@ -// ================================================================================================= -// Copyright 2014 Twitter, Inc. -// ------------------------------------------------------------------------------------------------- -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this work except in compliance with the License. -// You may obtain a copy of the License in the LICENSE file, or 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. -// ================================================================================================= +// Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). +// Licensed under the Apache License, Version 2.0 (see LICENSE). // Illustrate using Thrift-generated code from Java. -package com.twitter.common.examples.usethrift; +package com.pants.examples.usethrift; import org.junit.Test;