Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
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
bp
ShenghuoquanBusiness
Commits
ce7fe133
Commit
ce7fe133
authored
Aug 03, 2021
by
shiyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
使用maven-publish插件进行aar发布
parent
42cfb7a6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
0 deletions
+69
-0
build.gradle
Components/BManagerCenter/build.gradle
+3
-0
build.gradle
Components/BOrder/build.gradle
+3
-0
build.gradle
build.gradle
+9
-0
publish.gradle
publish.gradle
+54
-0
No files found.
Components/BManagerCenter/build.gradle
View file @
ce7fe133
...
@@ -8,6 +8,9 @@ apply plugin: 'kotlin-android'
...
@@ -8,6 +8,9 @@ apply plugin: 'kotlin-android'
apply
plugin:
'kotlin-kapt'
apply
plugin:
'kotlin-kapt'
apply
plugin:
'kotlin-parcelize'
apply
plugin:
'kotlin-parcelize'
rootProject
.
ext
.
artifact_id
=
'managerCenter'
apply
from:
'../../publish.gradle'
android
{
android
{
compileSdkVersion
build_versions
.
compileSdkVersion
compileSdkVersion
build_versions
.
compileSdkVersion
...
...
Components/BOrder/build.gradle
View file @
ce7fe133
...
@@ -8,6 +8,9 @@ apply plugin: 'kotlin-android'
...
@@ -8,6 +8,9 @@ apply plugin: 'kotlin-android'
apply
plugin:
'kotlin-kapt'
apply
plugin:
'kotlin-kapt'
apply
plugin:
'kotlin-parcelize'
apply
plugin:
'kotlin-parcelize'
rootProject
.
ext
.
artifact_id
=
'order'
apply
from:
'../../publish.gradle'
android
{
android
{
compileSdkVersion
build_versions
.
compileSdkVersion
compileSdkVersion
build_versions
.
compileSdkVersion
...
...
build.gradle
View file @
ce7fe133
...
@@ -29,6 +29,15 @@ allprojects {
...
@@ -29,6 +29,15 @@ allprojects {
addRepos
(
repositories
)
addRepos
(
repositories
)
}
}
/**
* 发布版本信息
*/
ext
{
group_id
=
'com.yidian.business'
artifact_id
=
''
version_name
=
'0.0.1-SNAPSHOT'
}
task
clean
(
type:
Delete
)
{
task
clean
(
type:
Delete
)
{
delete
rootProject
.
buildDir
delete
rootProject
.
buildDir
}
}
\ No newline at end of file
publish.gradle
0 → 100644
View file @
ce7fe133
apply
plugin:
'maven-publish'
/**
* 从 local.properties 中提取 Maven 仓库账号信息
*/
def
localProperties
=
new
Properties
()
localProperties
.
load
(
project
.
rootProject
.
file
(
'local.properties'
).
newDataInputStream
())
def
mavenUserName
=
localProperties
.
getProperty
(
"MavenUsername"
)
def
mavenPassword
=
localProperties
.
getProperty
(
"MavenPassword"
)
/**
* 上传的仓库地址
*/
def
release_repository_url
=
"http://dailybuild2.yidian-inc.com:8088/repository/maven-releases/"
def
snapshot_repository_url
=
"http://dailybuild2.yidian-inc.com:8088/repository/maven-snapshots/"
task
generateSourcesJar
(
type:
Jar
)
{
from
android
.
sourceSets
.
main
.
java
.
srcDirs
classifier
'sources'
}
afterEvaluate
{
publishing
{
publications
{
Production
(
MavenPublication
)
{
from
components
.
release
groupId
rootProject
.
ext
.
group_id
artifactId
rootProject
.
ext
.
artifact_id
version
rootProject
.
ext
.
version_name
// 上传source,这样使用放可以看到方法注释
artifact
generateSourcesJar
}
}
repositories
{
// 定义 maven远程 仓库
maven
{
// 可以有且仅有一个仓库不指定 name 属性,会隐式设置为 Maven
name
=
version_name
.
endsWith
(
'SNAPSHOT'
)
?
"pbSnapshots"
:
"pbReleases"
// 根据 versionName 来判断仓库地址
url
=
version_name
.
endsWith
(
'SNAPSHOT'
)
?
snapshot_repository_url
:
release_repository_url
// 仓库用户名密码
credentials
{
username
=
mavenUserName
password
=
mavenPassword
}
}
// 定义 mavenLocal 仓库
mavenLocal
{
name
=
"pbMavenLocal"
url
=
uri
(
'../../repo'
)
}
}
}
}
\ 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