Uploaded image for project: 'Qt Tools for Android'
  1. Qt Tools for Android
  2. QTTA-446

QtGP & QtTAS: Remove hard coded paths from Gradle files

XMLWordPrintable

      Why?

      Cause - Why, why, why this is needed?

      • Hard coded Qt (or any) paths in example cause issues to users using the Qt Quick for Android examples Gradle files

      Customer - Who needs this??

      • Especially the fresh users might benefit from this

      Cruft - Why this would not be needed?

      • The current implementation works as well. But every time you need to change the paths.

      What?

      Definition - what is this?

      At the moment we have some big issue with paths:

      • Putting paths in build.gradle is not portable​
      • Putting paths in gradle.properties is not portable​
      // build.gradle​
      QtBuild {​
          qtPath = file(”/Users/assam/Qt/6.9.1")​
      }​
      ​
      ​// gradle.properties
      ​qtPath =”/Users/assam/Qt/6.9.1”​ 

      ​This results in issues like:

      • The number of issues we got from hard-coded paths in the setup is just too much.​
      • Both sync and build issues, sometimes with cryptic errors.​
      • Managing the project in a version control system will be a mess.​

      The initial reason we kept the option to add Qt paths in the Gradle files was to:​

      • Allow Qt GP to run without much configuration.​
      • Support running Qt Quick View examples out of the box.​
      • Let’s face it, we are supporting those two cases by breaking the whole other user experience.​

      The most straightforward solution would be to:

      1. For command-line builds, provide paths to the project using Gradle arguments and environment variables.​
      2. For IDE builds, set the paths in QtTAS and have it pass them to project using point (1) above.​
      3. Optionally, keep the option of paths in build.gradle or gradle.properties, but only as a fallback.​
      4. The priority should be passed arguments, then environment variables then Gradle files.​

      With that we would be able to use Qt GP by doing:

      // Using arguments​
      ./gradlew build -PqtPath=”/Users/assam/Qt/6.9.1”​​
      
      // Using environment variables​
      export Qt_ANDROID_PATH=”/Users/assam/Qt/6.9.1”​
      ./gradlew build​​
      
      // OR​
      Qt_ANDROID_PATH=”/Users/assam/Qt/6.9.1” ./gradlew build​ 

      And for IDE users, we would have QtTAS write the paths set in the Settings page to local user files like under .idea, or to local.properties (this if no other way to directly use APIs to communicate between QtTAS and QtGP).

      Demarcation - what this is not?

      TODO

      Dependencies - what is needed for this to make it happen?

      Spike first, then changes to both QtGP and QtTAS side

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            nikunj Nikunj Arora
            assam Assam Boudjelthia
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes