-
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
feat: support custom compileSdk setting #1431
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1431 +/- ##
==========================================
+ Coverage 73.20% 73.22% +0.02%
==========================================
Files 21 21
Lines 1646 1666 +20
==========================================
+ Hits 1205 1220 +15
- Misses 441 446 +5
Continue to review full report at Codecov.
|
Downside of allowing custom compileSdk..
|
This might be difficult since we use a JSON file to set our defaults... but wonder if there's a way to default |
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.
I've made a collection of suggestions that if accepted... probably should be applied together.
The attempt is rather than explicitly declaring the COMPILE_SDK_VERSION
default to a hard-coded value, is to make it's default the same as SDK_VERSION
.
The suggested changes I believe will work (but untested) so that unless explicitly declared, compile SDK will be whatever what target SDK is set to (even if the user changes the target SDK).
e.g.:
Use Case 1
User does not declare either target or compile
Target defaults to 32, as defined in defaults json.
compile will default to target, which is set to 32.
Use Case 2
User explicitly sets target sdk to 33
Target will be set to 33 from config preferences.
Compile will default to target, which is set to 33.
Use Case 3
User explicitly sets compile sdk to 33
Target sdk will be set to 32, which comes from the defaults json.
Compile sdk will be set to 33, which comes from config preferences.
Use Case 4
User explicitly sets both target to 30 & compile sdk to 32
Target sdk will be set to 30, which comes from config preferences.
compile sdk will be set to 32, which comes from the config preferences.
Let me know of your thoughts, or whether if this is even a good or bad idea.
Co-authored-by: Norman Breau <norman@nbsolutions.ca>
Co-authored-by: Norman Breau <norman@nbsolutions.ca>
5d1c9fd
to
42b971e
Compare
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
Thank you for the review & votes! |
Motivation and Context
closes #1310
closes #1373
Allow setting a custom
compileSdk
version, different from targetSdk.Some libraries might require a higher compileSdk while it can still target a lower Sdk.
Generally it is recommended that the targetSdk and compileSdk match.
If a user decides to increase the
targetSdk
, they will now need to also manually bump thecompileSdk
or it will remain behind.Description
Can set custom
compileSdk
version with the followpreference
:A warning will display during the
platform add
andprepare
step when thetargetSdk
is higher then thecompileSdk
.Even if the build passes, there could be potential errors further down.
Testing
npm t
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)