Trying to fix publishing stuff...

Signed-off-by: Jonas Kalderstam <jonas@kalderstam.se>
This commit is contained in:
Jonas Kalderstam 2015-04-28 12:34:54 +02:00
parent 7926f8058b
commit 408fd6d658
5 changed files with 135 additions and 18 deletions

View File

@ -0,0 +1,84 @@
// ./gradlew clean build generateRelease
apply plugin: 'maven'
def groupId = project.GROUP
def artifactId = project.POM_ARTIFACT_ID
def version = project.VERSION_NAME
def localReleaseDest = "${buildDir}/release/${version}"
task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
ext.androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar"
classpath += files(ext.androidJar)
}
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
classifier = 'javadoc'
from androidJavadocs.destinationDir
}
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
uploadArchives {
repositories.mavenDeployer {
pom.groupId = GROUP
pom.artifactId = POM_ARTIFACT_ID
pom.version = VERSION_NAME
// Add other pom properties here if you want (developer details / licenses)
repository(url: "file://${localReleaseDest}")
pom.project {
name POM_NAME
packaging POM_PACKAGING
description POM_DESCRIPTION
url POM_URL
scm {
url POM_SCM_URL
connection POM_SCM_CONNECTION
developerConnection POM_SCM_DEV_CONNECTION
}
licenses {
license {
name POM_LICENCE_NAME
url POM_LICENCE_URL
distribution POM_LICENCE_DIST
}
}
developers {
developer {
id POM_DEVELOPER_ID
name POM_DEVELOPER_NAME
email POM_DEVELOPER_EMAIL
}
}
}
}
}
task zipRelease(type: Zip) {
from localReleaseDest
destinationDir buildDir
archiveName "release-${version}.zip"
}
task generateRelease << {
println "Release ${version} can be found at ${localReleaseDest}/"
println "Release ${version} zipped can be found ${buildDir}/release-${version}.zip"
}
generateRelease.dependsOn(uploadArchives)
generateRelease.dependsOn(zipRelease)
artifacts {
archives androidSourcesJar
archives androidJavadocsJar
}

View File

@ -2,23 +2,27 @@
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.5.1"
//classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.5.1"
//classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.1'
//classpath 'com.github.dcendents:android-maven-plugin:1.2'
}
}
allprojects {
repositories {
mavenCentral()
jcenter()
}
}
apply plugin: 'io.codearte.nexus-staging'
//apply plugin: 'com.jfrog.bintray'
nexusStaging {
packageGroup = "com.nononsenseapps"
//apply plugin: 'io.codearte.nexus-staging'
//nexusStaging {
// packageGroup = "com.nononsenseapps"
//stagingProfileId = "yourStagingProfileId" //when not defined will be got from server using "packageGroup"
}
//}

View File

@ -49,12 +49,14 @@ afterEvaluate { project ->
pom.artifactId = POM_ARTIFACT_ID
pom.version = VERSION_NAME
repository(url: "file:///home/jonas/workspace/NoNonsenseFilePicker/release/")
/*
repository(url: getReleaseRepositoryUrl()) {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
}
snapshotRepository(url: getSnapshotRepositoryUrl()) {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
}
}*/
pom.project {
name POM_NAME
@ -93,7 +95,8 @@ afterEvaluate { project ->
}
task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.getSrcDirs()
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
@ -103,7 +106,7 @@ afterEvaluate { project ->
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.getSrcDirs()
from android.sourceSets.main.java.srcDirs
}
artifacts {

View File

@ -4,16 +4,20 @@ VERSION_NAME=2.0.1
VERSION_CODE=11
GROUP=com.nononsenseapps
POM_NAME=NoNonsense-FilePicker
POM_DESCRIPTION=An extendable Android file/directory-picker you can include in your app
POM_URL=https://github.com/spacecowboy/NoNonsense-FilePicker
POM_SCM_URL=https://github.com/spacecowboy/NoNonsense-FilePicker
POM_SCM_CONNECTION=scm:git@github.com:spacecowboy/NoNonsense-FilePicker.git
POM_SCM_DEV_CONNECTION=scm:git@github.com:spacecowboy/NoNonsense-FilePicker.git
POM_LICENCE_NAME=GNU Lesser General Public License Version 3
POM_LICENCE_NAME=LGPL-3.0
POM_LICENCE_URL=https://www.gnu.org/licenses/lgpl.txt
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=neckbeard
POM_DEVELOPER_NAME=Jonas Kalderstam
POM_DEVELOPER_EMAIL=jonas@kalderstam.se
POM_URL_ISSUES=https://github.com/spacecowboy/NoNonsense-FilePicker/issues
ANDROID_BUILD_TARGET_SDK_VERSION=21
ANDROID_BUILD_TOOLS_VERSION=22.0.1

View File

@ -4,11 +4,6 @@ android {
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION
lintOptions {
abortOnError false
}
defaultConfig {
minSdkVersion 14
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
@ -31,6 +26,33 @@ dependencies {
compile 'com.android.support:recyclerview-v7:22.1.1'
}
/*
bintray {
user = bintrayUser
key = bintrayKey
dryRun=true
configurations = ['archives']
pkg {
repo = "maven"
name = POM_NAME
desc = POM_DESCRIPTION
websiteUrl = POM_URL
vcsUrl = POM_SCM_URL
issueTrackerUrl = POM_URL_ISSUES
labels = ['android', 'library', 'filepicker']
licenses = ["LGPL-3.0"]
publish = true
version {
name = VERSION_NAME
vcsTag = 'v' + VERSION_NAME
}
}
}
*/
// apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle'
// Need to change alljava to java
apply from: '../gradle-mvn-push.gradle'
// apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle'
apply from: '../android-release-aar.gradle'