Skip to content

Commit

Permalink
迁移库到jitpack上
Browse files Browse the repository at this point in the history
  • Loading branch information
yangchong211 committed Dec 19, 2021
1 parent 6dc60bb commit ffcdd0d
Show file tree
Hide file tree
Showing 17 changed files with 84 additions and 507 deletions.
5 changes: 5 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions AppGradle/app.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
ext {

androidBuildToolsVersion = "29.0.0"
androidMinSdkVersion = 17
androidTargetSdkVersion = 29
androidCompileSdkVersion = 29


constraintLayoutVersion = '1.1.3'
appcompatVersion = '1.2.0'
annotationVersion = '1.1.0'
cardviewVersion = '1.0.0'
mediaVersion = '1.0.1'
recyclerviewVersion = '1.1.0'
swiperefreshlayoutVersion = '1.0.0'

/**主app-start*/
AppDependencies = [
constraintLayout : "androidx.constraintlayout:constraintlayout:${constraintLayoutVersion}",
appcompat : "androidx.appcompat:appcompat:${appcompatVersion}",
annotation : "androidx.annotation:annotation:${annotationVersion}",
cardview : "androidx.cardview:cardview:${cardviewVersion}",
media : "androidx.media:media:${mediaVersion}",
recyclerview : "androidx.recyclerview:recyclerview:${recyclerviewVersion}",
swiperefreshlayout : "androidx.swiperefreshlayout:swiperefreshlayout:${swiperefreshlayoutVersion}",

]

}
129 changes: 9 additions & 120 deletions PhotoCoverLib/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
apply plugin: 'com.android.library'
apply from: rootProject.projectDir.absolutePath + "/AppGradle/app.gradle"
apply plugin: 'com.github.dcendents.android-maven'


android {
compileSdkVersion 29
compileSdkVersion project.ext.androidCompileSdkVersion
buildToolsVersion project.ext.androidBuildToolsVersion

defaultConfig {
minSdkVersion 17
targetSdkVersion 29
minSdkVersion project.ext.androidMinSdkVersion
targetSdkVersion project.ext.androidTargetSdkVersion
versionCode 1
versionName "1.0"
}
Expand All @@ -21,124 +25,9 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation project.ext.AppDependencies['appcompat']
implementation project.ext.AppDependencies['recyclerview']
}



/** 以下开始是将Android Library上传到jcenter的相关配置**/
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

//项目主页
def siteUrl = 'https://github.com/yangchong211/YCPhotoCover' // project homepage
//项目的版本控制地址
def gitUrl = 'https://github.com/yangchong211/YCPhotoCover.git' // project git

//发布到组织名称名字,必须填写
group = "cn.yc"
//发布到JCenter上的项目名字,必须填写
def libName = "YCPhotoCoverLib"
// 版本号,下次更新是只需要更改版本号即可
version = "1.0.0"

//生成源文件
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
//生成文档
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
options.encoding "UTF-8"
options.charSet 'UTF-8'
options.author true
options.version true
options.links "https://github.com/linglongxin24/FastDev/tree/master/mylibrary/docs/javadoc"
failOnError false
}

//文档打包成jar
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
//拷贝javadoc文件
task copyDoc(type: Copy) {
from "${buildDir}/docs/"
into "docs"
}

//上传到jcenter所需要的源码文件
artifacts {
archives javadocJar
archives sourcesJar
}

