Skip to main content

上传代码到Jcent仓库

首先需要注册jcent账号,注意选择 Sign Up to an Open Source account ,否则将会是一个收费的账号。如下图所示:





进入正题

1. 首先需要在项目的build.gradle添加 classpath 'com.novoda:bintray-release:0.9.1'

2.在需要上传的库的build.gradle添加下面的几句代码
apply plugin: 'com.novoda.bintray-release'

publish {
    repoName = 'saas'//远程仓库名字,不指明,默认是上传到maven
    userOrg = 'tiger'//bintray.com用户名
    groupId = 'com.tiger.saas.widget'//jcenter上的路径,bintray上创建Package时填写的Version control项
    artifactId = 'charts'//项目名称,bintray上创建Package时填写的Name项
    publishVersion = '0.0.1'//版本号
    desc = 'saas charts library'
    website = 'https://github.com/ChinaVolvocars/Charts_App'
}


3. 使用下面的命令上传即可

#### 上传命令
```gradlew
#### 上传命令
```gradlew
gradlew generatePomFileForReleasePublication
gradlew publishReleasePublicationToMavenLocal
gradlew bintrayUpload -PbintrayUser=xxx -PbintrayKey=xxx -PdryRun=false
```
注意:-PbintrayUser=xxx 这几个xxx是用户名,-PbintrayKey=xxx 这几个xxx是key
### 组成
```
GROUP_ID:ARTIFACT_ID:VERSION
```

Popular posts from this blog

MediaStore.Images.保存图片时生成两张图片的问题 并且在oppo手机上时间是1970-01-01 08:00:00

MediaStore.Images.保存图片时生成两张图片的问题 并且在oppo手机上时间是1970-01-01 08:00:00 正确方式如下 使用方式一 private void saveImage( String originFilePath) { File appDir = new File ( Environment . getExternalStorageDirectory() . getPath() + " /leikebaijing/images " ); if ( ! appDir . exists()) appDir . mkdirs(); String fileName; long dateTaken = System . currentTimeMillis(); if (originFilePath . contains( " / " )) { fileName = originFilePath . substring(originFilePath . lastIndexOf( " / " ) + 1 ); } else { fileName = dateTaken + " jpg " ; } File file = new File (appDir, fileName); if ( ! file . exists()) { try { file . createNewFile(); } catch ( IOException e) { e . printStackTrace(); }

Android 自动打渠道包工具(walle+自动化)

AutomaticPackagingTool Android 自动打渠道包工具,使用 python 3.7  使用之前必须安装并配置相关环境(Java、Android、Python) 自动化打包操作流程 1.  在 Android 项目的根目录 build.gradle 文件中添加 Walle Gradle 插件的依赖, 如下: buildscript { dependencies { classpath ' com.meituan.android.walle:plugin:1.1.6 ' } } 当前 app 的 build.gradle 文件中 apply 这个插件,并添加上用于读取渠道号的AAR apply plugin : ' walle ' dependencies { implementation ' com.meituan.android.walle:library:1.1.6 ' } 通过以下代码获取渠道信息 String channel = WalleChannelReader . getChannel( this . getApplicationContext()); 2.  打一个签名的apk 3.  将项目中的 jks 文件、channel 文件(如果没有请新建一个)、打包好的 apk 文件拷贝到 apk 目录里面 4.  在 python 中配置信息 # android_build_tools 路径 android_build_tools_path = ' D:/DevelopmentTools/Android/SDK/build-tools/28.0.0/ ' # 生成的文件名 target_file_name = ' AP ' # jks keystore_password keystore_password = " 123456 " # jks 别名 key_alias = " AutomaticPackaging " # jks key_password key