cs cleanup

This commit is contained in:
Connor Tumbleson 2017-09-19 14:42:14 -04:00
parent 4ba1a035ae
commit 21e9dd514c

View File

@ -307,17 +307,11 @@ final public class AndrolibResources {
mSharedLibrary = flag; mSharedLibrary = flag;
} }
// Ensure that targetSdkVersion is between minSdkVersion/maxSdkVersion if private String checkTargetSdkVersionBounds() {
// they are specified.
private String checkTargetSdkVersionBounds()
{
int target = Integer.parseInt(mTargetSdkVersion); int target = Integer.parseInt(mTargetSdkVersion);
int min = (mMinSdkVersion != null) ? Integer.parseInt(mMinSdkVersion) : 0; int min = (mMinSdkVersion != null) ? Integer.parseInt(mMinSdkVersion) : 0;
int max = (mMaxSdkVersion != null) ? Integer.parseInt(mMaxSdkVersion) : target; int max = (mMaxSdkVersion != null) ? Integer.parseInt(mMaxSdkVersion) : target;
// Your APK seems broken otherwise.
assert (min <= max);
target = Math.min(max, target); target = Math.min(max, target);
target = Math.max(min, target); target = Math.max(min, target);
return Integer.toString(target); return Integer.toString(target);
@ -384,6 +378,9 @@ final public class AndrolibResources {
} }
if (mTargetSdkVersion != null) { if (mTargetSdkVersion != null) {
cmd.add("--target-sdk-version"); cmd.add("--target-sdk-version");
// Ensure that targetSdkVersion is between minSdkVersion/maxSdkVersion if
// they are specified.
cmd.add(checkTargetSdkVersionBounds()); cmd.add(checkTargetSdkVersionBounds());
} }
if (mMaxSdkVersion != null) { if (mMaxSdkVersion != null) {