-
Notifications
You must be signed in to change notification settings - Fork 26
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 #66 from AppsFlyerSDK/development
Development
- Loading branch information
Showing
20 changed files
with
699 additions
and
110 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: CI - Tests | ||
on: | ||
push: | ||
branches-ignore: | ||
- 'main' | ||
- 'releases/**' | ||
jobs: | ||
Tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: '11' | ||
- name: Setup Android SDK | ||
uses: android-actions/setup-android@v2 | ||
- name: Make gradlew executable | ||
run: chmod +x ./gradlew | ||
- name: Run Tests | ||
run: ./gradlew test | ||
- name: Test Report | ||
uses: dorny/test-reporter@v1 | ||
if: always() | ||
with: | ||
name: Test Results | ||
path: app/build/test-results/testDebugUnitTest/TEST-*.xml # Path to test results | ||
reporter: java-junit # Format of test results | ||
fail-on-error: true |
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
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,63 +1,129 @@ | ||
apply plugin: 'maven' | ||
apply plugin: 'maven-publish' | ||
apply plugin: 'signing' | ||
|
||
afterEvaluate { project -> | ||
uploadArchives { | ||
repositories { | ||
mavenDeployer { | ||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } | ||
pom.groupId = GROUP | ||
pom.artifactId = POM_ARTIFACT_ID | ||
pom.version = VERSION_NAME | ||
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { | ||
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) | ||
} | ||
pom.project { | ||
name POM_NAME | ||
packaging POM_PACKAGING | ||
description POM_DESCRIPTION | ||
url POM_URL | ||
scm { | ||
url POM_SCM_URL | ||
connection POM_SCM_CONNECTION | ||
developerConnection POM_SCM_DEV_CONNECTION | ||
} | ||
licenses { | ||
license { | ||
name POM_LICENCE_NAME | ||
url POM_LICENCE_URL | ||
distribution POM_LICENCE_DIST | ||
} | ||
} | ||
developers { | ||
developer { | ||
id POM_DEVELOPER_ID | ||
name POM_DEVELOPER_NAME | ||
def isReleaseBuild() { | ||
return !VERSION_NAME.contains("SNAPSHOT") | ||
} | ||
|
||
def getReleaseRepositoryUrl() { | ||
return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL | ||
: "https://oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
} | ||
|
||
def getSnapshotRepositoryUrl() { | ||
return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL | ||
: "https://oss.sonatype.org/content/repositories/snapshots/" | ||
} | ||
|
||
task androidJavadocs(type: Javadoc) { | ||
exclude "**/*.orig" // exclude files created by source control | ||
source = android.sourceSets.main.java.srcDirs | ||
classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) | ||
failOnError false | ||
} | ||
|
||
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { | ||
archiveClassifier.set("javadoc") | ||
|
||
from androidJavadocs.destinationDir | ||
} | ||
|
||
task androidSourcesJar(type: Jar) { | ||
archiveClassifier.set("sources") | ||
|
||
from android.sourceSets.main.java.source | ||
} | ||
|
||
def logger(log) { | ||
println log | ||
} | ||
|
||
def configurePom(pom) { | ||
logger("configurePom") | ||
pom.name = POM_NAME | ||
pom.packaging = POM_PACKAGING | ||
pom.description = POM_DESCRIPTION | ||
pom.url = POM_URL | ||
|
||
pom.scm { | ||
url = POM_SCM_URL | ||
connection = POM_SCM_CONNECTION | ||
developerConnection = POM_SCM_DEV_CONNECTION | ||
} | ||
|
||
pom.licenses { | ||
license { | ||
name = POM_LICENCE_NAME | ||
url = POM_LICENCE_URL | ||
distribution = POM_LICENCE_DIST | ||
} | ||
} | ||
|
||
pom.developers { | ||
developer { | ||
id = POM_DEVELOPER_ID | ||
name = POM_DEVELOPER_NAME | ||
} | ||
} | ||
} | ||
|
||
afterEvaluate { | ||
publishing { | ||
publications { | ||
release(MavenPublication) { | ||
logger("release") | ||
// The coordinates of the library, being set from variables that | ||
// we'll set up in a moment | ||
groupId GROUP | ||
artifactId POM_ARTIFACT_ID | ||
version VERSION_NAME | ||
|
||
// Two artifacts, the `aar` and the sources | ||
// artifact("$buildDir/outputs/aar/${project.getName()}-release.aar") | ||
artifact bundleReleaseAar | ||
artifact androidSourcesJar | ||
artifact androidJavadocsJar | ||
|
||
// Self-explanatory metadata for the most part | ||
pom { | ||
configurePom(pom) | ||
// A slight fix so that the generated POM will include any transitive dependencies | ||
// that the library builds upon | ||
withXml { | ||
def dependenciesNode = asNode().appendNode('dependencies') | ||
|
||
project.configurations.implementation.allDependencies.each { | ||
def dependencyNode = dependenciesNode.appendNode('dependency') | ||
dependencyNode.appendNode('groupId', it.group) | ||
dependencyNode.appendNode('artifactId', it.name) | ||
dependencyNode.appendNode('version', it.version) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
signing { | ||
required { gradle.taskGraph.hasTask("uploadArchives") } | ||
sign configurations.archives | ||
} | ||
task androidJavadocs(type: Javadoc) { | ||
classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) | ||
if (JavaVersion.current().isJava8Compatible()) { | ||
allprojects { | ||
tasks.withType(Javadoc) { options.addStringOption('Xdoclint:none', '-quiet') } | ||
repositories { | ||
maven { | ||
name = "sonatype" | ||
|
||
// You only need this if you want to publish snapshots, otherwise just set the URL | ||
// to the release repo directly | ||
url = isReleaseBuild() ? getReleaseRepositoryUrl() : getSnapshotRepositoryUrl() | ||
|
||
credentials(PasswordCredentials) { | ||
username = getRepositoryUsername() | ||
password = getRepositoryPassword() | ||
} | ||
} | ||
} | ||
} | ||
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { | ||
archiveClassifier = 'javadoc' | ||
from androidJavadocs.destinationDir | ||
} | ||
task androidSourcesJar(type: Jar) { | ||
classifier = 'sources' | ||
from android.sourceSets.main.java.sourceFiles | ||
} | ||
artifacts { archives androidJavadocsJar } | ||
} | ||
} | ||
|
||
signing { | ||
logger("signing") | ||
sign publishing.publications | ||
} | ||
|
||
|
||
publish.dependsOn build | ||
publishToMavenLocal.dependsOn build |
26 changes: 13 additions & 13 deletions
26
...ndroidTest/java/com/segment/analytics/android/integrations/appsflyer/ApplicationTest.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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
package com.segment.analytics.android.integration.appsflyer; | ||
|
||
import android.app.Application; | ||
import android.test.ApplicationTestCase; | ||
|
||
/** | ||
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> | ||
*/ | ||
public class ApplicationTest extends ApplicationTestCase<Application> { | ||
public ApplicationTest() { | ||
super(Application.class); | ||
} | ||
} | ||
//package com.segment.analytics.android.integration.appsflyer; | ||
// | ||
//import android.app.Application; | ||
//import android.test.ApplicationTestCase; | ||
// | ||
///** | ||
// * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> | ||
// */ | ||
//public class ApplicationTest extends ApplicationTestCase<Application> { | ||
// public ApplicationTest() { | ||
// super(Application.class); | ||
// } | ||
//} |
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,6 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest package="com.segment.analytics.android.integrations.appsflyer"> | ||
|
||
<application /> | ||
|
||
<application/> | ||
</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
Oops, something went wrong.