Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 12    Views: 89

Antonios
Apple Fan
Profile
Posts: 381
Reg: Feb 12, 2013
Korinthos, Gree...
4,610
05/08/13 08:02 AM (12 years ago)

Plugins' update

When there is a plugin update, how can I do the update without losing the changes I have made to the code at its' previous version?
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
05/08/13 08:12 AM (12 years ago)
You shouldn't lose any data added to an app. Are you self hosting? All you need to do is upload the plugin and select the box that says 'Update Existing Plugin' and that's it. You might have to add new updated plugin folder to your project, but everything you have added previously should be ok.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
05/08/13 08:19 AM (12 years ago)
If you've made changes to the code in XCode or Eclipse to a particular plugin, then you will lose those changes when the plugin is updated. Or rather, you will lose those changes the next time you download source code, as the project on the control panel doesn't know what you've done in XCode/Eclipse. But, that would be true if the plugin didn't get updated and you downloaded source code again. Now, if you mean you've made changes to the plugin and uploaded that to your self-hosted control panel, replacing the plugin file that was there, then you'll have to make the modifications again to the updated version and replace it again. That's why I advocate making a new plugin when needing to mod an existing one for self-hosted purposes.
 
Antonios
Apple Fan
Profile
Posts: 381
Reg: Feb 12, 2013
Korinthos, Gree...
4,610
like
05/08/13 08:58 AM (12 years ago)
thanks guys for the info... @dragon yes I am self hosted but I mean what chris understood @chris yes my friend...my question belongs at your first paragraph...I have made some code changes in XCode.Am i able to save these changes and merge them with the update?even if there was an easy way for me to compare the two files and see the changes and then copy-paste them
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
05/08/13 09:16 AM (12 years ago)
"Am i able to save these changes and merge them with the update?" Of course. How easy that will be depends on the extent of your changes and the extent of the changes to the plugin. But when you download the new source code, it becomes a new folder on your computer. Your old project (with all it's changes and mods) will still be there. You just need to figure out what code you added to what files, and do the same on the new project.
 
Antonios
Apple Fan
Profile
Posts: 381
Reg: Feb 12, 2013
Korinthos, Gree...
4,610
like
05/08/13 09:39 AM (12 years ago)
ok I see...that's the time I wanted to avoid but I understand I have to do it manually...Thanks chris!!!
 
WebNevees
Code is Art
Profile
Posts: 206
Reg: Oct 28, 2012
KL
11,660
like
05/08/13 10:38 AM (12 years ago)
Ok Georgios, getting back to what Chris said, you have two options: 1) Create comments whenever you edit the code in XCODE such as below. Then you'd need to do a search for your name in the edited project source code, and add them (the whole blocks of code you've created or modified) to the newly downloaded project source code. You'll have to do this for all your apps every time you download new source code package! Easy: rinse and repeat! //YOURNAME: what you have done and why you have done it goes here. The double slashes indicate a comment. [SOME CODE YOU HAVE ADDED OR MODIFIED] //YOURNAME: end of modification and 2) Just make the modifications once in a cloned (or duplicated, just had the urge to use a fancy word ;) !) plugin package and change the package's name or prefix to create a new plugin. Then upload it to your server like you would other plugins, and enjoy. No rinse. No repeat. Make sure you use the new modified plugin's name in your projects though. For example: Create a new BT_customURL plugin called ET_customURL and "go home"!... no pun intended.
 
Antonios
Apple Fan
Profile
Posts: 381
Reg: Feb 12, 2013
Korinthos, Gree...
4,610
like
05/08/13 10:52 AM (12 years ago)
you are my god!!! hehehe!!! the first option seems much easier and faster...nice thought!!!!I will use it as a solution... thank you so much for sharing your thought!!!!!!
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
05/08/13 05:17 PM (12 years ago)
I am starting to use 'CodeBox' quite a bit... It's nothing more than a quality 'snippet' library for code. About $10 on the App Store. There may be free stuff around I haven't found yet. In this instance, I use it to 'hold' my 'usual' plugin modification code bites... Easy to drop in or replace from the app. Otherwise, like WebNevees suggest, I comment and segregate 'my' code from intrinsic BT Code... Cheers! -- Smug
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
05/08/13 07:37 PM (12 years ago)
Thanks Smug - I could use something like that. I keep going back to old projects for code snippets!
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
05/08/13 09:16 PM (12 years ago)
So I bought CodeBox and wow - way worth $10! Thanks for pointing that one out. Already loaded up several snippets for objective-c and php. Also pinned it to my dock - right next to Komodo Edit :)
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
05/08/13 09:58 PM (12 years ago)
Glad you can use it! And it's pretty flexible, so I've got different sections for PHP, iOS, Android, and oddly enough, Visual dotNet, since I control my Windows box from a Remote Desktop Session on my Mac, and copy/paste works throughout it all. I even have it holding my EULA and stuff like that. If you set the 'Snippets.cbxml' file default location to somewhere in your dropbox, you can use the same library on any of your machines. Cheers! -- Smug
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
05/08/13 10:00 PM (12 years ago)
nice! yeah, I already set up some groups and folders for XCode and PHP. Such a simple concept, yet this will save me lots of time.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.