Skip to content

Commit

Permalink
More BUILD file fixes for external twitter-commons java deps.
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjy committed Apr 1, 2014
1 parent 6a99c6f commit 341cf2f
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 93 deletions.
17 changes: 2 additions & 15 deletions 3rdparty/BUILD
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
12 changes: 8 additions & 4 deletions 3rdparty/jvm/com/sun/jersey/BUILD
Original file line number Diff line number Diff line change
@@ -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()])
32 changes: 30 additions & 2 deletions 3rdparty/jvm/com/twitter/common/BUILD
Original file line number Diff line number Diff line change
@@ -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()])
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()])
15 changes: 8 additions & 7 deletions src/java/com/pants/examples/pingpong/main/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
]
)
20 changes: 4 additions & 16 deletions tests/java/com/pants/examples/pingpong/handler/BUILD
Original file line number Diff line number Diff line change
@@ -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'),
)
Original file line number Diff line number Diff line change
@@ -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 {

Expand Down
17 changes: 2 additions & 15 deletions tests/java/com/pants/examples/usethrift/BUILD
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
19 changes: 3 additions & 16 deletions tests/java/com/pants/examples/usethrift/UseThriftTest.java
Original file line number Diff line number Diff line change
@@ -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;

Expand Down

0 comments on commit 341cf2f

Please sign in to comment.