Reputation: 4002
I am following this tutorial https://antoniocappiello.com/2015/11/11/publish-your-library-to-jcenter-in-3-steps/to publish my first lib, and i have managed to resolve issues encountered with every step except for the last one.
After doing a ./gradlew install
, and then when i run ./gradlew bintrayUpload
It build successfully BUT doesn't upload my files. I have an option where i can begin to manually upload files in bintray, but then thats what the ./gradlew bintrayUpload
is meant to do.
So perhaps, my gradle settings are wrong.
This is my Top level build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven {
url "http://dl.bintray.com/myUsername/myLibraryName"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
My module build.gradle
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
repositories {
mavenCentral()
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
apply from: 'install.gradle'
apply from: 'bintray.gradle'
My Install.gradle file
apply plugin: 'com.github.dcendents.android-maven'
group = 'com.libraryname.v1' // CREATE A GROUP ID FOR YOUR LIBRARY
install {
repositories.mavenInstaller {
pom {
project {
packaging 'aar'
groupId 'com.libraryname.v1' // CREATE A GROUP ID FOR YOUR LIBRARY
artifactId 'ArtifactId' // THE NAME OF YOUR MODULE
name 'myLibraryName' // YOUR LIBRARY NAME
description 'my library description.' // YOUR LIBRARY DESCRIPTION
url 'https://github.com/username/myLibraryName' // YOUR SITE
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'MyID' //YOUR ID
name 'MyName' //YOUR NAME
email '[email protected]' //YOUR EMAIL
}
}
scm {
connection 'https://github.com/username/myLibraryName.git' // YOUR GIT REPO
developerConnection 'https://github.com/username/myLibraryName.git' // YOUR GIT REPO
url 'https://github.com/username/myLibraryName' // YOUR SITE
}
}
}
}
}
My bintray.gradle
apply plugin: 'com.jfrog.bintray'
version = '0.0.1' //YOUR LIBRARY VERSION
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))
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar
archives sourcesJar
}
// Bintray
bintray {
Properties properties = new Properties()
properties.load( new FileInputStream("local.properties"))
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
pkg {
repo = 'libraryName'
name = 'com.libraryName.v1' //YOUR PACKAGE NAME
desc = 'my library description.' // YOUR LIBRARY DESCRIPTION
websiteUrl = 'https://github.com/username/libraryName' // YOUR SITE
vcsUrl = 'https://github.com/username/libraryName.git' // YOUR GIT REPO
licenses = ["Apache-2.0"] // A LIST OF YOUR LICENCES
publish = true
publicDownloadNumbers = true
}
}
Upvotes: 3
Views: 1363