Skip to content

Feat/android jcenter #130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Moby tracking SDK [![Build Status](https://travis-ci.org/O2MC/moby-tracking-sdk.svg?branch=master)](https://travis-ci.org/O2MC/moby-tracking-sdk)
# Moby tracking SDK [![Build Status](https://travis-ci.org/O2MC/moby-tracking-sdk.svg?branch=master)](https://travis-ci.org/O2MC/moby-tracking-sdk) [ ![Download](https://api.bintray.com/packages/edwinvrooij/moby-tracking-sdk-test/io.o2mc.sdk/images/download.svg) ](https://bintray.com/edwinvrooij/moby-tracking-sdk-test/io.o2mc.sdk/_latestVersion)

O2MC's mobile tracking SDK for collecting and measuring analytical events.

Expand Down
12 changes: 12 additions & 0 deletions android/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
all : deploy

clean :
bash gradlew :sdk:clean

deploy : install upload

install :
bash gradlew :sdk:install

upload :
bash gradlew :sdk:bintrayUpload
10 changes: 8 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ buildscript {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// start Bintray config
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
// end
}
}

Expand All @@ -22,6 +24,10 @@ allprojects {
}
}

task javadoc(type: Javadoc) {
excludes = ['**/*.kt'] // < ---- Exclude all kotlin files from javadoc file.
}

task clean(type: Delete) {
delete rootProject.buildDir
}
Expand Down
3 changes: 0 additions & 3 deletions android/release-aar.sh

This file was deleted.

59 changes: 59 additions & 0 deletions android/sdk/build-config.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
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

}
dependencies {
dependency {
groupId 'com.google.code.gson'
artifactId 'gson'
version '2.8.5'
}
dependency {
groupId 'com.squareup.okhttp3'
artifactId 'okhttp'
version '3.10.0'
}
dependency {
groupId 'org.jetbrains.kotlin'
artifactId 'kotlin-stdlib-jdk7'
version '1.2.51'
}
}
}
}
}
}
55 changes: 49 additions & 6 deletions android/sdk/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

// start Bintray config
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'
// end

tasks.withType(Javadoc).all {
// Ignore because javadoc doesn't parse kotlin files correctly
excludes = ['**/*.kt'] // < ---- Exclude all kotlin files from javadoc file.
}

repositories {
mavenCentral()
}

android {
compileSdkVersion rootProject.ext.compileSdkVersion

Expand All @@ -20,7 +34,8 @@ android {
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
useProguard false
// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
Expand All @@ -37,10 +52,38 @@ dependencies {
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

// Third party dependencies.
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
api 'com.google.code.gson:gson:2.8.5'
api 'com.squareup.okhttp3:okhttp:3.10.0'
api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
repositories {
mavenCentral()

// start Bintray config
ext {
bintrayRepo = "moby-tracking-sdk-test"
bintrayName = "io.o2mc.sdk"

publishedGroupId = 'io.o2mc.sdk'
libraryName = 'sdk'
artifact = 'sdk'

libraryDescription = 'Moby, the mobile dimml SDK for Android and iOS'

siteUrl = 'https://github.com/O2MC/moby-tracking-sdk'
gitUrl = 'https://github.com/O2MC/moby-tracking-sdk.git'

developerId = 'EdwinVanRooij'
developerName = 'Edwin van Rooij'
developerEmail = '[email protected]'

libraryVersion = '0.0.7'

licenseName = 'MIT License'
licenseUrl = 'https://github.com/O2MC/moby-tracking-sdk/blob/master/LICENSE'
allLicenses = ['MIT License']
}

if (project.rootProject.file('local.properties').exists()) {
apply from: project.file('build-config.gradle')
apply from: project.file('upload-config.gradle')
}
// end
1 change: 1 addition & 0 deletions android/sdk/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
# A resource is loaded with a relative path so the package of this class must be preserved.
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase


# Remove log methods when compiling production API
-assumenosideeffects class android.util.Log {
public static *** v(...); # Verbose
Expand Down
59 changes: 59 additions & 0 deletions android/sdk/upload-config.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
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
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
publish = true
publicDownloadNumbers = true
version {
desc = libraryDescription
gpg {
sign = true //Determines whether to GPG sign the files. The default is false
passphrase = properties.getProperty("bintray.gpg.password")
//Optional. The passphrase for GPG signing'
}
}
}
}