You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2021/12/15 15:27:18 UTC

[GitHub] [cordova] hexoh opened a new issue #308: Extend the feature of the framework tag in Plugin.xml

hexoh opened a new issue #308:
URL: https://github.com/apache/cordova/issues/308


   # Extend the feature of the framework tag in Plugin.xml
   
   ## Motivation Behind Feature
   <!-- Why should this feature be implemented? What problem does it solve? -->
   framework tag documentation:  [https://cordova.apache.org/docs/en/10.x/plugin_ref/spec.html#framework](https://cordova.apache.org/docs/en/10.x/plugin_ref/spec.html#framework)
   
   On Android (as of cordova-android@4.0.0), framework tags are used to include Maven dependencies, or to include bundled library projects.
   
   ```
   <!-- Depend on latest version of GCM from play services -->
   <framework src="com.google.android.gms:play-services-gcm:+" />
   <!-- Depend on v21 of appcompat-v7 support library -->
   <framework src="com.android.support:appcompat-v7:21+" />
   ```
   
   Framework can also be used to have custom .gradle files sub-included into the main project's build.gradle file:
   
   ```
   <framework src="relative/path/rules.gradle" custom="true" type="gradleReference" />
   ```
   
   But it can only modify build.gradle in the **`app`** directory in the cordova android project.
   
   ## Feature Description
   <!-- 
   Describe your feature request in detail
   Please provide any code examples or screenshots of what this feature would look like
   Are there any drawbacks? Will this break anything for existing users? 
   -->
   Sometimes, we need to modify the build.gradle under the cordova project.  e.g.
   
   I am trying to add a repository to my build.gradle file.
   
   This is my project build.gradle file, not app folder build.gradle:
   
   ```
   buildscript {
     repositories {
         google()
       }
   }
   ```
   I need to add **`jcenter()`** repo or  **`maven { url "https://maven.google.com" }`** repo to my build.gradle for example inside this:
   
   ```
   buildscript {
       repositories {
           google()
   
           // can use the framework tag to import
           jcenter() 
           maven {
               url "https://maven.google.com"
           }
       }
   }
   ```
   
   I hope I can use the framework tag to modify allprojects or buildscript or Android items in build.gradle.
   Instead of manually adding or using hooks to implement this function every time the project is built.
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org