Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GradlePlugin
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
Gradle
GradlePlugin
Commits
46faf028
Commit
46faf028
authored
May 30, 2023
by
tongzifang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
71a7b4a8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
build.gradle
build.gradle
+1
-1
OssBuildAndUploadPlugin.groovy
...vy/com/qmai/android/plugin/OssBuildAndUploadPlugin.groovy
+2
-2
OssUploadTask.groovy
src/main/groovy/com/qmai/android/plugin/OssUploadTask.groovy
+1
-1
No files found.
build.gradle
View file @
46faf028
...
@@ -250,7 +250,7 @@ task hot{
...
@@ -250,7 +250,7 @@ task hot{
}
}
group
'com.qmai.android.plugin'
group
'com.qmai.android.plugin'
version
'1.9
3
'
version
'1.9
9
'
gradlePublish
{
gradlePublish
{
...
...
src/main/groovy/com/qmai/android/plugin/OssBuildAndUploadPlugin.groovy
View file @
46faf028
...
@@ -23,14 +23,14 @@ class OssBuildAndUploadPlugin implements Plugin<Project> {
...
@@ -23,14 +23,14 @@ class OssBuildAndUploadPlugin implements Plugin<Project> {
void
execute
(
ApplicationVariant
applicationVariant
)
{
void
execute
(
ApplicationVariant
applicationVariant
)
{
def
taskName
=
applicationVariant
.
getName
()
def
taskName
=
applicationVariant
.
getName
()
def
buildType
=
applicationVariant
.
buildType
.
name
def
buildType
=
applicationVariant
.
buildType
.
name
def
flavor
=
applicationVariant
.
flavorName
def
flavor
=
applicationVariant
.
flavorName
.
isEmpty
()
?
"未配置"
:
applicationVariant
.
flavorName
def
appName
=
applicationVariant
.
buildType
.
manifestPlaceholders
.
get
(
"app_name"
,
"企迈数店"
).
toString
()
def
appName
=
applicationVariant
.
buildType
.
manifestPlaceholders
.
get
(
"app_name"
,
"企迈数店"
).
toString
()
applicationVariant
.
outputs
.
all
(
new
Action
<
BaseVariantOutput
>()
{
applicationVariant
.
outputs
.
all
(
new
Action
<
BaseVariantOutput
>()
{
@Override
@Override
void
execute
(
BaseVariantOutput
baseVariantOutput
)
{
void
execute
(
BaseVariantOutput
baseVariantOutput
)
{
File
flie
=
baseVariantOutput
.
getOutputFile
()
File
flie
=
baseVariantOutput
.
getOutputFile
()
def
task
=
project
.
getTasks
().
create
(
"buildAndOss"
+
firstLetterUpper
(
taskName
),
def
task
=
project
.
getTasks
().
create
(
"buildAndOss"
+
firstLetterUpper
(
taskName
),
OssUploadTask
.
class
,
flie
,
ossBean
.
ossPath
,
firstLetterUpper
(
buildType
),
f
irstLetterUpper
(
flavor
)
,
appName
)
OssUploadTask
.
class
,
flie
,
ossBean
.
ossPath
,
firstLetterUpper
(
buildType
),
f
lavor
,
appName
)
//先编译
//先编译
// task.dependsOn("clean")
// task.dependsOn("clean")
task
.
dependsOn
(
"assemble"
+
firstLetterUpper
(
taskName
))
task
.
dependsOn
(
"assemble"
+
firstLetterUpper
(
taskName
))
...
...
src/main/groovy/com/qmai/android/plugin/OssUploadTask.groovy
View file @
46faf028
...
@@ -83,7 +83,7 @@ class OssUploadTask extends DefaultTask {
...
@@ -83,7 +83,7 @@ class OssUploadTask extends DefaultTask {
//钉钉通知
//钉钉通知
MediaType
JSON
=
MediaType
.
parse
(
"application/json; charset=utf-8"
);
MediaType
JSON
=
MediaType
.
parse
(
"application/json; charset=utf-8"
);
def
gson
=
new
Gson
()
def
gson
=
new
Gson
()
def
content
=
"$appName: 下载地址为: https://files.qmai.cn/$ossPath$fileName
当前分支: ${getBranch()} 当前环境: $buildType
目标cpu: $flavor"
def
content
=
"$appName: 下载地址为: https://files.qmai.cn/$ossPath$fileName
\n当前分支: ${getBranch()}当前环境: $buildType\n
目标cpu: $flavor"
def
dingDingdetail
=
new
FsDetailInfoModel
(
content
)
def
dingDingdetail
=
new
FsDetailInfoModel
(
content
)
def
dingdingInfo
=
new
FsInfoModel
(
dingDingdetail
)
def
dingdingInfo
=
new
FsInfoModel
(
dingDingdetail
)
RequestBody
requestBody
=
RequestBody
.
create
(
JSON
,
gson
.
toJson
(
dingdingInfo
))
RequestBody
requestBody
=
RequestBody
.
create
(
JSON
,
gson
.
toJson
(
dingdingInfo
))
...
...
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