-
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 #7 from adtrace/beta
Beta
- Loading branch information
Showing
100 changed files
with
991 additions
and
587 deletions.
There are no files selected for viewing
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 was deleted.
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.
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
/build | ||
/build | ||
local.properties | ||
gradle.properties |
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 |
---|---|---|
@@ -1,35 +1,166 @@ | ||
plugins { | ||
id 'com.android.library' | ||
id 'com.vanniktech.maven.publish' | ||
|
||
} | ||
|
||
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 | ||
versionName rootProject.ext.coreVersionName | ||
versionCode rootProject.ext.defaultVersionCode | ||
} | ||
lintOptions { | ||
abortOnError false | ||
} | ||
|
||
|
||
} | ||
|
||
dependencies { | ||
compileOnly files('libs/oaid_sdk_1.1.0.aar') | ||
// Add SDK via module. | ||
compileOnly project(':android-sdk') | ||
// Add SDK via Maven. | ||
// implementation 'io.adtrace:android-sdk:2.3.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 adtraceOaidAndroidAar (type: Copy) { | ||
dependsOn 'assembleRelease' | ||
|
||
from('build/outputs/aar/') | ||
include 'sdk-plugin-oaid-release.aar' | ||
destinationDir file('build/libs/') | ||
rename 'sdk-plugin-oaid-release.aar', "${project.name}.aar" | ||
|
||
} | ||
|
||
task adtraceOaidAndroidJar(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 adtraceOaidAndroidJavadocsJar(type: Jar) { | ||
dependsOn 'androidJavadocs' | ||
classifier = 'javadoc' | ||
from androidJavadocs.destinationDir | ||
} | ||
|
||
task adtraceOaidAndroidSourcesJar(type: Jar) { | ||
classifier = 'sources' | ||
from android.sourceSets.main.java.srcDirs | ||
} | ||
|
||
artifacts { | ||
archives adtraceOaidAndroidJar | ||
archives adtraceOaidAndroidJavadocsJar | ||
archives adtraceOaidAndroidSourcesJar | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenAndroidOaid(MavenPublication) { | ||
customizePom(pom) | ||
groupId rootProject.ext.adtraceGroupId | ||
artifactId 'android-sdk-plugin-oaid' | ||
version rootProject.ext.coreVersionName | ||
|
||
artifact adtraceOaidAndroidJar | ||
artifact adtraceOaidAndroidJavadocsJar | ||
artifact adtraceOaidAndroidSourcesJar | ||
} | ||
} | ||
|
||
repositories { | ||
maven { | ||
def releasesRepoUrl = "$buildDir/repos/releases" | ||
def snapshotsRepoUrl = "$buildDir/repos/snapshots" | ||
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl | ||
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.generatePomFileForMavenAndroidOaidPublication { | ||
destination = file("${project.buildDir}/generated-pom.xml") | ||
} | ||
/* TODO check if/how to replace this tasks | ||
tasks.publishMavenAndroidOaidPublicationToMavenLocal { | ||
dependsOn project.tasks.signArchives | ||
} | ||
tasks.publishMavenAndroidOaidPublicationToMavenRepository { | ||
dependsOn project.tasks.signArchives | ||
} | ||
*/ | ||
} | ||
|
||
|
||
|
||
signing { | ||
sign configurations.archives | ||
sign publishing.publications.mavenAndroidOaid | ||
} |
Binary file not shown.
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="io.adtrace.sdk.oaid"/> | ||
|
||
package="io.adtrace.sdk.oaid"> | ||
</manifest> |
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
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 |
---|---|---|
|
@@ -124,4 +124,5 @@ private void set(IBinder service) { | |
logger.debug("Fail to add in queue %s", e.getMessage()); | ||
} | ||
} | ||
} | ||
} | ||
|
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
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
/build | ||
/build | ||
local.properties | ||
gradle.properties |
Oops, something went wrong.