Skip to content
This repository was archived by the owner on Jul 20, 2023. It is now read-only.
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
71 changes: 43 additions & 28 deletions sdk-android/TuneMarketingConsoleSDK/build.gradle
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
apply plugin: 'com.android.library'

ext {
PUBLISH_GROUP_ID = 'com.tune'
PUBLISH_ARTIFACT_ID = 'tune-marketing-console-sdk'
PUBLISH_VERSION = '6.1.2'
}

android {
compileSdkVersion 27
buildToolsVersion '28.0.3'
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION

defaultConfig {
minSdkVersion 14
targetSdkVersion 27
versionName PUBLISH_VERSION
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
versionName project.VERSION_NAME
versionCode Integer.parseInt(project.VERSION_CODE)
minSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_MINIMUM)
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

buildTypes {
debug {
buildConfigField "Boolean", "DEBUG_MODE", "true"
buildConfigField "String", "SDK_VERSION_STRING", "\"!SDK-VERSION-STRING!:${PUBLISH_GROUP_ID}:${PUBLISH_ARTIFACT_ID}:${PUBLISH_VERSION}\""
buildConfigField "String", "SDK_VERSION_STRING", "\"!SDK-VERSION-STRING!:${project.GROUP}:${project.ARTIFACT_ID}:${project.VERSION_NAME}\""
}
release {
buildConfigField "Boolean", "DEBUG_MODE", "false"
buildConfigField "String", "SDK_VERSION_STRING", "\"!SDK-VERSION-STRING!:${PUBLISH_GROUP_ID}:${PUBLISH_ARTIFACT_ID}:${PUBLISH_VERSION}\""
buildConfigField "String", "SDK_VERSION_STRING", "\"!SDK-VERSION-STRING!:${project.GROUP}:${project.ARTIFACT_ID}:${project.VERSION_NAME}\""
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
Expand All @@ -46,13 +41,10 @@ configurations {

dependencies {
api 'com.android.support:support-v4:27.1.1'
javadocDeps 'com.android.support:support-v4:27.1.1'

api 'com.android.support:support-annotations:27.1.1'
javadocDeps 'com.android.support:support-annotations:27.1.1'

api 'com.android.installreferrer:installreferrer:1.0'
javadocDeps 'com.android.installreferrer:installreferrer:1.0'

// Unit testing dependencies
androidTestImplementation 'com.android.support.test:runner:1.0.2'
Expand All @@ -67,7 +59,7 @@ dependencies {
tasks.whenTaskAdded { task ->
if (task.name == 'androidJavadocs') {
task.configure {
title = "Tune Android SDK " + PUBLISH_VERSION
title = "Tune Android SDK " + project.VERSION_NAME

classpath += configurations.javadocDeps
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
Expand All @@ -82,13 +74,6 @@ tasks.whenTaskAdded { task ->
}
}

afterEvaluate {
// fixes issue where javadoc can't find android symbols ref: http://stackoverflow.com/a/34572606
androidJavadocs.classpath += files(android.libraryVariants.collect { variant ->
variant.javaCompile.classpath.files
})
}

task clearAar(type: Delete) {
String aarName = "${project.name}-${android.defaultConfig.versionName}"

Expand Down Expand Up @@ -214,8 +199,38 @@ artifacts {
}


// Allow us to build as an Android Studio library
apply from: "android-release-aar.gradle"

// CheckStyle
apply from: "../config/android-checkstyle.gradle"
//apply from: "../config/android-checkstyle.gradle"

apply from: 'https://raw.githubusercontent.com/BranchMetrics/GradleToMavenOptionalDependencies/master/gradle-maven-push.gradle'

project.afterEvaluate {
// fixes issue where javadoc can't find android symbols ref: http://stackoverflow.com/a/34572606
androidJavadocs.classpath += files(android.libraryVariants.collect { variant ->
variant.javaCompile.classpath.files
})

publishing {
publications {
library(MavenPublication) {
setGroupId project.GROUP
setArtifactId project.ARTIFACT_ID
version android.defaultConfig.versionName
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")

//if lib contains subdendepndecies
pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')
configurations.implementation.allDependencies.each {
if (it.group != null && (it.name != null || "unspecified" == it.name) && it.version != null) {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
}
}
}
3 changes: 3 additions & 0 deletions sdk-android/TuneMarketingConsoleSDK/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POM_NAME=Tune Android SDK
POM_ARTIFACT_ID=tune-marketing-console-sdk
POM_PACKAGING=aar
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,13 @@ static synchronized ITune initAll(Context context, String advertiserId, String c

/**
* Internal constructor.
*
* @param tune TuneInternal
* @param advertiserId String
* @param conversionKey String
* @param packageName String
*
* @return ITUne interface
*/
protected static synchronized ITune initAll(TuneInternal tune, String advertiserId, String conversionKey, String packageName) {
// A valid Context is required to initialize Tune.
Expand Down Expand Up @@ -308,6 +315,7 @@ protected ExecutorService getPubQueue() {

/**
* Helper method to obtain the Account Manager for the provided context
* @param context Context
* @return an Account Manager
*/
protected AccountManager getAccountManager(Context context) {
Expand Down Expand Up @@ -366,7 +374,8 @@ public long getTimeLastMeasuredSession() {

/**
* Allow (internal) access to setting the Tune Listener
* @param listener
*
* @param listener ITuneListener
*/
public void setListener(ITuneListener listener) {
tuneListener = listener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ public class TuneFBBridge {

/**
* Log this event when the user has completed a purchase.
* The {@link AppEventsLogger#logPurchase(java.math.BigDecimal, java.util.Currency)} method is a shortcut for
* logging this event.
*/
public static final String EVENT_NAME_PURCHASED = "fb_mobile_purchase";

Expand All @@ -83,7 +81,7 @@ public class TuneFBBridge {

/**
* Parameter key used to specify currency used with logged event. E.g. "USD", "EUR", "GBP".
* See ISO-4217 for specific values. One reference for these is <http://en.wikipedia.org/wiki/ISO_4217>.
* See ISO-4217 for specific values. One reference for these is http://en.wikipedia.org/wiki/ISO_4217.
*/
public static final String EVENT_PARAM_CURRENCY = "fb_currency";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ private TuneOptional() {
* Instead, use {@link #isPresent()}.
*/
public static<T> TuneOptional<T> empty() {
@SuppressWarnings("unchecked")
TuneOptional<T> t = (TuneOptional<T>) EMPTY;
return t;
}
Expand Down
13 changes: 12 additions & 1 deletion sdk-android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply plugin: 'maven-publish'

buildscript {
repositories {
google()
jcenter()
maven {
url "https://maven.google.com" // Google's Maven repository
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'com.google.gms:google-services:3.1.0'
}
}

allprojects {
version = VERSION_NAME
group = GROUP

repositories {
google()
jcenter()
maven {
url "https://maven.google.com" // Google's Maven repository
}
mavenCentral()
}
}
22 changes: 22 additions & 0 deletions sdk-android/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
VERSION_NAME=6.1.2
VERSION_CODE=060102
GROUP=com.tune
ARTIFACT_ID=tune-marketing-console-sdk

POM_DESCRIPTION=The TUNE Marketing Console™ (TMC) SDK for the native Android™ platform provides application session and event logging functionality.
POM_URL=https://developers.tune.com/sdk/android-quick-start/
POM_SCM_URL=https://github.com/BranchMetrics/sdk-release/sdk-android.git
POM_SCM_CONNECTION=scm:git@github.com:BranchMetrics/sdk-release/sdk-android.git
POM_SCM_DEV_CONNECTION=scm:git@github.com:BranchMetrics/sdk-release/sdk-android.git
POM_LICENCE_NAME=GNU LESSER GENERAL PUBLIC LICENSE, Version 3.0
POM_LICENCE_URL=https://www.gnu.org/licenses/lgpl-3.0.txt
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=branch
POM_DEVELOPER_NAME=Branch Metrics

ANDROID_BUILD_TARGET_SDK_MINIMUM=14
ANDROID_BUILD_TARGET_SDK_VERSION=27
ANDROID_BUILD_TOOLS_VERSION=28.0.3
ANDROID_BUILD_SDK_VERSION=27
android.useAndroidX=false
android.enableJetifier=false
2 changes: 1 addition & 1 deletion sdk-android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.3-all.zip