blob: 377bc80523fb6490a327c9dae83a3af9920e9f37 [file] [log] [blame]
David Ostrovsky0d475402014-03-04 20:00:11 +01001# 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 Ostrovskybce05c92014-03-03 21:46:40 +010015# 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 Ostrovskyd6fac702014-02-25 22:07:24 +010025def java_sources(
26 name,
27 srcs,
28 visibility = []
29 ):
30 java_library(
Hugo Arès2eaa7bb2015-07-09 12:11:24 -040031 name = name + '__tmp',
David Ostrovskyd6fac702014-02-25 22:07:24 +010032 resources = srcs,
David Ostrovskyd6fac702014-02-25 22:07:24 +010033 )
Hugo Arès2eaa7bb2015-07-09 12:11:24 -040034 java_binary(
35 name = name,
36 deps = [
37 ':%s__tmp' % name,
38 ],
Dave Borowitzb2d36fb2015-07-22 13:46:32 -070039 visibility = visibility,
Hugo Arès2eaa7bb2015-07-09 12:11:24 -040040 )