Skip to content

Commit 8a780e7

Browse files
manoldonevvtrifonov
authored andcommitted
chore: android29 cleanup (#50)
1 parent 92b992d commit 8a780e7

16 files changed

+12
-34
lines changed

Makefile

+5-27
Original file line numberDiff line numberDiff line change
@@ -46,35 +46,13 @@ android-platform-28:
4646
java -jar dts-generator/build/libs/dts-generator.jar -input ${ANDROID_HOME}/platforms/android-28/android.jar
4747
mv out/android.d.ts out/android-platform-28.d.ts
4848

49+
android-platform-29:
50+
java -jar dts-generator/build/libs/dts-generator.jar -input ${ANDROID_HOME}/platforms/android-29/android.jar
51+
mv out/android.d.ts out/android-platform-29.d.ts
52+
4953
android-platform-all: android-platform-17 android-platform-18 android-platform-19 android-platform-20 android-platform-21 \
5054
android-platform-22 android-platform-23 android-platform-24 android-platform-25 android-platform-26 android-platform-27 \
51-
android-platform-28
52-
53-
android-support-17:
54-
java -jar dts-generator/build/libs/dts-generator.jar \
55-
-input libs/android-support/27.0.1 -input-generics libs/generics.txt \
56-
-super ${ANDROID_HOME}/platforms/android-17/android.jar -skip-declarations
57-
mv out/android.d.ts out/android-support-17.d.ts
58-
59-
android-support-23:
60-
java -jar dts-generator/build/libs/dts-generator.jar \
61-
-input libs/android-support/27.0.1 -input-generics libs/generics.txt \
62-
-super ${ANDROID_HOME}/platforms/android-23/android.jar -skip-declarations
63-
mv out/android.d.ts out/android-support-23.d.ts
64-
65-
android-support-26:
66-
java -jar dts-generator/build/libs/dts-generator.jar \
67-
-input libs/android-support/27.0.1 -input-generics libs/generics.txt \
68-
-super ${ANDROID_HOME}/platforms/android-26/android.jar -skip-declarations
69-
mv out/android.d.ts out/android-support-26.d.ts
70-
71-
android-support-28:
72-
java -jar dts-generator/build/libs/dts-generator.jar \
73-
-input libs/android-support/27.0.1 -input-generics libs/generics.txt \
74-
-super ${ANDROID_HOME}/platforms/android-28/android.jar -skip-declarations
75-
mv out/android.d.ts out/android-support-28.d.ts
76-
77-
android-support-all: android-support-17 android-support-23 android-support-26 android-support-28
55+
android-platform-28 android-platform-29
7856

7957
androidx-17:
8058
java -jar dts-generator/build/libs/dts-generator.jar \

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -101,20 +101,20 @@ If you want to generate typings of a package but you are not sure how you can ge
101101
102102
7. Run the dts-generator tool passing as **input** arguments the path to the output jars folder
103103
104-
## Android support specifics
105-
To get all the jar files for android support follow the steps above. You can find the **jar** files for android support 27.0.1 in [the current repository](libs/android-support/27.0.1)
106-
As the android support needs the base android jar file to create its typings you need to pass the android.jar file as a **super** parameter to the generator. To avoid having typings for every different API level you can reuse typings built with API level 17 for all API levels until 23. It's quite easy to test this:
104+
## Androidx specifics
105+
To get all the jar files for androidx follow the steps above. You can find the **jar** files for androidx 1.0.0 in [the current repository](libs/androidx/1.0.0)
106+
As androidx needs the base android jar file to create its typings you need to pass the android.jar file as a **super** parameter to the generator. To avoid having typings for every different API level you can reuse typings built with API level 17 for all API levels until 23. It's quite easy to test this:
107107
108-
1. Run the typings generator for android support passing **android-17/android.jar** as a supper jar
108+
1. Run the typings generator for androidx passing **android-17/android.jar** as a supper jar
109109
2. Add `/// <reference path="android-17.d.ts"/>` at the top of the generated typings file where android-17.d.ts is the typings file of the android API level 17
110110
3. Run `tsc` passing the generated typings file and there shouldn't be errors
111111
4. Now start replacing the reference file with the files from other API level while the `tsc` execution completes with no error
112112
5. If there's an error this means that you need to generate the android support typings with the same android API level super jar
113113
114114
By repeating the steps above we've found that:
115115
116-
- Android support 17 typings(built with supper jar from android API 17) can be reused until android API 22
117-
- Android support 23 typings(built with supper jar from android API 23) can be reused until android API 25
118-
- Android support 26 typings(built with supper jar from android API 26) can be reused for API 26 and 27
116+
- Androidx 17 typings(built with supper jar from android API 17) can be reused until android API 22
117+
- Androidx 23 typings(built with supper jar from android API 23) can be reused until android API 25
118+
- Androidx 26 typings(built with supper jar from android API 26) can be reused for API 26 and 27
119119
120120
The corresponding typings files can be found in the [tns-platform-declarations](https://github.com/NativeScript/NativeScript/tree/master/tns-platform-declarations) package. The repo's [Makefile](Makefile) can be used as a reference for creating these typings files
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-792 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)