Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-9149

Make gradle alias subprojects in order to handle libs that depend on libs

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Master
    • None
    • cordova-android
    • None

    Description

      Currently there is an issue with how references for libraries are created in gradle.

      1. project A includes a plugin that includes 2 frameworks: B and C
      2. framework C depends on framework B
      3. C will not be able to resolve B because the reference will be prefixed with the project name (e.g., com.plugin.id/C wants com.plugin.id/B, but only com.plugin.id/A-B exists)

      For a concrete example, see:
      https://github.com/01org/APKexpansion

      The relevant frameworks are:

      <framework src="AndroidLibrary/GoogleExtras/play_licensing/library" custom="true" />
      <framework src="AndroidLibrary/GoogleExtras/play_apk_expansion/downloader_library" custom="true"/>
      

      The downloader library (downloader_library) depends on the licensing library (library). However, the references in the project will be created with prefixes that will prevent the downloader library from resolving licensing library:

      org.apache.cordova.xapkreader/projectName-library
      org.apache.cordova.xapkreader/projectName-downloader_library
      

      In order to fix this, settings.gradle should prefix the framework directory, but omit the prefix in the framework references:

      include ":org.apache.cordova.xapkreader:library"
      project(":org.apache.cordova.xapkreader:library").projectDir = new File("org.apache.cordova.xapkreader/projectName-library")
      

      Attachments

        Activity

          People

            tony-- Tony Homer
            tony-- Tony Homer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: