Skip to content

Commit

Permalink
if split version is not changed, qigsaw would not upload it again.
Browse files Browse the repository at this point in the history
  • Loading branch information
kissonchan committed Mar 3, 2020
1 parent e728e0f commit 9bb3b0d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,17 @@ class SplitDetailsProcessorImpl implements SplitDetailsProcessor {
if (uploader == null) {
QigsawLogger.e("SplitApkUploader has not been implemented, just make split " + splitInfo.splitName + " built-in")
} else {
String uploadedUrl = uploader.uploadSync(project, splitInfo.splitApk, splitInfo.splitName)
if (uploadedUrl != null && uploadedUrl.startsWith("http")) {
splitInfo.url = uploadedUrl
QigsawLogger.w("Split ${splitInfo.splitName} apk file has been uploaded, see ${uploadedUrl}")
return
if (!updateMode || splitInfo.versionChanged) {
String uploadedUrl = uploader.uploadSync(project, splitInfo.splitApk, splitInfo.splitName)
if (uploadedUrl != null && uploadedUrl.startsWith("http")) {
splitInfo.url = uploadedUrl
QigsawLogger.w("Split ${splitInfo.splitName} apk file has been uploaded, see ${uploadedUrl}")
return
} else {
QigsawLogger.e("Split ${splitInfo.splitName} upload failed! url: ${uploadedUrl}")
}
} else {
QigsawLogger.e("Split ${splitInfo.splitName} upload failed! url: ${uploadedUrl}")
QigsawLogger.e("Version of split ${splitInfo.splitName} is not changed, use old info!")
}
}
}
Expand Down Expand Up @@ -163,14 +167,15 @@ class SplitDetailsProcessorImpl implements SplitDetailsProcessor {
for (SplitInfo oldInfo : oldSplitDetails.splits) {
if (newInfo.splitName.equals(oldInfo.splitName)) {
if (newInfo.version.equals(oldInfo.version)) {
QigsawLogger.w("Built-in split ${newInfo.splitName} version ${newInfo.version} is not changed, using old info!")
QigsawLogger.w("Split ${newInfo.splitName} version ${newInfo.version} is not changed, using old info!")
newInfo.copySplitInfo(oldInfo)
} else {
if (updateSplits == null) {
updateSplits = new ArrayList<>()
}
QigsawLogger.w("Split ${newInfo.splitName} version ${newInfo.version} is changed, it need to be updated!")
newInfo.builtIn = false
newInfo.versionChanged = true
updateSplits.add(newInfo.splitName)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class SplitInfo {

transient File splitApk

transient boolean versionChanged = false

/**
* The name of split apk
*/
Expand Down

0 comments on commit 9bb3b0d

Please sign in to comment.