Commit 54b27459 authored by maweidong's avatar maweidong

feat:新增APP版本

parent 6b7547a9
...@@ -94,12 +94,12 @@ def isSnapshot() { ...@@ -94,12 +94,12 @@ def isSnapshot() {
return "SNAPSHOT" == getChannelString() return "SNAPSHOT" == getChannelString()
} }
task printenv() { //task printenv() {
// for (Map.Entry<String, String> entry : System.getenv()) { //// for (Map.Entry<String, String> entry : System.getenv()) {
// println("key:${entry.key},value:${entry.value}") //// println("key:${entry.key},value:${entry.value}")
// } //// }
getBizModuleLastVersion() // getBizModuleLastVersion()
} //}
def getBizModuleLastVersion() { def getBizModuleLastVersion() {
...@@ -136,49 +136,49 @@ def getBizModuleLastVersion() { ...@@ -136,49 +136,49 @@ def getBizModuleLastVersion() {
def getHttpVersion(def group, def module) { def getHttpVersion(def group, def module) {
def group_path = group.replace(".", "/") def group_path = group.replace(".", "/")
HttpURLConnection connection = null; HttpURLConnection connection = null
InputStream is = null; InputStream is = null
BufferedReader br = null; BufferedReader br = null
String result = null;// 返回结果字符串 String result = null// 返回结果字符串
try { try {
// 创建远程url连接对象 // 创建远程url连接对象
URL url = new URL("https://nexus3.yit.com/repository/maven-public/$group_path/$module/maven-metadata.xml"); URL url = new URL("https://nexus3.yit.com/repository/maven-public/$group_path/$module/maven-metadata.xml")
// 通过远程url连接对象打开一个连接 , 强转成httpURLConnection类 // 通过远程url连接对象打开一个连接 , 强转成httpURLConnection类
connection = (HttpURLConnection) url.openConnection(); connection = (HttpURLConnection) url.openConnection()
// 设置连接方式:get // 设置连接方式:get
connection.setRequestMethod("GET"); connection.setRequestMethod("GET")
// 设置连接主机服务器的超时时间:15000毫秒 // 设置连接主机服务器的超时时间:15000毫秒
connection.setConnectTimeout(15000); connection.setConnectTimeout(15000)
// 设置读取远程返回的数据时间:60000毫秒 // 设置读取远程返回的数据时间:60000毫秒
connection.setReadTimeout(60000); connection.setReadTimeout(60000)
// 发送请求 // 发送请求
connection.connect(); connection.connect()
// 通过connection连接,获取输入流 // 通过connection连接,获取输入流
if (connection.getResponseCode() == 200) { if (connection.getResponseCode() == 200) {
is = connection.getInputStream(); is = connection.getInputStream()
// 封装输入流is,并指定字符集 // 封装输入流is,并指定字符集
br = new BufferedReader(new InputStreamReader(is, "UTF-8")); br = new BufferedReader(new InputStreamReader(is, "UTF-8"))
// 存放数据 // 存放数据
StringBuffer sbf = new StringBuffer(); StringBuffer sbf = new StringBuffer()
String temp = null; String temp = null
while ((temp = br.readLine()) != null) { while ((temp = br.readLine()) != null) {
sbf.append(temp); sbf.append(temp)
sbf.append("\r\n"); sbf.append("\r\n")
} }
result = sbf.toString(); result = sbf.toString()
} }
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
e.printStackTrace(); e.printStackTrace()
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace()
} finally { } finally {
// 关闭资源 // 关闭资源
if (null != br) { if (null != br) {
try { try {
br.close(); br.close()
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace()
} }
} }
...@@ -186,15 +186,15 @@ def getHttpVersion(def group, def module) { ...@@ -186,15 +186,15 @@ def getHttpVersion(def group, def module) {
try { try {
is.close(); is.close();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace()
} }
} }
connection.disconnect();// 关闭远程连接 connection.disconnect()// 关闭远程连接
} }
def xmlSlurper = new XmlSlurper() def xmlSlurper = new XmlSlurper()
def response = xmlSlurper.parseText(result) def response = xmlSlurper.parseText(result)
println("$module ${response.versioning.latest}") println("$module=${response.versioning.latest}")
} }
......
ext { ext {
android_app_version="4.0.0" app_version = "4.0.0"
module_qr_version = "" shell = "4.0.0.3-SNAPSHOT"
module_imagepicker_version = "" shop = "4.0.0.2"
module_productinfo_version = "" live = "4.0.0.2"
module_share_version = "" cms = "4.0.0.3-SNAPSHOT"
module_auction_version = "" base = "4.0.0.10-SNAPSHOT"
module_post_version = "" food = "3.2.0.6"
module_login_version = "" browser = "4.0.0.4"
module_category_version = "" category = "4.0.0.2"
module_live_version = "" qr = "4.0.0.1"
module_search_version = "" productinfo = "4.0.0.10"
module_shop_version = "" mine = "4.0.0.2"
module_picker_version = "" search = "4.0.0.2"
module_social_version = "" cart = "4.0.0.2"
module_cart_version = "" post = "4.0.0.1"
module_mine_version = "" login = "4.0.0.1"
module_base_version = "" auction = "4.0.0.4"
module_shell_version = "" social = "4.0.0.1"
module_cms_version = "" imagepicker = "4.0.0.1"
module_browser_version = "" share = "4.0.0.2"
picker = "4.0.0.1"
flutter = "4.0.0.5"
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment