diff --git a/.travis.yml b/.travis.yml index 4ab8d99..c3241ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,3 +23,5 @@ before_install: install: true +after_success: + - ./deploy.sh diff --git a/build.gradle b/build.gradle index d9c5b01..dd0475f 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,8 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:2.2.3' - + classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } @@ -16,6 +17,8 @@ allprojects { repositories { jcenter() } + apply plugin: 'maven' + apply plugin: 'maven-publish' } diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..8e34148 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,5 @@ +#!/bin/bash +if [ "$TRAVIS_BRANCH" == "master" ]; then + echo $TRAVIS_BRANCH; + ./gradlew install bintrayUpload; +fi \ No newline at end of file diff --git a/trustkit/build.gradle b/trustkit/build.gradle index 7a54a92..697edef 100644 --- a/trustkit/build.gradle +++ b/trustkit/build.gradle @@ -1,10 +1,30 @@ apply plugin: 'com.android.library' +ext { + userorg = "" + bintrayRepo = 'TrustKit-Android' + bintrayName = 'trustkit' + + publishedGroupId = 'com.datatheorem.android.trustkit' + libraryName = 'TrustKit-Android' + artifact = 'trustkit' + + libraryDescription = 'TrustKit Android is an open source library that makes it easy to deploy SSL public key ' + + 'pinning and reporting in any Android App.' + gitUrl = 'https://github.com/datatheorem/TrustKit-Android' + websiteUrl = 'https://github.com/datatheorem/TrustKit-Android' + + libraryVersion = trustkitVersionName + + licenseName = 'The MIT License (MIT)' + licenseUrl = 'https://github.com/datatheorem/TrustKit-Android/blob/master/LICENSE' + allLicenses = ["MIT"] +} + repositories { mavenCentral() } - dependencies { compile "com.android.support:support-annotations:$rootProject.libVersions.android.appCompat" compile "com.android.support:support-v4:$rootProject.libVersions.android.appCompat" @@ -30,3 +50,85 @@ android { } } + +apply plugin: 'com.github.dcendents.android-maven' +group = publishedGroupId + +install { + repositories.mavenInstaller { + pom { + project { + packaging 'aar' + groupId publishedGroupId + artifactId artifact + + name libraryName + description libraryDescription + url websiteUrl + + licenses { + license { + name licenseName + url licenseUrl + } + } + + developers { + developer { + id 'nabla-c0d3' + name 'Alban Diquet' + email 'ad@datatheorem.com' + } + + developer { + id 'jobot0' + name 'Jordan Bouellat' + email 'jb@datatheorem.com' + } + } + + scm { + connection gitUrl + developerConnection gitUrl + url websiteUrl + } + } + } + } +} + +apply plugin: 'com.jfrog.bintray' + +version = libraryVersion +// Create artifacts from the source +task sourcesJar(type: Jar) { + classifier = 'sources' + from android.sourceSets.main.java.srcDirs +} + +artifacts { + archives sourcesJar +} + +bintray { + user = System.getenv('BINTRAY_USER') + key = System.getenv('BINTRAY_KEY') + userorg = System.getenv('BINTRAY_USERORG') + + configurations = ['archives'] + pkg { + repo = bintrayRepo + name = bintrayName + userOrg = userorg + desc = libraryDescription + websiteUrl = websiteUrl + vcsUrl = gitUrl + licenses = allLicenses + publish = true + version { + name = libraryVersion + desc = libraryDescription + } + } +} +