-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blacklist Google Play Services internal members #23
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great, just look at the comments. Some tests would be nice. The most basic ones just running against the most common scenarios: libraries from the Android SDK and making sure we generate an OK .d.ts
file ready to use.
@@ -498,8 +504,7 @@ private void writeMethods(Set<String> methodsSet) { | |||
} | |||
|
|||
private void cacheMethodBySignature(Method m) { | |||
mapNameMethod = new HashMap<String, Method>(); | |||
String currMethodSig = getMethodFullSignature(m); | |||
String currMethodSig = m.getName();//getMethodFullSignature(m); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change variable name to better describe its use and remove the comment if it's no longer necessary
@@ -441,6 +445,8 @@ private void generateInterfaceConstructorCommentBlock(JavaClass classInterface, | |||
private void processMethod(Method m, JavaClass clazz, boolean isInterface, Set<String> methodsSet) { | |||
String name = m.getName(); | |||
|
|||
if (name.startsWith("zz")) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a comment explaining why this is necessary or link to an issue should be sufficient
@@ -613,6 +618,10 @@ private String getMethodParamSignature(JavaClass clazz, Method m) { | |||
|
|||
//field related | |||
private void processField(Field f, JavaClass clazz) { | |||
String fieldName = f.getName(); | |||
|
|||
if (fieldName.startsWith("zz")) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
I've got a separate issue open regarding the tests - I'd have to setup a small infrastructure too, and I did not want to pollute this PR - #25 |
The changes will open the path to fewer typescript errors when typescript-compiling against definitions generated from Google Play Services plugins.
For example after feeding the following android plugins (aars) into the generator, there is only a handful of errors that we need yet to find a way to address:
plugins:
errors list:
8 out of the 13 errors are one and the same error - a public class has a static public member called
CastApi
, but the public class also has a nested class of the same name, which is causing the collisions.