|
1 |
| -android_prebuilt_aar( |
2 |
| - name = 'appcompat-23.1', |
3 |
| - aar = ':appcompat-binary-aar', |
| 1 | +include_defs('//ReactAndroid/DEFS') |
| 2 | + |
| 3 | +# This is a bit messy and hopefully a temporary thing |
| 4 | +# The problem is that Gradle extracts appcompat resources into app namespace, com.facebook.react |
| 5 | +# While BUCK behaves properly and extracts them into android.support.v7.appcompat package. |
| 6 | +# We want to support both Gradle and BUCK builds so we hack a bit how BUCK extracts resources. |
| 7 | +# Besides that we still need JAVA classes from appcompat-v7.aar, that is why android_library |
| 8 | +# extracts classes.jar but the trick is that we can't take full appcompat.aar because resources |
| 9 | +# extracted from it by BUCK would conflict with resources we use under Gradelified package |
| 10 | +# All this mumbo jumbo will go away after t10182713 |
| 11 | + |
| 12 | +android_library( |
| 13 | + name = 'appcompat', |
| 14 | + deps = [ |
| 15 | + ':res-for-appcompat', |
| 16 | + ], |
| 17 | + visibility = [ |
| 18 | + 'PUBLIC', |
| 19 | + ], |
| 20 | + exported_deps = [ |
| 21 | + ':classes-for-react-native', |
| 22 | + ], |
| 23 | +) |
| 24 | + |
| 25 | +# still used by appcompat library internally, so we need both during the build |
| 26 | +android_resource( |
| 27 | + name = 'res-for-appcompat', |
| 28 | + res = ':res-unpacker-cmd', |
| 29 | + package = 'android.support.v7.appcompat', |
| 30 | + visibility = ['//ReactAndroid/...',], |
| 31 | +) |
| 32 | + |
| 33 | +prebuilt_jar( |
| 34 | + name = 'classes-for-react-native', |
| 35 | + binary_jar = ':classes-unpacker-cmd', |
4 | 36 | visibility = ['//ReactAndroid/...',],
|
5 | 37 | )
|
6 | 38 |
|
| 39 | +genrule( |
| 40 | + name = 'classes-unpacker-cmd', |
| 41 | + cmd = '$(exe :aar-unpacker) $(location :appcompat-binary-aar) "classes.jar" $OUT', |
| 42 | + out = 'classes.jar', |
| 43 | +) |
| 44 | + |
| 45 | +genrule( |
| 46 | + name = 'res-unpacker-cmd', |
| 47 | + cmd = '$(exe :aar-unpacker) $(location :appcompat-binary-aar) "res/" $OUT', |
| 48 | + out = 'res', |
| 49 | + visibility = ['//ReactAndroid/...',], |
| 50 | +) |
| 51 | + |
| 52 | +python_binary( |
| 53 | + name = 'aar-unpacker', |
| 54 | + main = 'aar-unpacker.py', |
| 55 | +) |
| 56 | + |
7 | 57 | remote_file(
|
8 | 58 | name = 'appcompat-binary-aar',
|
9 | 59 | url = 'mvn:com.android.support:appcompat-v7:aar:23.0.1',
|
|
0 commit comments