Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AndroidBuildScript
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pub
AndroidBuildScript
Commits
eab6e157
Commit
eab6e157
authored
Mar 16, 2021
by
maweidong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:新增APP版本
parent
2b36f33e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
33 deletions
+33
-33
Register.Method.gradle
BuildScript/Register.Method.gradle
+30
-30
Yit.Module.Version.gradle
Version/Yit.Module.Version.gradle
+3
-3
No files found.
BuildScript/Register.Method.gradle
View file @
eab6e157
...
...
@@ -94,12 +94,12 @@ def isSnapshot() {
return
"SNAPSHOT"
==
getChannelString
()
}
task
printenv
()
{
// for (Map.Entry<String, String> entry : System.getenv()) {
// println("key:${entry.key},value:${entry.value}")
// }
getBizModuleLastVersion
()
}
//
task printenv() {
//
//
for (Map.Entry<String, String> entry : System.getenv()) {
//
//
println("key:${entry.key},value:${entry.value}")
//
//
}
//
getBizModuleLastVersion()
//
}
def
getBizModuleLastVersion
()
{
...
...
@@ -136,49 +136,49 @@ def getBizModuleLastVersion() {
def
getHttpVersion
(
def
group
,
def
module
)
{
def
group_path
=
group
.
replace
(
"."
,
"/"
)
HttpURLConnection
connection
=
null
;
InputStream
is
=
null
;
BufferedReader
br
=
null
;
String
result
=
null
;
// 返回结果字符串
HttpURLConnection
connection
=
null
InputStream
is
=
null
BufferedReader
br
=
null
String
result
=
null
// 返回结果字符串
try
{
// 创建远程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类
connection
=
(
HttpURLConnection
)
url
.
openConnection
()
;
connection
=
(
HttpURLConnection
)
url
.
openConnection
()
// 设置连接方式:get
connection
.
setRequestMethod
(
"GET"
)
;
connection
.
setRequestMethod
(
"GET"
)
// 设置连接主机服务器的超时时间:15000毫秒
connection
.
setConnectTimeout
(
15000
)
;
connection
.
setConnectTimeout
(
15000
)
// 设置读取远程返回的数据时间:60000毫秒
connection
.
setReadTimeout
(
60000
)
;
connection
.
setReadTimeout
(
60000
)
// 发送请求
connection
.
connect
()
;
connection
.
connect
()
// 通过connection连接,获取输入流
if
(
connection
.
getResponseCode
()
==
200
)
{
is
=
connection
.
getInputStream
()
;
is
=
connection
.
getInputStream
()
// 封装输入流is,并指定字符集
br
=
new
BufferedReader
(
new
InputStreamReader
(
is
,
"UTF-8"
))
;
br
=
new
BufferedReader
(
new
InputStreamReader
(
is
,
"UTF-8"
))
// 存放数据
StringBuffer
sbf
=
new
StringBuffer
()
;
String
temp
=
null
;
StringBuffer
sbf
=
new
StringBuffer
()
String
temp
=
null
while
((
temp
=
br
.
readLine
())
!=
null
)
{
sbf
.
append
(
temp
)
;
sbf
.
append
(
"\r\n"
)
;
sbf
.
append
(
temp
)
sbf
.
append
(
"\r\n"
)
}
result
=
sbf
.
toString
()
;
result
=
sbf
.
toString
()
}
}
catch
(
MalformedURLException
e
)
{
e
.
printStackTrace
()
;
e
.
printStackTrace
()
}
catch
(
IOException
e
)
{
e
.
printStackTrace
()
;
e
.
printStackTrace
()
}
finally
{
// 关闭资源
if
(
null
!=
br
)
{
try
{
br
.
close
()
;
br
.
close
()
}
catch
(
IOException
e
)
{
e
.
printStackTrace
()
;
e
.
printStackTrace
()
}
}
...
...
@@ -186,15 +186,15 @@ def getHttpVersion(def group, def module) {
try
{
is
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
()
;
e
.
printStackTrace
()
}
}
connection
.
disconnect
()
;
// 关闭远程连接
connection
.
disconnect
()
// 关闭远程连接
}
def
xmlSlurper
=
new
XmlSlurper
()
def
response
=
xmlSlurper
.
parseText
(
result
)
println
(
"$module
${response.versioning.latest}"
)
println
(
"$module
=
${response.versioning.latest}"
)
}
...
...
Version/Yit.Module.Version.gradle
View file @
eab6e157
ext
{
app_version
=
"4.0.0"
shell
=
"4.0.0.
2
"
shell
=
"4.0.0.
3-SNAPSHOT
"
shop
=
"4.0.0.2"
live
=
"4.0.0.2"
cms
=
"4.0.0.
2
"
base
=
"4.0.0.
9
"
cms
=
"4.0.0.
3-SNAPSHOT
"
base
=
"4.0.0.
10-SNAPSHOT
"
food
=
"3.2.0.6"
browser
=
"4.0.0.4"
category
=
"4.0.0.2"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment