Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mirai
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Mirai
Commits
cb842d87
Commit
cb842d87
authored
May 06, 2020
by
mzdluo123
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
ff4739f5
e69037e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
build.gradle.kts
build.gradle.kts
+9
-6
No files found.
build.gradle.kts
View file @
cb842d87
...
@@ -139,17 +139,20 @@ subprojects {
...
@@ -139,17 +139,20 @@ subprojects {
}
}
fun
Project
.
findLatestFile
():
Map
.
Entry
<
String
,
File
>
?
{
fun
Project
.
findLatestFile
():
Map
.
Entry
<
String
,
File
>
{
return
File
(
projectDir
,
"build/libs"
).
walk
()
return
File
(
projectDir
,
"build/libs"
).
walk
()
.
filter
{
it
.
isFile
}
.
filter
{
it
.
isFile
}
.
onEach
{
println
(
"all files=$it"
)
}
.
onEach
{
println
(
"all files=$it"
)
}
.
filter
{
it
.
name
.
matches
(
Regex
(
"""${project.name}-
([0-9]|\.)
*\.jar"""
))
}
.
filter
{
it
.
name
.
matches
(
Regex
(
"""${project.name}-
[0-9][0-9]*(\.[0-9]*)*.
*\.jar"""
))
}
.
onEach
{
println
(
"matched file: ${it.name}"
)
}
.
onEach
{
println
(
"matched file: ${it.name}"
)
}
.
associateBy
{
it
.
nameWithoutExtension
.
substringAfterLast
(
'-'
)
}
.
associateBy
{
it
.
nameWithoutExtension
.
substringAfterLast
(
'-'
)
}
.
onEach
{
println
(
"versions: $it"
)
}
.
onEach
{
println
(
"versions: $it"
)
}
.
maxBy
{
.
maxBy
{
(
version
,
file
)
->
it
.
key
.
split
(
'.'
).
foldRightIndexed
(
0
)
{
index
:
Int
,
s
:
String
,
acc
:
Int
->
version
.
split
(
'.'
).
let
{
acc
+
100.0
.
pow
(
2
-
index
).
toInt
()
*
(
s
.
toIntOrNull
()
?:
0
)
if
(
it
.
size
==
2
)
it
+
"0"
else
it
}.
reversed
().
foldIndexed
(
0
)
{
index
:
Int
,
acc
:
Int
,
s
:
String
->
acc
+
100.0
.
pow
(
index
).
toInt
()
*
(
s
.
toIntOrNull
()
?:
0
)
}
}
}
}
?:
error
(
"cannot find any file to upload"
)
}
}
\ No newline at end of file
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