You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When changing extend implementation in a single file iteratively, like:
Step 1
var listener = new com.google.android.youtube.player.YouTubePlayer.OnInitializedListener({
...
});
tns build android
Step 2
// add some code here, to change the line number of the extend call
var dummy = 1;
var listener = new com.google.android.youtube.player.YouTubePlayer.OnInitializedListener({
...
});
tns build android
Result
This produces two *.java files and obviously the older one is redundant.
We need to figure a cleaning algorithm that prevents this erroneous behavior.
The text was updated successfully, but these errors were encountered:
if the java file contains the line number of the extend it should be easy to detect this.
One other problem is when there is a new override of the same extend on the same line.
Obviously the old generated file should be removed then.
In the runtime-binding-generator case this is handled by the app version code. If this is changed all bindings are considered outdated and are removed to be later generated by newer ones. In debug they are regenerated every time.
It seems we have all the information we need in the filename to detect if the extend have moved for pure javascript files. For Typescript extends we have this
DialogFragment_frnal_ts_helpers_l47_c38__DialogFragmentClassInner.java
, which is always referring to line 47 column 38 in ts_helpers instead of the caller of the ts_helpers functions. We can fix that and then rely on line number in the filename to detect if this is outdated.
Also the other problem of new overrides does not exists since we generate overrides for everything that can be overridden.
I implemented a simple solution to this problem. It is based on the proposal by @slavchev - to generate universal interface "implementations". Writing the following:
varbutton=newandroid.widget.Button(utils.ad.getApplicationContext());button.setOnClickListener(newandroid.view.View.OnClickListener({onClick: function(view){console.log("Meeeeeeep on line 27");}}));varbutton3=newandroid.widget.Button(utils.ad.getApplicationContext());button.setOnClickListener(newandroid.view.View.OnClickListener({onClick: function(view){console.log("Meeeeeeep on line 39");}}));
The SBG would generate just one View_OnClickListener instead of one class each implementation (e.g View_OnClickListener_l1_c10__ and View_OnClickListener_l9_c10__) which resulted in loads of redundant code.
When changing
extend
implementation in a single file iteratively, like:Step 1
tns build android
Step 2
tns build android
Result
This produces two
*.java
files and obviously the older one is redundant.We need to figure a cleaning algorithm that prevents this erroneous behavior.
The text was updated successfully, but these errors were encountered: