Skip to content

Commit

Permalink
Prepare project for AdMob integration (#327)
Browse files Browse the repository at this point in the history
* feat: add event handlers and adapters to deploy script, generate pom files

* feat: edit pom files

* fix(deploying): fix deploying of project with rendering

Deploy script publishes rendering module as aar. Build script generates and saves aar files too. Fix Sonatype exception about javadoc and sources in OpenMeasument SDK. Fix possible exception in DemandFetcher. Move staging url to global build.gradle.

* feat: make separate script for deploying Open Measurement SDK #318

* feat(AdMob): prepare project for AdMob integration #324

* feat(AdMob): corrected imports for staging releases
  • Loading branch information
ValentinPostindustria authored Dec 15, 2021
1 parent fd7eef8 commit c76f77f
Show file tree
Hide file tree
Showing 12 changed files with 130 additions and 9 deletions.
2 changes: 2 additions & 0 deletions Example/PrebidDemoKotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ dependencies {
implementation project(':PrebidMobile')
implementation project(':PrebidMobile-gamEventHandlers')
implementation project(':PrebidMobile-mopubAdapters')
implementation project(':PrebidMobile-admobAdapters')

// For testing staging releases
// implementation 'org.prebid:prebid-mobile-sdk:1.13.0-beta2'
// implementation 'org.prebid:prebid-mobile-sdk-gam-event-handlers:1.13.0-beta2'
// implementation 'org.prebid:prebid-mobile-sdk-mopub-adapters:1.13.0-beta2'
// implementation 'org.prebid:prebid-mobile-sdk-admob-adapters:1.13.0-beta2'

// Standard libraries
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
Expand Down
2 changes: 2 additions & 0 deletions Example/PrebidInternalTestApp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ dependencies {
implementation project(':PrebidMobile')
implementation project(':PrebidMobile-gamEventHandlers')
implementation project(':PrebidMobile-mopubAdapters')
implementation project(':PrebidMobile-admobAdapters')

// For testing staging releases
// implementation 'org.prebid:prebid-mobile-sdk:1.13.0-beta2'
// implementation 'org.prebid:prebid-mobile-sdk-gam-event-handlers:1.13.0-beta2'
// implementation 'org.prebid:prebid-mobile-sdk-mopub-adapters:1.13.0-beta2'
// implementation 'org.prebid:prebid-mobile-sdk-admob-adapters:1.13.0-beta2'

// Base dependencies
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
Expand Down
2 changes: 2 additions & 0 deletions Example/PrebidInternalTestApp/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<item>@string/segment_title_in_app</item>
<item>@string/segment_title_mopub</item>
<item>@string/segment_title_gam</item>
<item>@string/segment_title_admob</item>
<item>@string/segment_title_all</item>
</string-array>

Expand All @@ -40,5 +41,6 @@
<string name="segment_title_all">All</string>
<string name="segment_title_mopub">MoPub</string>
<string name="segment_title_gam">GAM</string>
<string name="segment_title_admob">AdMob</string>
<string name="segment_title_in_app">In-App</string>
</resources>
23 changes: 23 additions & 0 deletions PrebidMobile/PrebidMobile-admobAdapters/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apply from: '../shared-rendering.gradle'
apply from: 'publish-adapters.gradle'

android {
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
}
}
defaultConfig {
consumerProguardFiles file('proguard-rules.pro')
}
}

dependencies {
implementation project(":PrebidMobile")

implementation 'com.google.android.gms:play-services-ads:20.4.0'
}
Empty file.
23 changes: 23 additions & 0 deletions PrebidMobile/PrebidMobile-admobAdapters/publish-adapters.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apply plugin: 'maven-publish'

def ARTIFACT_ID = "prebid-mobile-sdk-admob-adapters"

publishing {
publications {
eventHandler(MavenPublication) {
artifactId "$ARTIFACT_ID"
artifact "${project.buildDir}/outputs/aar/${project.name}-release.aar"
version "$prebidVersionName"
groupId "$artifactGroupId"
}
}

// Using local repository for generated artifacts.
repositories {
maven {
name = 'LocalArtifacts'
url = "file://$artifactFolder"
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<manifest package="org.prebid.mobile.admob.adapters"/>
65 changes: 65 additions & 0 deletions scripts/Maven/PrebidMobile-admobAdapters-pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.prebid</groupId>
<artifactId>prebid-mobile-sdk-admob-adapters</artifactId>
<version>1.13.0-beta2</version>

<packaging>jar</packaging>
<name>Prebid Mobile Android SDK</name>
<description>Prebid Mobile</description>
<url>https://www.prebid.org</url>

<scm>
<connection>scm:git:[email protected]:prebid/prebid-mobile-android.git</connection>
<developerConnection>scm:git:[email protected]:prebid/prebid-mobile-android.git</developerConnection>
<url>[email protected]:prebid/prebid-mobile-android.git</url>
</scm>

<licenses>
<license>
<name>The Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>

<developers>
<developer>
<name>Postindustria AdTech Team</name>
<email>[email protected]</email>
<organization>Postindustria LTD</organization>
<organizationUrl>https://postindustria.com/</organizationUrl>
</developer>

<developer>
<name>AppNexus Mobile Team</name>
<email>[email protected]</email>
<organization>AppNexus, Inc.</organization>
<organizationUrl>http://www.appnexus.com</organizationUrl>
</developer>

<developer>
<name>RubiconProject Mobile Team</name>
<email>sdk@https://rubiconproject.com/</email>
<organization>The Rubicon Project, Inc.</organization>
<organizationUrl>https://rubiconproject.com</organizationUrl>
</developer>
</developers>

<dependencies>
<dependency>
<groupId>org.prebid</groupId>
<artifactId>prebid-mobile-sdk</artifactId>
<version>1.13.0-beta2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.android.gms</groupId>
<artifactId>play-services-ads</artifactId>
<version>20.4.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
4 changes: 2 additions & 2 deletions scripts/Maven/deployPrebidMobile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ sh ./buildPrebidMobile.sh

cp -r ../generated/* "$DEPLOY_DIR_ABSOLUTE" || true

modules=("PrebidMobile" "PrebidMobile-core" "PrebidMobile-rendering" "PrebidMobile-gamEventHandlers" "PrebidMobile-mopubAdapters")
extensions=("jar" "jar" "aar" "jar" "jar")
modules=("PrebidMobile" "PrebidMobile-core" "PrebidMobile-rendering" "PrebidMobile-gamEventHandlers" "PrebidMobile-mopubAdapters" "PrebidMobile-admobAdapters")
extensions=("jar" "jar" "aar" "jar" "jar" "jar")
for n in ${!modules[@]}; do
echo -e "\n"
echoX "Deploying ${modules[$n]} on Maven..."
Expand Down
2 changes: 2 additions & 0 deletions scripts/buildPrebidMobile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,15 @@ modules=(
"PrebidMobile-rendering"
"PrebidMobile-gamEventHandlers"
"PrebidMobile-mopubAdapters"
"PrebidMobile-admobAdapters"
)
projectPaths=(
"$BASEDIR/PrebidMobile"
"$BASEDIR/PrebidMobile/PrebidMobile-core"
"$BASEDIR/PrebidMobile/PrebidMobile-rendering"
"$BASEDIR/PrebidMobile/PrebidMobile-gamEventHandlers"
"$BASEDIR/PrebidMobile/PrebidMobile-mopubAdapters"
"$BASEDIR/PrebidMobile/PrebidMobile-admobAdapters"
)

mkdir "$OUTDIR/aar"
Expand Down
3 changes: 2 additions & 1 deletion scripts/testPrebidMobile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ echoX "start unit tests"
./gradlew PrebidMobile:testDebugUnitTest
./gradlew PrebidMobile-rendering:testDebugUnitTest
./gradlew PrebidMobile-gamEventHandlers:testDebugUnitTest
./gradlew PrebidMobile-mopubAdapters:testDebugUnitTest
./gradlew PrebidMobile-mopubAdapters:testDebugUnitTest
./gradlew PrebidMobile-admobAdapters:testDebugUnitTest
12 changes: 6 additions & 6 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
include ':PrebidMobile',
':PrebidMobile-core',
':PrebidMobile-rendering',
':PrebidMobile-gamEventHandlers',
':PrebidMobile-mopubAdapters',
':PrebidMobile-admobAdapters',
':omsdk-android',
':PrebidMobile-rendering',

//Prebid Demo apps
// Prebid Demo apps
':PrebidDemoJava',
':PrebidDemoKotlin',
':PrebidInternalTestApp',

//tools
// Other
':DrPrebid',
':TestUtils'


project(':PrebidMobile').projectDir = new File('PrebidMobile')
project(':PrebidMobile-core').projectDir = new File('PrebidMobile/PrebidMobile-core')
project(':PrebidMobile-rendering').projectDir = new File('PrebidMobile/PrebidMobile-rendering')
project(':PrebidMobile-gamEventHandlers').projectDir = new File('PrebidMobile/PrebidMobile-gamEventHandlers')
project(':PrebidMobile-mopubAdapters').projectDir = new File('PrebidMobile/PrebidMobile-mopubAdapters')
project(':PrebidMobile-admobAdapters').projectDir = new File('PrebidMobile/PrebidMobile-admobAdapters')
project(':omsdk-android').projectDir = new File('PrebidMobile/omsdk-android')
project(':PrebidMobile-rendering').projectDir = new File('PrebidMobile/PrebidMobile-rendering')

project(':PrebidDemoJava').projectDir = new File('Example/PrebidDemoJava')
project(':PrebidDemoKotlin').projectDir = new File('Example/PrebidDemoKotlin')
Expand Down

0 comments on commit c76f77f

Please sign in to comment.