-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from adtrace/beta
android v2.4.0
- Loading branch information
Showing
131 changed files
with
2,015 additions
and
611 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2.4.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
apply plugin: 'com.android.library' | ||
apply plugin: 'maven-publish' | ||
apply plugin: 'signing' | ||
|
||
android { | ||
compileSdkVersion rootProject.ext.coreCompileSdkVersion | ||
|
||
defaultConfig { | ||
minSdkVersion rootProject.ext.coreMinSdkVersion | ||
targetSdkVersion rootProject.ext.coreTargetSdkVersion | ||
} | ||
|
||
|
||
} | ||
|
||
dependencies { | ||
implementation fileTree(dir: 'libs', include: ['*.jar']) | ||
// Add SDK via module. | ||
compileOnly project(':android-sdk') | ||
// Add SDK via Maven. | ||
// implementation 'io.adtrace:android-sdk:2.4.0' | ||
} | ||
|
||
// read local properties | ||
File localPropsFile = project.rootProject.file('local.properties') | ||
if (localPropsFile.exists()) { | ||
Properties p = new Properties() | ||
new FileInputStream(localPropsFile).withCloseable { is -> | ||
p.load(is) | ||
} | ||
p.each { name, value -> | ||
ext[name] = value | ||
} | ||
} | ||
|
||
task adtraceImeiAndroidAar (type: Copy) { | ||
dependsOn 'assembleRelease' | ||
|
||
from('build/outputs/aar/') | ||
include 'sdk-plugin-imei-release.aar' | ||
destinationDir file('build/libs/') | ||
rename 'sdk-plugin-imei-release.aar', "${project.name}.aar" | ||
|
||
} | ||
|
||
task adtraceImeiAndroidJar(type: Jar) { | ||
dependsOn 'packageReleaseAssets' | ||
dependsOn 'compileReleaseJavaWithJavac' | ||
|
||
from('build/intermediates/library_assets/release/packageReleaseAssets/out/') { | ||
into('assets') | ||
} | ||
from('build/intermediates/javac/release/classes/') | ||
|
||
archiveName "${project.name}.jar" | ||
} | ||
|
||
task androidJavadocs(type: Javadoc) { | ||
source = android.sourceSets.main.java.srcDirs | ||
classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) | ||
android.libraryVariants.all { variant -> | ||
if (variant.name == 'release') { | ||
classpath += variant.javaCompileProvider.get().classpath | ||
} | ||
} | ||
} | ||
|
||
task adtraceImeiAndroidJavadocsJar(type: Jar) { | ||
dependsOn 'androidJavadocs' | ||
classifier = 'javadoc' | ||
from androidJavadocs.destinationDir | ||
} | ||
|
||
task adtraceImeiAndroidSourcesJar(type: Jar) { | ||
classifier = 'sources' | ||
from android.sourceSets.main.java.srcDirs | ||
} | ||
|
||
artifacts { | ||
archives adtraceImeiAndroidJar | ||
archives adtraceImeiAndroidJavadocsJar | ||
archives adtraceImeiAndroidSourcesJar | ||
} | ||
publishing { | ||
publications { | ||
mavenAndroidImei(MavenPublication) { | ||
customizePom(pom) | ||
groupId rootProject.ext.adtraceGroupId | ||
artifactId 'android-sdk-plugin-imei' | ||
version rootProject.ext.coreVersionName | ||
|
||
artifact adtraceImeiAndroidJar | ||
artifact adtraceImeiAndroidJavadocsJar | ||
artifact adtraceImeiAndroidSourcesJar | ||
} | ||
} | ||
|
||
repositories { | ||
maven { | ||
url "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
if (project.hasProperty("sonatypeUsername")) { | ||
credentials { | ||
username sonatypeUsername | ||
password sonatypePassword | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
def customizePom(pom) { | ||
pom.withXml { | ||
def root = asNode() | ||
|
||
// Add all items necessary for maven central publication. | ||
root.children().last() + { | ||
resolveStrategy = Closure.DELEGATE_FIRST | ||
description 'The AdTrace SDK for Android' | ||
name 'AdTrace Android SDK' | ||
url 'https://github.com/adtrace/adtrace_sdk_android' | ||
organization { | ||
name 'adtrace' | ||
url 'https://www.adtrace.io' | ||
} | ||
licenses { | ||
license { | ||
name 'MIT License' | ||
url 'http://www.opensource.org/licenses/mit-license.php' | ||
} | ||
} | ||
scm { | ||
url '[email protected]:adtrace/adtrace_sdk_android.git' | ||
connection 'scm:git:[email protected]:adtrace/adtrace_sdk_android.git' | ||
developerConnection 'scm:git:[email protected]:adtrace/adtrace_sdk_android.git' | ||
} | ||
developers { | ||
developer { | ||
name 'Nasser Amini' | ||
email '[email protected]' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
model { | ||
tasks.generatePomFileForMavenAndroidImeiPublication { | ||
destination = file("${project.buildDir}/generated-pom.xml") | ||
} | ||
/* TODO check if/how to replace this tasks | ||
tasks.publishMavenAndroidImeiPublicationToMavenLocal { | ||
dependsOn project.tasks.signArchives | ||
} | ||
tasks.publishMavenAndroidImeiPublicationToMavenRepository { | ||
dependsOn project.tasks.signArchives | ||
} | ||
*/ | ||
} | ||
|
||
signing { | ||
sign configurations.archives | ||
sign publishing.publications.mavenAndroidImei | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="io.adtrace.sdk.imei"> | ||
|
||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> | ||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> | ||
|
||
</manifest> |
13 changes: 13 additions & 0 deletions
13
android-sdk-imei-plugin/src/main/java/io/adtrace/sdk/imei/AdTraceImei.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package io.adtrace.sdk.imei; | ||
|
||
public class AdTraceImei { | ||
static boolean isImeiToBeRead = false; | ||
|
||
public static void readImei() { | ||
AdTraceImei.isImeiToBeRead = true; | ||
} | ||
|
||
public static void doNotReadImei() { | ||
AdTraceImei.isImeiToBeRead = false; | ||
} | ||
} |
Oops, something went wrong.