【发布时间】:2018-04-10 16:34:10
【问题描述】:
我正在尝试使用 bintray 发布我的 android 库,但最终在 bintray maven stringx 和 stringx-android-sdk 中有两个单独的工件: https://dl.bintray.com/klimaszewski/stringx/io/stringx/ 来源和所有东西都放在这里: https://dl.bintray.com/klimaszewski/stringx/io/stringx/stringx/1.0.2/
并且 POM 文件被放置在正确的工件中: https://dl.bintray.com/klimaszewski/stringx/io/stringx/stringx-android-sdk/1.0.2/
我的 bintray 存储库是:stringx 和库名称:stringx-android-sdk
由于该库无法在我的项目中解决。这里有什么问题? build.gradle
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
}
}
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
ext {
bintrayRepo = 'stringx'
bintrayName = 'stringx-android-sdk'
publishedGroupId = 'io.stringx'
libraryName = 'StringX-SDK'
artifact = 'stringx-android-sdk'
libraryDescription = 'Automatic app Translation for Android'
siteUrl = 'https://www.stringx.io'
gitUrl = 'https://github.com/SzyQ/stringx-android-sdk'
developerId = 'klimaszewski'
developerName = 'Szymon Klimaszewski'
developerEmail = 'klimaszewski.szymon@gmail.com'
licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]
versionMajor = 1
versionMinor = 0
versionHotFix = 2
libraryVersion = buildVersionName()
}
android {
compileSdkVersion 27
buildToolsVersion "26.0.2"
defaultConfig {
minSdkVersion 16
targetSdkVersion 27
versionCode buildVersionCode()
versionName buildVersionName()
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:support-annotations:27.0.0'
}
def buildVersionName() {
String versionName
if (versionHotFix == null || versionHotFix == 0) {
versionName = versionMajor + "." + versionMinor
} else {
versionName = versionMajor + "." + versionMinor + "." + versionHotFix
}
println "Version name: " + versionName
return versionName
}
def buildVersionCode() {
Integer versionCode
if (versionHotFix == null || versionHotFix == 0) {
versionCode = versionMajor * 10000 + versionMinor * 100
} else {
versionCode = versionMajor * 10000 + versionMinor * 100 + versionHotFix
}
println "Version code: " + versionCode
return versionCode
}
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle'
【问题讨论】:
标签: android android-library bintray android-maven-plugin