Skip to content

Commit

Permalink
mavenCentral
Browse files Browse the repository at this point in the history
  • Loading branch information
zguop committed Jun 18, 2021
1 parent dcd5d31 commit a1b449b
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 44 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,13 @@ ViewPager2是androidx中的

Gradle
```groovy
repositories {
mavenCentral()
}
dependencies{
implementation 'com.to.aboomy:pager2banner:1.0.3' //最新版本
//已迁移至mavenCentral
implementation 'io.github.zguop:pager2Banner:1.0.5'
}
```
或者引用本地lib
Expand Down
2 changes: 1 addition & 1 deletion banner/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ android {
dependencies {
compileOnly 'androidx.viewpager:viewpager:1.0.0'
}
apply from:"${rootProject.projectDir}/uploadBintray.gradle"
apply from: rootProject.file('publishing.gradle')
30 changes: 11 additions & 19 deletions banner/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
# 包的GroupId
BINTRAY_PKG_GROUP_ID=com.to.aboomy
PKG_GROUP_ID=io.github.zguop
# 包的ArtifactId
BINTRAY_PKG_ARTIFACT_ID=banner
PKG_ARTIFACT_ID=banner
# 包的版本号,下次更新是只需要更改版本号即可
BINTRAY_PKG_VERSION=3.1.5-x
# 包的打包方式 aar/jar
BINTRAY_PKG_PACKAGING=aar
# bintray上的仓库名
BINTRAY_PKG_REPO=maven
# 组织名 不填默认为用户
BINTRA_PKG_USER_ORG=
# 发布到JCenter上的项目名字
BINTRAY_PKG_NAME=banner
# 项目主页
BINTRAY_PKG_WEBSITE_URL=https://github.com/zguop/banner
# 项目的版本控制地址(git/svn等)
BINTRAY_PKG_VCSURL=https://github.com/zguop/banner
PKG_VERSION=3.1.5
# 项目描述
BINTRAY_PKG_DESC=banner
PKG_DESC=banner是一个轮播控件
# 开发者Id
BINTRAY_PKG_DEVELOPER_ID=a13706649811
PKG_DEVELOPER_ID=[email protected]
# 开发者名字
BINTRAY_PKG_DEVELOPER_NAME=waitou
PKG_DEVELOPER_NAME=utomi
# 开发者邮箱
BINTRAY_PKG_DEVELOPER_EMAIL=[email protected]
PKG_DEVELOPER_EMAIL=[email protected]
# 项目主页
PKG_WEBSITE_URL=https://github.com/zguop/banner
# 项目的版本控制地址(git/svn等)
PKG_VCSURL=https://github.com/zguop/banner.git
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ buildscript {

repositories {
google()
mavenCentral()
jcenter()
maven {
url "https://jitpack.io"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.android.tools.build:gradle:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand All @@ -20,6 +20,7 @@ buildscript {
allprojects {
repositories {
google()
mavenCentral()
jcenter()
maven {
url "https://jitpack.io"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
2 changes: 1 addition & 1 deletion pager2banner/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ dependencies {
compileOnly "androidx.viewpager2:viewpager2:1.0.0"
}

apply from:"${rootProject.projectDir}/uploadBintray.gradle"
apply from: rootProject.file('publishing.gradle')
30 changes: 11 additions & 19 deletions pager2banner/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
# 包的GroupId
BINTRAY_PKG_GROUP_ID=com.to.aboomy
PKG_GROUP_ID=io.github.zguop
# 包的ArtifactId
BINTRAY_PKG_ARTIFACT_ID=pager2banner
PKG_ARTIFACT_ID=pager2Banner
# 包的版本号,下次更新是只需要更改版本号即可
BINTRAY_PKG_VERSION=1.0.3
# 包的打包方式 aar/jar
BINTRAY_PKG_PACKAGING=aar
# bintray上的仓库名
BINTRAY_PKG_REPO=maven
# 组织名 不填默认为用户
BINTRA_PKG_USER_ORG=
# 发布到JCenter上的项目名字
BINTRAY_PKG_NAME=pager2Banner
# 项目主页
BINTRAY_PKG_WEBSITE_URL=https://github.com/zguop/banner
# 项目的版本控制地址(git/svn等)
BINTRAY_PKG_VCSURL=https://github.com/zguop/banner
PKG_VERSION=1.0.5
# 项目描述
BINTRAY_PKG_DESC=viewpager2 banner
PKG_DESC=banner是一个轮播控件
# 开发者Id
BINTRAY_PKG_DEVELOPER_ID=a13706649811
PKG_DEVELOPER_ID=[email protected]
# 开发者名字
BINTRAY_PKG_DEVELOPER_NAME=waitou
PKG_DEVELOPER_NAME=utomi
# 开发者邮箱
BINTRAY_PKG_DEVELOPER_EMAIL=[email protected]
PKG_DEVELOPER_EMAIL=[email protected]
# 项目主页
PKG_WEBSITE_URL=https://github.com/zguop/banner
# 项目的版本控制地址(git/svn等)
PKG_VCSURL=https://github.com/zguop/banner.git
104 changes: 104 additions & 0 deletions publishing.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
apply plugin: 'maven-publish'
apply plugin: 'signing'


// 包的GroupId
def pkgGroupId = PKG_GROUP_ID
// 包的ArtifactId
def pkgArtifactId = PKG_ARTIFACT_ID
// 包的版本号,下次更新是只需要更改版本号即可
def pkgVersion = PKG_VERSION
// 项目描述
def pkgDesc = PKG_DESC
// 开发者Id
def pkgDeveloperId = PKG_DEVELOPER_ID
// 开发者名字
def pkgDeveloperName = PKG_DEVELOPER_NAME
// 开发者邮箱
def pkgDeveloperEmail = PKG_DEVELOPER_EMAIL
// 项目主页
def pkgWebsiteUrl = PKG_WEBSITE_URL
//git地址
def pkgVcsUrl = PKG_VCSURL


tasks.register("sourceJar", Jar) {
from android.sourceSets.main.java.srcDirs
archiveClassifier.set('sources')
}

Properties localProps = new Properties()
File localProperties = new File(rootProject.rootDir, "local.properties")
if (localProperties.exists() && localProperties.isFile()) {
localProperties.withInputStream { localProps.load(it) }
}

project.ext["signing.keyId"] = localProps.getProperty("signing.keyId")
project.ext["signing.secretKeyRingFile"] = localProps.getProperty("signing.secretKeyRingFile")
project.ext["signing.password"] = localProps.getProperty("signing.password")

afterEvaluate {
publishing {
publications {
releaseAar(MavenPublication) {
from components.release
artifact sourceJar

groupId = pkgGroupId
artifactId = pkgArtifactId
version = pkgVersion

pom {
name = pkgArtifactId
description = pkgDesc
url = pkgWebsiteUrl

licenses {
license {
name = 'The Apache License, Version 2.0'
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}

developers {
developer {
id = pkgDeveloperId
name = pkgDeveloperName
email = pkgDeveloperEmail
}
}

scm {
url = pkgWebsiteUrl
connection = pkgVcsUrl
developerConnection = pkgVcsUrl
}
}
}
}

repositories {
maven {
name = "sonatypeStaging"
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = localProps.getProperty("ossrhUsername")
password = localProps.getProperty("ossrhPassword")
}
}

maven {
name = "sonatypeSnapshots"
url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
credentials {
username = localProps.getProperty("ossrhUsername")
password = localProps.getProperty("ossrhPassword")
}
}
}
}

signing {
sign(publishing.publications)
}
}

0 comments on commit a1b449b

Please sign in to comment.