How to install a modified version of tns-core-modules-widgets?


#1

If I wanted to modify tns-core-modules-widgets, how would I then install my modified version?

I’ve added, as a simple test, a new function to Async.java:

public String TestFunction()
{
    return "String from java!";
}

I’ve then built tns-core-modules-widgets following the instructions here: https://github.com/NativeScript/tns-core-modules-widgets.

At this point I’m a little lost.

I’ve thought I might be able to modify the dependency in the tns-core-modules’ package.json from

"dependencies": {
    "tns-core-modules-widgets": "2.5.0"
  },

to point to my own version:

"dependencies": {
    "tns-core-modules-widgets": "/Users/daniel_rochelle/Documents/GitHub/repos/tns-core-modules-widgets/"
  },

The project builds but when I try to run my function: console.log(org.nativescript.widgets.Async.Http.TestFunction());

I get an error: TypeError: org.nativescript.widgets.Async.Http.TestFunction is not a function so I guess this didn’t actually install my version.

I also tried tns plugin add path_to_my_version but the app crashes on startup.

Can anyone help me with this?


#2

Never mind.

tns plugin add should have been tns plugin add path_to_my_version/dist/package/