On Fri, May 27, 2016 at 12:22 PM, Nikhil Khandelwal <nikhi...@microsoft.com> wrote:
> As I see it, a change to the directory structure will break almost every > Android plugin currently out there. > > I know. However, I don't think that's a good enough reason to not do this. > There are atleast 20K references [1] on github where people use depend on > the current directory structure for android: "res/xml/config.xml". > > Taking the example of a config.xml manipulation that will now stop working: > https://github.com/phonegap-build/PushPlugin/blob/master/plugin.xml#L34 > > Can you explain how source-file and other tags that reference path will > continue to work? Looking at your current branch [2] there are not changes > to path old path references in plugin.xml to new path. > Actually, here's the thing. They won't. We're going to have to fix our tooling so that they remap. After working on the exploratory branch, all our plugin installation code is stuck in plugman and really should be handled by the platforms so that we can actually handle changes to Android Studio and Xcode. What I'm now proposing is that by default when we specify a source file, or a config file without specifying a target, it by default goes to a location specified by the project. That means that when you are using an Android Studio project, it knows that we keep the config.xml in a different location than the old project. That way, if Google decides that they don't like the current Android Studio project structure and they decide to change things again, we're not stuck holding the bag for years and being stuck having to do all this work so that we can actually allow native developers to be able to use Cordova, since it's almost completely unusable to these developers currently. > > If the path of the file changes it will break lots of plugins and if the > plugins change to work with the new directory structure they will not work > with older versions of Cordova. Let me know if I missed some part of this > change which ensures most plugins for Android do not stop working. > > [1] > https://github.com/search?q=%22res%2Fxml%2Fconfig.xml%22+filename%3Aplugin.xml&ref=searchresults&type=Code&utf8=%E2%9C%93 > [2] > https://github.com/apache/cordova-android/compare/master...infil00p:studio_project_structure > > > -----Original Message----- > From: Joe Bowser [mailto:bows...@gmail.com] > Sent: Tuesday, May 17, 2016 8:14 PM > To: dev <dev@cordova.apache.org> > Subject: Re: Proposal: Change Android Project Directory Structure to > Android Studio style > > On Tue, May 17, 2016 at 5:35 PM, Richard Knoll <rikn...@microsoft.com> > wrote: > > > Does that mean the plan is to provide a mapping from old file > > locations to new ones? For example, if I have this in my plugin.xml: > > > > <config-file target="res/values/strings.xml" parent="" /> > > > > Will the new cordova-android automatically convert the target value to > > the new location of "app/src/main/res/values/strings.xml"? > > > > > I'm pretty sure that config-file targets like that won't work properly, > but I think that source, resource and assets should. I would have added > that as a resource file, since it's strings.xml. > > > > > > Thanks, > > Richard > > > > -----Original Message----- > > From: Joe Bowser [mailto:bows...@gmail.com] > > Sent: Tuesday, May 17, 2016 3:51 PM > > To: dev <dev@cordova.apache.org> > > Subject: Re: Proposal: Change Android Project Directory Structure to > > Android Studio style > > > > @Richard: The changes to the Android files in cordova-common should > > allow for config-file, source-file and resource-file to work fine. I > > already did something similar in February, but I should have checked > > it in on an Cordova-Android branch instead of the other repo. > > > > https://github.com/infil00p/cordova-android-studio > > > > @Parashuram: Does this drop the JAR is libs? I couldn't quite tell > > from looking at the JS code doing the installation. If it does, that > > won't change at all. > > > > On Tue, May 17, 2016 at 3:03 PM, Parashuram N <panar...@microsoft.com> > > wrote: > > > > > This is an example - > > > https://github.com/ConnectSDK/Connect-SDK-Cordova-Plugin. This > > > actually has a hook that downloads and places the source code based > > > on the current directory structure. > > > > > > On 5/17/16, 2:53 PM, "Richard Knoll" <rikn...@microsoft.com> wrote: > > > > > > >We have a lot of plugin.xml elements that depend on the old file > > > structure. Tags like config-file, source-file, resource-file, etc. > > > all have target elements that take arbitrary paths to project files. > > > Looking at the new project structure, it seems like most of the > > > relevant folders have moved around. Does your proposal handle that > > > or do plugins need to update to reflect the new structure? I figure > > > there isn't much we can do for plugins that use hooks. > > > > > > > >Richard > > > > > > > >-----Original Message----- > > > >From: Joe Bowser [mailto:bows...@gmail.com] > > > >Sent: Tuesday, May 17, 2016 2:07 PM > > > >To: dev <dev@cordova.apache.org> > > > >Subject: Re: Proposal: Change Android Project Directory Structure > > > >to > > > Android Studio style > > > > > > > >On Tue, May 17, 2016 at 2:01 PM, Parashuram N > > > ><panar...@microsoft.com> > > > >wrote: > > > > > > > >> I think the proposal is great. Our gradle is pretty big, and it > > > >> does make sense to just do the defaults. > > > >> +1 (personally speaking) to this – will save soo much of my time > > > >> +as I > > > >> depend on this for my react-native-cordova-plugin adapter. Your > > > >> changes will make life so much easier ☺ > > > >> > > > >> How do the plugins break? Will plugins have to make change? In a > > > >> way, it may make sense to do this with big changes at Google I/O > > > >> – that way, we just have 1 breaking change, and plugin authors > > > >> have to look at the changes just once. > > > >> > > > > > > > >Ideally they shouldn't break, but I can't guarantee that. I do > > > >have to > > > change how plugins are installed in the Android cordova scripts, but > > > the cordova-common work abstracted all that out and made that easier. > > > A user who hasn't tweaked their app shouldn't notice the difference. > > > > > > > >That said, the users who have may notice stuff, and I have no idea > > > >how > > > Crosswalk would work with this yet. It'd be good to work with them > > > once we have something more working. > > > > > > > > > > > >> > > > >> On 5/17/16, 1:55 PM, "Joe Bowser" <bows...@gmail.com> wrote: > > > >> > > > >> >Hey > > > >> > > > > >> >I know people have been waiting for this for a very long time, > > > >> >but I wrote up a proposal to change the project so it's an > > > >> >Android Studio > > > project. > > > >> >Given that Android Studio is on 2.1.1, I think it's time we > > > >> >moved forward and changed things around. > > > >> > > > > >> >Proposal PR is here: > > > >> >https://github.com/cordova/cordova-discuss/pull/45 > > > >> > > > > >> >Branch where Proof of Concept work is being done is here: > > > >> >https://github.com/infil00p/cordova-android/tree/studio_project_ > > > >> >st > > > >> >ruc > > > >> >ture > > > >> > > > > >> >The main roadblock to doing this, of course is migration of > > > >> >plugins and custom code, as well as assets, but I think Android > > > >> >developers would welcome this change because we're acting more > > > >> >like a regular, normal Android project again and not some old, > > > >> >weird legacy/special > > > case thing. > > > >> >I've already did some exploratory work with the old > > > >> >cordova-android-studio version of cordova-common, and installing > > > >> >plugins works fine depending on what version of Cordova you're > using. > > > >> > > > > >> >The other thing that has me stuck is all the functionality in > > > >> >the gradle files. I would love to rip out a lot of the stuff we > > > >> >autogenerate in there, such as the settings.gradle file that > > > >> >caused me a huge headache earlier today when I tried to get > > > >> >importing to work. It'd also be good to have a documented > > > >> >process on how we set the Application ID, since I can't quite > > > >> >figure out how we do that, and I know other people are > > > >> >struggling with that as > > well. > > > >> > > > > >> >This would be slated for Cordova-Android 6.0, and hopefully > > > >> >Google IO doesn't have too many surprises that break us. > > > >> > > > > >> >Joe > > > >> > > > >> > > > > > > > >------------------------------------------------------------------- > > > >-- To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org > > > >For additional commands, e-mail: dev-h...@cordova.apache.org > > > > > > > > >