-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use custom Gradle properties to read minSdkVersion value from config.xml #655
Conversation
Accepts users defined minSdkVersion and targetSdkVersion from config.xml.
Co-authored-by: エリス <ellis.bryan@gmail.com> Co-authored-by: Christopher J. Brody <chris.brody@gmail.com>
…to custom-gradle-properties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might also be recommend to add our defaults to this._defaults
in the constructor
method.
Same as how @dpogue did it with his commit in his repo: dpogue@d18f8d1
Marked as WIP for now. I would like to resolve #657 before continuing with rework on this one. |
I had some trouble using I would like to get PRs #656, #663, and #664 merged first, and test these changes with master before we merge this one. |
…to custom-gradle-properties
This reverts commit eb06848.
I resolved the review comments above, now limited the changes to handle P.S. I still did not get a chance to test my recent work, keeping it as a WIP PR for now. |
Codecov Report
@@ Coverage Diff @@
## master #655 +/- ##
=========================================
- Coverage 64.61% 64.4% -0.22%
=========================================
Files 18 18
Lines 1820 1826 +6
=========================================
Hits 1176 1176
- Misses 644 650 +6
Continue to review full report at Codecov.
|
I am dismissing the review block as the changes were applied. I will review it again when it is no longer a WIP PR. As for the |
Thanks. I cannot promise when I will be able to continue with testing and fixing this one right now. I wouldn't mind if you or anyone else wants to take it over.
#657 was the main one. I tried quite a few things, nothing worked right for me. The compileSdkVersion and targetSdkVersion do not always seem to be the same thing, more details in #657. I also had some trouble using I gave some reasons in #508 (comment) why I would favor limiting these changes to You are welcome to try it yourself, I don't have much time to test or discuss any further right now. |
…to custom-gradle-properties
Now tested, requesting final review from @erisu. P.S. I would like to merge this proposal upon approval. In case anyone else decides to merge this proposal it should be a squash merge with the Co-authored-by comments preserved in the commit message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I ran the following test
$ npx cordova@nightly create androidTest3 com.foobar.androidTest3 androidTest3 && cd $_
$ npx cordova@nightly platform add github:brodybits/cordova-android\#custom-gradle-properties
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms/android
Package: com.erisu.androidTest3
Name: androidTest3
Activity: MainActivity
Android target: android-28
Subproject Path: CordovaLib
Subproject Path: app
Android project created with cordova-android@8.0.0-dev
...
$ npx cordova@nightly build android
...
BUILD SUCCESSFUL in 10s
...
$ aapt dump badging app-debug.apk
package: name='com.foobar.androidTest3' versionCode='10000' versionName='1.0.0' platformBuildVersionName='1.0.0' compileSdkVersion='28' compileSdkVersionCodename='9'
sdkVersion:'19'
targetSdkVersion:'28'
...
$ npx cordova@nightly run android
BUILD SUCCESSFUL in 0s
...
INSTALL SUCCESS
LAUNCH SUCCESS
...
$ vi config.xml
... added <preference name="android-targetSdkVersion" value="26" />
$ npx cordova@nightly build android
...
BUILD SUCCESSFUL in 2s
...
$ aapt dump badging app-debug.apk
package: name='com.foobar.androidTest3' versionCode='10000' versionName='1.0.0' platformBuildVersionName='1.0.0' compileSdkVersion='28' compileSdkVersionCodename='9'
sdkVersion:'19'
targetSdkVersion:'26'
Thanks @erisu for the extra testing. So the I did also try with the following command, which seemed to work properly:
|
Based on proposal by @erisu in #508 (comment), along with a few more changes:
minSdkVersion
correctlyminSdkVersion
settingI think some more improvements are needed to make the behavior easier to understand and maintain, hope I will get a chance to revisit after the new release is available.
FUTURE TODO:
Resolvesref: #508