Permalink
Browse files

:)

  • Loading branch information...
gektor650 committed Oct 16, 2018
1 parent 3d2a134 commit eba730866574dc9df476b15d7472a87687a4d892
Showing with 145 additions and 86 deletions.
  1. +2 −4 build.gradle
  2. +4 −19 okprofiler/build.gradle
  3. +139 −63 okprofiler/jcenter.gradle
@@ -1,17 +1,15 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.2.71'

repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
@@ -1,5 +1,4 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 28
@@ -13,7 +12,6 @@ android {
versionName "0.1"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
buildConfigField "String", "LOG_PREFIX", "\"_OKPRFL:\""
}

buildTypes {
@@ -30,19 +28,6 @@ android {

}

task deleteJar(type: Delete) {
delete 'libs/jars/okprofiler.jar'
}

task createJar(type: Copy) {
from('build/intermediates/bundles/release/')
into('libs/jars/')
include('classes.jar')
rename('classes.jar', 'okprofiler.jar')
}

createJar.dependsOn(deleteJar, build)

dependencies {
api 'com.squareup.okhttp3:okhttp:3.10.0'
testImplementation 'junit:junit:4.12'
@@ -75,7 +60,7 @@ ext {
allLicenses = ["Apache-2.0"]
}


apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
apply from: './jcenter.gradle'
apply from: 'jcenter.gradle'
//apply plugin: 'com.github.dcendents.android-maven'
//apply plugin: 'com.jfrog.bintray'
//apply from: './jcenter.gradle'
@@ -1,80 +1,156 @@
group = publishedGroupId
version = libraryVersion
//https://github.com/bintray/bintray-examples/blob/master/gradle-bintray-plugin-examples/android-gradle-3.0.0-maven-example/app/publish.gradle

install {
repositories.mavenInstaller {
pom.project {
packaging 'aar'
groupId publishedGroupId
artifactId artifact
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'

name libraryName
description libraryDescription
url siteUrl
version '1.0.0'
group 'com.bintray'

licenses {
license {
name licenseName
url licenseUrl
}
}
developers {
developer {
id developerId
name developerName
email developerEmail
publishing {
publications {
Production(MavenPublication) {
artifact("$buildDir/outputs/aar/app-release.aar")
groupId
artifactId 'example'
version this.version

pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')

// Iterate over the implementation dependencies (we don't want the test ones), adding a <dependency> node for each
configurations.implementation.allDependencies.each {
// Ensure dependencies such as fileTree are not included in the pom.
if (it.name != 'unspecified') {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}

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))
}

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

artifacts {
archives javadocJar
archives sourcesJar
}

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")

user = project.hasProperty('bintrayUser') ?: System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ?: System.getenv('BINTRAY_API_KEY')
publications = ['Production']
configurations = ['archives']
override = true
pkg {
repo = bintrayRepo
name = bintrayName
desc = libraryDescription
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = allLicenses
dryRun = false
repo = 'maven'
name = 'example'
description = "An example of using the bintray plugin with gradle plugin 3.0.0"
publish = true
override = false
publicDownloadNumbers = true
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/bintray/gradle-bintray-plugin.git'
dryRun = true
version {
desc = libraryDescription
name = this.version
desc = "Example ${this.version}"
released = new Date()
vcsTag = this.version
}
}
}
}


//group = publishedGroupId
//version = libraryVersion
//
//task writeNewPom {
// pom {
// project {
// packaging 'aar'
// name libraryName
// url siteUrl
// licenses {
// license {
// name licenseName
// url licenseUrl
// distribution gitUrl
// }
// }
// }
// }.writeTo("$buildDir/poms/pom-default.xml")
//}
//
//install {
// repositories.mavenInstaller {
// pom.project {
// packaging 'aar'
// groupId publishedGroupId
// artifactId artifact
//
// name libraryName
// description libraryDescription
// url siteUrl
//
// licenses {
// license {
// name licenseName
// url licenseUrl
// }
// }
// developers {
// developer {
// id developerId
// name developerName
// email developerEmail
// }
// }
// scm {
// connection gitUrl
// developerConnection gitUrl
// url siteUrl
// }
// }
// }
//}
//
//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))
//}
//
//task javadocJar(type: Jar, dependsOn: javadoc) {
// classifier = 'javadoc'
// from javadoc.destinationDir
//}
//
//artifacts {
// archives javadocJar
// archives sourcesJar
//}
//
//Properties properties = new Properties()
//properties.load(project.rootProject.file('local.properties').newDataInputStream())
//
//bintray {
// user = properties.getProperty("bintray.user")
// key = properties.getProperty("bintray.apikey")
//
// configurations = ['archives']
// pkg {
// repo = bintrayRepo
// name = bintrayName
// desc = libraryDescription
// websiteUrl = siteUrl
// vcsUrl = gitUrl
// licenses = allLicenses
// dryRun = false
// publish = true
// override = false
// publicDownloadNumbers = true
// version {
// desc = libraryDescription
// }
// }
//}

0 comments on commit eba7308

Please sign in to comment.