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 4763138 commit 4e06a4b
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 339 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ google-services.json
freeline.py
freeline/
freeline_project_description.json

.idea/
# fastlane
fastlane/report.xml
fastlane/Preview.html
Expand Down
29 changes: 0 additions & 29 deletions .idea/codeStyles/Project.xml

This file was deleted.

78 changes: 0 additions & 78 deletions .idea/markdown-navigator.xml

This file was deleted.

38 changes: 0 additions & 38 deletions .idea/misc.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/modules.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

118 changes: 2 additions & 116 deletions YCRedDotViewLib/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
apply plugin: 'com.android.library'
//迁移到jitpack
apply plugin: 'com.github.dcendents.android-maven'

android {
compileSdkVersion 26
Expand All @@ -25,119 +27,3 @@ dependencies {
implementation 'com.android.support:design:26.1.0'
}


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

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

//发布到组织名称名字,必须填写
group = "cn.yc"
//发布到JCenter上的项目名字,必须填写
def libName = "YCRedDotViewLib"
// 版本号,下次更新是只需要更改版本号即可
version = "1.0.3"
/** 上面配置后上传至jCenter后的编译路径是这样的: compile 'cn.yc:YCRedDotViewLib: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 red dot view 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 red dot 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"
}
}
9 changes: 2 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,8 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'


// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
//添加下面两句,进行配置
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
//jitpack
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Tue Jun 05 18:31:56 CST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
Loading

0 comments on commit 4e06a4b

Please sign in to comment.