Get an objective-c header file and translate it to equivalent javascript calls
$ npm install java-method-parser
const fs = require("fs");
const javaMethodParser = require("java-method-parser");
const content = fs.readFileSync("/path/to/java/Ponies.java");
const output = javaMethodParser(content);
fs.writeFileSync("/path/to/project/ponies.json", output);
package com.foo.bar.baz;
public class BasicName {
private BasicName() {}
/**
* asserting a matcher
*/
public static ViewInteraction assertMatcher(ViewInteraction i, Matcher<View> m) {}
// This is for asserting invisibility
public static ViewInteraction assertNotVisible(ViewInteraction i) {}
}
{
"name": "BasicName",
"pcakage": "com.foo.bar",
"methods": [
{
"args": [
{
"type": "ViewInteraction",
"name": "i"
},
{
"type": "Matcher<View>",
"name": "m"
}
],
"comment": "asserting a matcher",
"name": "assertMatcher",
"returnType": "ViewInteraction"
},
{
"args": [
{
"type": "ViewInteraction",
"name": "i"
}
],
"comment": "This is for asserting invisibility",
"name": "assertNotVisible",
"returnType": "ViewInteraction"
}
]
}
MIT © Daniel Schmidt