-
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
Improve Gradle Build Arguments #699
Merged
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c95b0a1
Remove uses-sdk from AndroidManifest
erisu 42d3b4f
Remove dependency elementtree
erisu ac1bc60
Updated Build Command Help Menu Printout
erisu ccf648b
Update Gradle Properties Parser to Always Set Overriding Changes
erisu 842851c
Add Update Exisiting Gradle Property Use Case
erisu 7f074b9
Update Gradle Properties Configure Method
erisu fcc2ce6
Update GradlePropertiesParser Test Spec
erisu 9f67d1f
Update Build Help Printout for maxSdkVersion Flag
erisu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,14 @@ ext { | |
if (!project.hasProperty('cdvMinSdkVersion')) { | ||
cdvMinSdkVersion = null | ||
} | ||
// Sets the maxSdkVersion to the given value. | ||
if (!project.hasProperty('cdvMaxSdkVersion')) { | ||
cdvMaxSdkVersion = null | ||
} | ||
// The value for android.targetSdkVersion. | ||
if (!project.hasProperty('cdvTargetSdkVersion')) { | ||
cdvTargetSdkVersion = null; | ||
} | ||
// Whether to build architecture-specific APKs. | ||
if (!project.hasProperty('cdvBuildMultipleApks')) { | ||
cdvBuildMultipleApks = null | ||
|
@@ -103,10 +111,12 @@ if (hasBuildExtras2) { | |
} | ||
|
||
// Set property defaults after extension .gradle files. | ||
if (ext.cdvCompileSdkVersion == null) { | ||
ext.cdvCompileSdkVersion = privateHelpers.getProjectTarget() | ||
//ext.cdvCompileSdkVersion = project.ext.defaultCompileSdkVersion | ||
} | ||
ext.cdvCompileSdkVersion = cdvCompileSdkVersion == null ? ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
defaultCompileSdkVersion == null | ||
? privateHelpers.getProjectTarget() | ||
: defaultCompileSdkVersion | ||
) : Integer.parseInt('' + cdvCompileSdkVersion); | ||
|
||
if (ext.cdvBuildToolsVersion == null) { | ||
ext.cdvBuildToolsVersion = privateHelpers.findLatestInstalledBuildTools() | ||
//ext.cdvBuildToolsVersion = project.ext.defaultBuildToolsVersion | ||
|
@@ -121,7 +131,14 @@ if (ext.cdvReleaseSigningPropertiesFile == null && file('../release-signing.prop | |
// Cast to appropriate types. | ||
ext.cdvBuildMultipleApks = cdvBuildMultipleApks == null ? false : cdvBuildMultipleApks.toBoolean(); | ||
ext.cdvVersionCodeForceAbiDigit = cdvVersionCodeForceAbiDigit == null ? false : cdvVersionCodeForceAbiDigit.toBoolean(); | ||
|
||
// minSdkVersion, maxSdkVersion and targetSdkVersion | ||
ext.cdvMinSdkVersion = cdvMinSdkVersion == null ? defaultMinSdkVersion : Integer.parseInt('' + cdvMinSdkVersion) | ||
if (cdvMaxSdkVersion != null) { | ||
ext.cdvMaxSdkVersion = Integer.parseInt('' + cdvMaxSdkVersion) | ||
} | ||
ext.cdvTargetSdkVersion = cdvTargetSdkVersion == null ? defaultTargetSdkVersion : Integer.parseInt('' + cdvTargetSdkVersion) | ||
|
||
ext.cdvVersionCode = cdvVersionCode == null ? null : Integer.parseInt('' + cdvVersionCode) | ||
|
||
def computeBuildTargetName(debugBuild) { | ||
|
@@ -151,6 +168,8 @@ task cdvPrintProps { | |
println('cdvVersionCode=' + cdvVersionCode) | ||
println('cdvVersionCodeForceAbiDigit=' + cdvVersionCodeForceAbiDigit) | ||
println('cdvMinSdkVersion=' + cdvMinSdkVersion) | ||
println('cdvMaxSdkVersion=' + cdvMaxSdkVersion) | ||
println('cdvTargetSdkVersion=' + cdvTargetSdkVersion) | ||
println('cdvBuildMultipleApks=' + cdvBuildMultipleApks) | ||
println('cdvReleaseSigningPropertiesFile=' + cdvReleaseSigningPropertiesFile) | ||
println('cdvDebugSigningPropertiesFile=' + cdvDebugSigningPropertiesFile) | ||
|
@@ -170,6 +189,14 @@ android { | |
if (cdvMinSdkVersion != null) { | ||
minSdkVersion cdvMinSdkVersion | ||
} | ||
|
||
if (cdvMaxSdkVersion != null) { | ||
maxSdkVersion cdvMaxSdkVersion | ||
} | ||
|
||
if(cdvTargetSdkVersion != null) { | ||
targetSdkVersion cdvTargetSdkVersion | ||
} | ||
} | ||
|
||
lintOptions { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Remove "Useful for uploading multiple APKs." from
minSdkVersion
,maxSdkVersion
, andtargetSdkVersion
.There's also probably no value in supporting
maxSdkVersion
since they really really strongly discourage using it (your app will not be compatible with newer versions of Android)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.
At best, we might only be able to add to the printout
(Not Recommended)
.We already supported the setting of the
maxSdkVersion
property throughconfig.xml
and in which sets it inAndroidManifest.xml
.This PR moves the
maxSdkVersion
definition into the Gradle's workflow and removes fromAndroidManifest.xml
.This does add a new command line option to exposes alternative ways for defining this value other than
config.xml
. I thought it was a missed option because we supportedmin
and believe there was no harm to add.If we want to remove
maxSdkVersion
altogether, it then becomes amajor
change. As for future planning, it would be best if I don't add the new command-line option then. We probably should just add warnings that themaxSdkVersion
setting will be deprecated in the next major.Thoughts and Opinions?