The first step:
create a new project, create your own library module.
In the library, only to return a string of tools, just to test. Add this app relies on the normal operation.
Step:
Add build.gradle dependencies in a project
classpath 'com.novoda: bintray-release: 0.9.1'
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.novoda:bintray-release:0.9.1'
}
Github dependent on the official website of the latest version, you can modify the latest version:
GitHub official website: https://github.com/novoda/bintray-release
Finished adding sync bit, as shown below:
The third step:
to register bintray, registered URL https://bintray.com/signup/oss
with github or Google account registration will do, but can not verify when or 163 qq mailbox. I use gmail mailbox. Log by the following:
Click Add New Repository to create a new repository, I have established good.
Fill out the information as shown on the line. Then create a new warehouse in a package
to this file submission warehouse has been created
to take note that this and fill in the Name, and the name of the configuration to be behind android studio unanimous. Otherwise upload will fail.
Step Four:
Configure androidstudio upload information:
Open to upload module in build.gradle.
Added at the top:
apply plugin: 'com.novoda.bintray-release'
At the end add:
publish {
userOrg = 'yinzhipengwork' //bintray.com 账号用户名
groupId = 'com.yzpUtils' //唯一 id,最后依赖的库名组成部分之一
artifactId = 'StringUtillib' //仓库名
publishVersion = '1.0.0' //版本号
desc = 'hello jcenter' //描述
website = 'https://github.com/YZP0721' //开源项目网址
}
As shown below:
userOrg bintray use your registered name, artifactId create a package you use to fill in the name before. You can refer to the following diagram:
Step Five:
Upload library:
in android studio console
run the following command:
gradlew Clean Build bintrayUpload -PbintrayUser = XXXX XXXXX = -PbintrayKey to false -PdryRun =
There are two values, and by acquiring:
PbintrayUser your registered name, that userOrg value.
PbintrayKey is the value of your APIkey.
run! ! Upload successful! The following figure:
you can see the information has been uploaded.
Here is how:
go bintray can see the items you just uploaded.
Then you can create a test project:
because we upload the project has not been submitted to jcenter review, we do also need to add maven:
Add (that is, the icon out of the address) in build.gradle project
maven { url 'https://dl.bintray.com/yinzhipengwork/maven' }
Add rely on build.gradle app module's (also on the icon out of the address)
implementation 'com.yzpUtils:StringUtillib:1.0.0'
Run the code:
string package before returning success to get the perfect Sahua.
There is one final step:
submit jcenter:
Audit Success can be used directly after
implementation 'com.yzpUtils:StringUtillib:1.0.0'
This line of code can be referenced, you do not need a maven.