Skip to content

Commit

Permalink
Add gradle task for bintray upload
Browse files Browse the repository at this point in the history
  • Loading branch information
fornwall committed Apr 2, 2017
1 parent e814e07 commit dd046d8
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 1 deletion.
101 changes: 101 additions & 0 deletions bintray-upload.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
// Start https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle
apply plugin: 'com.github.dcendents.android-maven'
group = publishedGroupId // Maven Group ID for the artifact
install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
groupId publishedGroupId
artifactId artifact

// Add your description here
name libraryName
description libraryDescription
url siteUrl

// Set your license
licenses {
license {
name licenseName
url licenseUrl
}
}
developers {
developer {
id developerId
name developerName
email developerEmail
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl

}
}
}
}
}
// End https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle

// Start https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle
// (modified to use system property instead of property file)
apply plugin: 'com.jfrog.bintray'

version = libraryVersion

if (project.hasProperty("android")) { // Android libraries
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}

task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
} else { // Java libraries
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 javadocJar
archives sourcesJar
}

bintray {
user = System.getenv('BINTRAY_USERNAME')
key = System.getenv('BINTRAY_API_KEY')

configurations = ['archives']
pkg {
repo = bintrayRepo
name = bintrayName
userOrg = bintrayUserOrg
desc = libraryDescription
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = allLicenses
publish = true
publicDownloadNumbers = true
version {
desc = libraryDescription
gpg {
sign = false //Determines whether to GPG sign the files. The default is false
// passphrase = properties.getProperty("bintray.gpg.password")
}
}
}
}
// End https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle
32 changes: 32 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
plugins {
id "com.jfrog.bintray" version "1.7"
id "com.github.dcendents.android-maven" version "1.5"
}

apply plugin: 'java'

ext {
bintrayRepo = 'maven'
bintrayName = 'jelf'
bintrayUserOrg = 'fornwall'

publishedGroupId = 'net.fornwall.jelf'
libraryName = 'JElf'
artifact = 'jelf'

libraryDescription = 'ELF parsing library in java'

siteUrl = 'https://github.com/fornwall/jelf'
gitUrl = 'https://github.com/fornwall/jelf.git'

libraryVersion = '0.1'

developerId = 'fornwall'
developerName = 'Fredrik Fornwall'
developerEmail = '[email protected]'

licenseName = 'MIT License'
licenseUrl = 'https://opensource.org/licenses/MIT'
allLicenses = ['MIT']
}

repositories {
jcenter()
}
Expand All @@ -13,3 +43,5 @@ test {
println "Test ${desc.name} [${desc.className}] result: ${result.resultType}"
}
}

apply from: 'bintray-upload.gradle'
2 changes: 1 addition & 1 deletion src/main/java/net/fornwall/jelf/ElfFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public final class ElfFile {

/** No architecture type. */
public static final int ARCH_NONE = 0;
/** AT&T architecture type. */
/** AT&T architecture type. */
public static final int ARCH_ATT = 1;
/** SPARC architecture type. */
public static final int ARCH_SPARC = 2;
Expand Down

0 comments on commit dd046d8

Please sign in to comment.