David Ostrovsky | 0d47540 | 2014-03-04 20:00:11 +0100 | [diff] [blame] | 1 | # Copyright (C) 2013 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | # |
David Ostrovsky | bce05c9 | 2014-03-03 21:46:40 +0100 | [diff] [blame] | 15 | # This bucklet simplifies creation of Java source archives |
| 16 | # |
| 17 | # Example: |
| 18 | # |
| 19 | # java_sources( |
| 20 | # name = 'src', |
| 21 | # srcs = SRCS + RSRC, |
| 22 | # visibility = ['PUBLIC'], |
| 23 | # ) |
| 24 | # |
David Ostrovsky | d6fac70 | 2014-02-25 22:07:24 +0100 | [diff] [blame] | 25 | def java_sources( |
| 26 | name, |
| 27 | srcs, |
| 28 | visibility = [] |
| 29 | ): |
| 30 | java_library( |
Hugo Arès | 2eaa7bb | 2015-07-09 12:11:24 -0400 | [diff] [blame] | 31 | name = name + '__tmp', |
David Ostrovsky | d6fac70 | 2014-02-25 22:07:24 +0100 | [diff] [blame] | 32 | resources = srcs, |
David Ostrovsky | d6fac70 | 2014-02-25 22:07:24 +0100 | [diff] [blame] | 33 | ) |
Hugo Arès | 2eaa7bb | 2015-07-09 12:11:24 -0400 | [diff] [blame] | 34 | java_binary( |
| 35 | name = name, |
| 36 | deps = [ |
| 37 | ':%s__tmp' % name, |
| 38 | ], |
Dave Borowitz | b2d36fb | 2015-07-22 13:46:32 -0700 | [diff] [blame] | 39 | visibility = visibility, |
Hugo Arès | 2eaa7bb | 2015-07-09 12:11:24 -0400 | [diff] [blame] | 40 | ) |