NativeScript / android-dts-generator

A tool that generates TypeScript declaration files (.d.ts) from Jars
90 stars 23 forks source link

some classes are missing there parent class #44

Closed farfromrefug closed 5 years ago

farfromrefug commented 5 years ago

building typings for androidx :

testCompileOnly  "com.google.android.material:material:1.0.0"

then using

java -jar build/libs/dts-generator.jar --skip-declarations -input dts-generator/jar-files

Some genearted classes are missing their parent class. Example com.google.android.material.textfield.TextInputLayout or com.google.android.material.textfield.TextInputEditText

If you fix it by adding the extends you end up with some incompatible method declarations compared to parent class.

farfromrefug commented 5 years ago

Actually figured out that it is because the dts generator do not see the "android declarations". How can i make it see it?

vtrifonov commented 5 years ago

You need to pass supper class jars https://github.com/NativeScript/android-dts-generator#complex-typings-generation e.g.:

java -jar build/libs/dts-generator.jar --skip-declarations -input dts-generator/jar-files -super ${ANDROID_HOME}/platforms/android-17/android.jar

As an example how we generate the typings used in the tns-platform-declarations you can see in the Makefile.

farfromrefug commented 5 years ago

@vtrifonov thank you so much! And thank you for the Makefile. Will apply the same to my module