Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
[Android] Supply message for version check tool failure. (#2649)
Browse files Browse the repository at this point in the history
* [Android] Supply message for version check tool failure.

* Add google repo for Travis purpose
  • Loading branch information
YorkShen authored and lucky-chen committed Jul 4, 2019
1 parent 850ac3d commit d8bbe74
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions android/build.gradle
@@ -1,7 +1,7 @@

buildscript {
repositories {
mavenLocal()
google()
maven(){
url 'https://maven.aliyun.com/repository/google'
}
Expand All @@ -26,12 +26,12 @@ subprojects {
}
}
repositories {
mavenLocal()
if(project.hasProperty('external_repositories')){
maven {
url external_repositories
}
}
google()
maven(){
url 'https://maven.aliyun.com/repository/google'
}
Expand All @@ -45,7 +45,7 @@ subprojects {
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
}
repositories {
mavenLocal()
google()
maven(){
url 'https://maven.aliyun.com/repository/google'
}
Expand Down
14 changes: 7 additions & 7 deletions android/sdk/build.gradle
Expand Up @@ -51,21 +51,21 @@ version = project.hasProperty('weexVersion') ? project.getProperty('weexVersion'

//Check version, the version must have 4 sections. The leading three section must be number, and the last section is odd number with or without suffix string.
if (!project.hasProperty('ignoreVersionCheck') || !project.getProperty('ignoreVersionCheck').equals("true")) {
assert version.tokenize('.').eachWithIndex { it, i ->
version.tokenize('.').eachWithIndex { it, i ->
if (i < 3) {
assert it.isNumber()
assert it.isNumber() : "Please use semantic versioning witch 4 sections, you are using ${$ { i } + 1} section instead."
} else if (i == 3) {
it.split("-|_").toList().eachWithIndex { inner_it, inner_i ->
it.split("[-_]").toList().eachWithIndex { inner_it, inner_i ->
if (inner_i == 0) {
assert inner_it.isNumber() && inner_it.toInteger() % 2
assert inner_it.isNumber() && inner_it.toInteger() % 2 : "The 4th dight in the versioning number must be a odd number, and it is ${inner_it} currently."
} else {
assert !inner_it.isNumber()
assert !inner_it.isNumber() : "The suffix of the versioning number is not allowed to contain any number, and it is ${inner_it} currently."
}
}.size == 4
} else {
assert false: "Please use semantic versioning witch 4 sections, you are using ${$ { i } + 1} section instead"
assert false: "Please use semantic versioning witch 4 sections, you are using ${$ { i } + 1} section instead."
}
}.size == 4
}
}

android {
Expand Down

0 comments on commit d8bbe74

Please sign in to comment.