Skip to content

Commit

Permalink
added bintray upload
Browse files Browse the repository at this point in the history
  • Loading branch information
musketyr committed Nov 21, 2015
1 parent e97f037 commit 9cce6a5
Showing 1 changed file with 70 additions and 24 deletions.
94 changes: 70 additions & 24 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
}
}

apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'

group = 'org.duckapter'
version = '0.8.0'
version = '0.8.1'

sourceCompatibility=1.6
targetCompatibility=1.6
Expand All @@ -14,33 +25,68 @@ dependencies {
testCompile 'junit:junit:4.8.2'
}

/* modifyPom {
project {
name 'Duckapter'
description 'Duck typing support for Java'
url 'https://github.com/musketyr/duckapter'
inceptionYear '2009'
jar {
manifest.attributes provider: 'gradle'
}

scm {
url 'https://github.com/musketyr/duckapter'
connection 'scm:https://[email protected]/musketyr/duckapter.git'
developerConnection 'scm:git://github.com/musketyr/duckapter.git'
}
// publishing
publishing {
publications {
groovyMaven(MavenPublication) {
from components.java

licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
artifact sourcesJar {
classifier "sources"
}
}

developers {
developer {
id 'vorany'
name 'Vladimir Orany'
email '[email protected]'
artifact javadocJar {
classifier "javadoc"
}
}
}
}*/
}

// set bintrayUser & bintrayKey in gradle.properties
bintray {

user = getPropertyOrUseDefault('bintrayUser', 'fake_user')
key = getPropertyOrUseDefault('bintrayKey', 'fake_key')
publications = ['groovyMaven']

def projectName = project.name
def projectDescription = project.description

pkg {
websiteUrl = 'https://code.google.com/p/duckapter/'
issueTrackerUrl = 'https://github.com/musketyr/duckapter/issues'
vcsUrl = 'https://github.com/musketyr/duckapter/issues.git'

repo = 'maven' // or your repo name
userOrg = 'musketyr'
name = projectName // somehow project.* doesn't work in this closure
desc = projectDescription
licenses = ['Apache-2.0']
}
// dryRun = true // whether to run this as dry-run, without deploying
}

// custom tasks for creating source/javadoc jars
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives sourcesJar, javadocJar
}

bintrayUpload.dependsOn test

String getPropertyOrUseDefault(String propertyName, String defaultValue) {
hasProperty(propertyName) ? getProperty(propertyName) : defaultValue
}

0 comments on commit 9cce6a5

Please sign in to comment.