introduce
This is a simple script that simplifies uploading to JCenter
Edit the gradle.properties file
The gradle.properties file has two places, one in the project itself and one in the system. I recommend that the same configuration be put directly into the system every time
#On a Mac, open terminal input (replace the username with your own)Vi/Users/username /. Gradle/gradle. PropertiesCopy the code
join
BINTRAY_USER=userName BINTRAY_KEY=apikey # DEVELOPER_ID=HANGOX DEVELOPER_NAME= HANGOX [email protected]
Copy the code
Exit and save the Settings.
Add references to both plug-ins
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'Com. Android. Tools. Build: gradle: 2.2.0'
classpath 'Com. Jfrog. Bintray. Gradle: gradle bintray - plugin: 1.7'
classpath 'Com. Making. Dcendents: android - maven - gradle - plugin: 1.5'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files}}Copy the code
Edit library build.gradle
Add in build.gradle of the module you want to upload
ext{
eGroup = 'com.hangox'
eArtifactId = 'polygon-imageview'
eName = "polygonImageView"
eDescription = ''
eVersion = '1.0'
eVcsUrl = 'https://github.com/hangox/PolygonImageView.git'
eVcsTag = 'v1.0' //Git tag name, which can be null
eWebsiteUrl = 'https://github.com/hangox/PolygonImageView'
}
//You are advised to comment out this line when it is not in use. Sometimes DNS cannot be found due to foreign DNS, resulting in compilation failure
apply from : "https://raw.githubusercontent.com/hangox/bintray-push/v1.0/upload.gradle"Copy the code
The final project references will be like this: eGroup: eArtifactId: eVersion for this project, I also is com. Hangox: polygon – imageview: 1.0
run
gradle bintrayUploadCopy the code
The application on jCenter was approved
gradle-publish