// 配置maven库,生成POM.xml文件
install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
//项目描述,自由填写
name 'This is photo cover lib'
url siteUrl
licenses {
license {
//开源协议
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
//开发者的个人信息,根据个人信息填写
id 'yangchong'
name 'yc'
email '[email protected]'
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}

//上传到jcenter
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
bintray {
user = properties.getProperty("bintray.user") //读取 local.properties 文件里面的 bintray.user
key = properties.getProperty("bintray.apikey") //读取 local.properties 文件里面的 bintray.apikey
configurations = ['archives']
pkg {
repo = "maven"
name = libName //发布到JCenter上的项目名字,必须填写
desc = 'android photo cover' //项目描述
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["Apache-2.0"]
publish = true
}
}

javadoc {
options {
//如果你的项目里面有中文注释的话,必须将格式设置为UTF-8,不然会出现乱码
encoding "UTF-8"
charSet 'UTF-8'
author true
version true
links "http://docs.oracle.com/javase/7/docs/api"
}
}


Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.yc.cn.cover;
package com.yc.cover;

import android.animation.Animator;
import android.animation.ValueAnimator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.yc.cn.cover;
package com.yc.cover;

import android.content.Context;
import androidx.annotation.NonNull;
Expand Down
130 changes: 8 additions & 122 deletions RefreshViewLib/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
apply plugin: 'com.android.library'
apply from: rootProject.projectDir.absolutePath + "/AppGradle/app.gradle"
apply plugin: 'com.github.dcendents.android-maven'

android {
compileSdkVersion 29
buildToolsVersion "29.0.0"
compileSdkVersion project.ext.androidCompileSdkVersion
buildToolsVersion project.ext.androidBuildToolsVersion

defaultConfig {
minSdkVersion 17
targetSdkVersion 29
minSdkVersion project.ext.androidMinSdkVersion
targetSdkVersion project.ext.androidTargetSdkVersion
versionCode 13
versionName "2.5.9"
}
Expand All @@ -22,123 +24,7 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0'
}


/** 以下开始是将Android Library上传到jcenter的相关配置**/
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

//项目主页
def siteUrl = 'https://github.com/yangchong211/YCRefreshView' // project homepage
//项目的版本控制地址
def gitUrl = 'https://github.com/yangchong211/YCRefreshView.git' // project git

//发布到组织名称名字,必须填写
group = "org.yczbj"
//发布到JCenter上的项目名字,必须填写
def libName = "YCRefreshViewLib"
// 版本号,下次更新是只需要更改版本号即可
version = "2.5.9"
/** 上面配置后上传至jcenter后的编译路径是这样的: compile 'cn.yc:YCRefreshViewLib:2.5' **/

//生成源文件
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
//生成文档
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
options.encoding "UTF-8"
options.charSet 'UTF-8'
options.author true
options.version true
options.links "https://github.com/linglongxin24/FastDev/tree/master/mylibrary/docs/javadoc"
failOnError false
}

//文档打包成jar
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
//拷贝javadoc文件
task copyDoc(type: Copy) {
from "${buildDir}/docs/"
into "docs"
}

//上传到jcenter所需要的源码文件
artifacts {
archives javadocJar
archives sourcesJar
}

// 配置maven库,生成POM.xml文件
install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
//项目描述,自由填写
name 'This is refresh view'
url siteUrl
licenses {
license {
//开源协议
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
//开发者的个人信息,根据个人信息填写
id 'yangchong'
name 'yc'
email '[email protected]'
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}

//上传到jcenter
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
bintray {
user = properties.getProperty("bintray.user") //读取 local.properties 文件里面的 bintray.user
key = properties.getProperty("bintray.apikey") //读取 local.properties 文件里面的 bintray.apikey
configurations = ['archives']
pkg {
repo = "maven"
name = libName //发布到JCenter上的项目名字,必须填写
desc = 'android refresh view' //项目描述
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["Apache-2.0"]
publish = true
}
}

javadoc {
options {
//如果你的项目里面有中文注释的话,必须将格式设置为UTF-8,不然会出现乱码
encoding "UTF-8"
charSet 'UTF-8'
author true
version true
links "http://docs.oracle.com/javase/7/docs/api"
}
implementation project.ext.AppDependencies['recyclerview']
implementation project.ext.AppDependencies['swiperefreshlayout']
}

Loading

0 comments on commit ffcdd0d

Please sign in to comment.