Aaron Kruglikov | e630fb1 | 2017-04-24 13:05:26 -0700 | [diff] [blame] | 1 | include_defs('//bucklets/grpc.bucklet') |
| 2 | |
Carmelo Cascone | b1936bd | 2017-12-12 14:42:27 -0800 | [diff] [blame] | 3 | fetch_grpc_plugin(version = '1.3.1') |
Carmelo Cascone | 1d5fc72 | 2017-06-27 19:34:25 -0400 | [diff] [blame] | 4 | |
Carmelo Cascone | b1936bd | 2017-12-12 14:42:27 -0800 | [diff] [blame] | 5 | # Repackaging of gRPC 1.3.* to solve the OSGI split package issue. |
Carmelo Cascone | 1d5fc72 | 2017-06-27 19:34:25 -0400 | [diff] [blame] | 6 | # If bumping the gRPC version, please write a new rule. |
| 7 | |
Carmelo Cascone | b1936bd | 2017-12-12 14:42:27 -0800 | [diff] [blame] | 8 | def grpc_core_repkg_131(): |
Carmelo Cascone | 1d5fc72 | 2017-06-27 19:34:25 -0400 | [diff] [blame] | 9 | repkg_deps = [ |
| 10 | '//lib:COMPILE', |
| 11 | '//lib:google-instrumentation-0.3.0', |
Carmelo Cascone | 72893b7 | 2018-08-09 00:59:06 -0700 | [diff] [blame^] | 12 | '//lib:google-errorprone-2.0.19' |
Carmelo Cascone | 1d5fc72 | 2017-06-27 19:34:25 -0400 | [diff] [blame] | 13 | ] |
| 14 | remote_file( |
Carmelo Cascone | b1936bd | 2017-12-12 14:42:27 -0800 | [diff] [blame] | 15 | name = "grpc-src-zip-131", |
| 16 | url = "https://github.com/grpc/grpc-java/archive/v1.3.1.zip", |
| 17 | sha1 = "03dc21440fdfa920aa0e905da17df35b0d6c9a44", |
Carmelo Cascone | 1d5fc72 | 2017-06-27 19:34:25 -0400 | [diff] [blame] | 18 | ) |
| 19 | srcs = [] |
| 20 | for pkg in ['core', 'context']: |
| 21 | name = 'grpc-' + pkg + '-130' |
| 22 | genrule( |
| 23 | name = name, |
Carmelo Cascone | b1936bd | 2017-12-12 14:42:27 -0800 | [diff] [blame] | 24 | bash = 'jar xf $(location :grpc-src-zip-131) grpc-java-1.3.1/' + pkg + '/src/main/java ' |
| 25 | + '&& cd grpc-java-1.3.1/' + pkg + '/src/main/java ' |
Carmelo Cascone | 1d5fc72 | 2017-06-27 19:34:25 -0400 | [diff] [blame] | 26 | + '&& jar -cf $OUT *', |
| 27 | out = pkg + '.src.zip', |
| 28 | ) |
| 29 | srcs.append(':' + name) |
| 30 | osgi_jar( |
Carmelo Cascone | b1936bd | 2017-12-12 14:42:27 -0800 | [diff] [blame] | 31 | name = 'grpc-core-repkg-1.3.1', |
Carmelo Cascone | 1d5fc72 | 2017-06-27 19:34:25 -0400 | [diff] [blame] | 32 | srcs = srcs, |
| 33 | deps = repkg_deps, |
| 34 | package_name_root = 'io.grpc', |
| 35 | import_packages = '!javax.annotation,!com.google.errorprone.annotations,*', |
| 36 | export_packages = '*', |
| 37 | do_javadocs = False, |
| 38 | do_checkstyle = False, |
| 39 | ) |
| 40 | |
Carmelo Cascone | b1936bd | 2017-12-12 14:42:27 -0800 | [diff] [blame] | 41 | grpc_core_repkg_131() |