Binding Android Library - add new method into class generated from jar <add-node>?
I've got a situation where I need to add a new method into a class, the class is called Preconditions and the class is generated from a jar file so I am working within the additions and the metadata.xml in transformations folder to generate a new method in the final api.xml
How does one add a method into a class generated from a jar file?
The method is called checkNotNullFromProvides and in the Preconditions.class file looks like this:
public static <T> T checkNotNullFromProvides(T reference) {
if (reference == null)
throw new NullPointerException("Cannot return null from a non-@Nullable @Provides method");
return reference;
}
And so I have added into my additions the class i.e. Preconditions.cs
public partial class Preconditions
{
public static T checkNotNullFromProvides<T>(T reference)
{
if (reference == null)
throw new NullReferenceException("Cannot return null from a non-@Nullable @Provides method");
return reference;
}
}
Then in my Metadata.xml I have try to add the node which is the new method in the class:
<add-node path="/api/package[@name='dagger.internal']/class[@name='Preconditions']">
<method abstract="false" native="false" deprecated="not deprecated" final="false" name="checkNotNullFromProvides" return="T" static="true" synchronized="false" visibility="public">
<parameter name="reference" type="T"/>
</method>
</add-node>
Unfortunately when I look into the api.xml the new method does not show up so how does one add a new method to a binding library so it gets included in the final api?