Skip to content

Commit

Permalink
Version 3.9.0 of the Google Mobile Ads Unity plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
rampara committed Nov 15, 2017
1 parent 96fc4dc commit 1288634
Show file tree
Hide file tree
Showing 40 changed files with 475 additions and 65 deletions.
17 changes: 17 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
Google Mobile Ads Unity Plugin Change Log

*************
Version 3.9.0
*************

- Implemented workaround for issue where ad views are rendered in incorrect
position.
- Resolved compatibility issues with Gradle 4.
- Resovled comnpatilbity issues with older versions of Xcode.
- Added API for video ad volume control.
- Added AdColony mediation support package.
- Added AppLovin mediation support package.

Built and tested with:
- Google Play services 11.6.0
- Google Mobile Ads iOS SDK 7.25.0
- Unity Jar Resolver 1.2.59.0

*************
Version 3.8.0
*************
Expand Down
68 changes: 68 additions & 0 deletions mediation/AdColony/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Gradle file to build a Unity package to add AdColony mediation support to the Google Mobile Ads Unity plugin.
* Usage: ./gradlew exportPackage
*/

defaultTasks 'exportPackage'

// Project level variables.
project.ext {
unity_exe = System.getProperty("UNITY_EXE")
if (unity_exe == null || unity_exe.isEmpty()) {
unity_exe = System.getenv("UNITY_EXE")
}
if (unity_exe == null || unity_exe.isEmpty()) {
unity_exe = '/Applications/Unity/Unity.app/Contents/MacOS/Unity'
}

if (!file(unity_exe).exists()) {
throw new GradleException('Unable to locate installation of Unity. Please create a ' +
'UNITY_EXE environment variable and point it to your Unity installation.')
}

pluginSource = file('source/plugin').absolutePath
pluginBuildDir = file('temp/plugin-build-dir').absolutePath
buildPath = file('temp').absolutePath
exportPath = file('GoogleMobileAdsAdColonyMediation.unitypackage').absolutePath
}

// Build unity package using through command line interface.
// Create new unity project with files in temporary build directory and export files to a unity package.
// Command line usage and arguments documented at http://docs.unity3d.com/Manual/CommandLineArguments.html.
task exportPackage(type: Exec) {
description = "Creates and exports the Plugin unity package"
executable "${unity_exe}"
args "-g.building",
"-batchmode",
"-projectPath", "${pluginBuildDir}",
"-logFile", "temp/unity.log",
"-exportPackage",
"Assets/GoogleMobileAds/Editor",
"Assets/Plugins",
"${exportPath}",
"-quit"

ignoreExitValue true

doLast {
if (execResult.getExitValue() != 0) {
copy {
from "temp/"
into "./"
include "unity.log"
}
}
}
}

task createTempBuildFolder(type: Copy) {
from { "${pluginSource}" }
into { "${pluginBuildDir}" }
}

task clearTempBuildFolder(type: Delete) {
delete { "${buildPath}" }
}

exportPackage.dependsOn(createTempBuildFolder)
exportPackage.finalizedBy(clearTempBuildFolder)
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<dependencies>
<androidPackages>
<androidPackage spec="com.google.ads.mediation:adcolony:3.2.1.1">
<repositories>
<repository>https://adcolony.bintray.com/AdColony</repository>
</repositories>
</androidPackage>
<androidPackage spec="com.adcolony:sdk:3.2.1">
<repositories>
<repository>https://adcolony.bintray.com/AdColony</repository>
</repositories>
</androidPackage>
</androidPackages>

<iosPods>
<iosPod name="GoogleMobileAdsMediationAdColony" version="3.1.2.0">
<sources>
<source>https://github.com/CocoaPods/Specs</source>
</sources>
</iosPod>
</iosPods>
</dependencies>

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.unity.mediation.vungle">

<!-- For optimal performance, AdColony recommends adding the following OPTIONAL permission -->
<!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> -->
<!-- For optimal performance, AdColony recommends adding the following OPTIONAL permission -->
<!-- <uses-permission android:name="android.permission.VIBRATE" /> -->

<application>
<activity
android:name="com.adcolony.sdk.AdColonyInterstitialActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:hardwareAccelerated="true" />

<activity
android:name="com.adcolony.sdk.AdColonyAdViewActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:hardwareAccelerated="true" />
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target=android-19
android.library=true
68 changes: 68 additions & 0 deletions mediation/AppLovin/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Gradle file to build a Unity package to add AppLovin mediation support to the Google Mobile Ads Unity plugin.
* Usage: ./gradlew exportPackage
*/

defaultTasks 'exportPackage'

// Project level variables.
project.ext {
unity_exe = System.getProperty("UNITY_EXE")
if (unity_exe == null || unity_exe.isEmpty()) {
unity_exe = System.getenv("UNITY_EXE")
}
if (unity_exe == null || unity_exe.isEmpty()) {
unity_exe = '/Applications/Unity/Unity.app/Contents/MacOS/Unity'
}

if (!file(unity_exe).exists()) {
throw new GradleException('Unable to locate installation of Unity. Please create a ' +
'UNITY_EXE environment variable and point it to your Unity installation.')
}

pluginSource = file('source/plugin').absolutePath
pluginBuildDir = file('temp/plugin-build-dir').absolutePath
buildPath = file('temp').absolutePath
exportPath = file('GoogleMobileAdsAppLovinMediation.unitypackage').absolutePath
}

// Build unity package using through command line interface.
// Create new unity project with files in temporary build directory and export files to a unity package.
// Command line usage and arguments documented at http://docs.unity3d.com/Manual/CommandLineArguments.html.
task exportPackage(type: Exec) {
description = "Creates and exports the Plugin unity package"
executable "${unity_exe}"
args "-g.building",
"-batchmode",
"-projectPath", "${pluginBuildDir}",
"-logFile", "temp/unity.log",
"-exportPackage",
"Assets/GoogleMobileAds/Editor",
"Assets/Plugins",
"${exportPath}",
"-quit"

ignoreExitValue true

doLast {
if (execResult.getExitValue() != 0) {
copy {
from "temp/"
into "./"
include "unity.log"
}
}
}
}

task createTempBuildFolder(type: Copy) {
from { "${pluginSource}" }
into { "${pluginBuildDir}" }
}

task clearTempBuildFolder(type: Delete) {
delete { "${buildPath}" }
}

exportPackage.dependsOn(createTempBuildFolder)
exportPackage.finalizedBy(clearTempBuildFolder)
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<dependencies>
<androidPackages>
<androidPackage spec="com.google.ads.mediation:applovin:7.4.1.1">
</androidPackage>
<androidPackage spec="com.applovin:applovin-sdk:7.4.1">
</androidPackage>
</androidPackages>

<iosPods>
<iosPod name="GoogleMobileAdsMediationAppLovin" version="4.4.1.1">
<sources>
<source>https://github.com/CocoaPods/Specs</source>
</sources>
</iosPod>
</iosPods>
</dependencies>

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.unity.mediation.AppLovin">

<application>

<!--<meta-data-->
<!--android:name="applovin.sdk.key"-->
<!--android:value="INSERT_APP_LOVIN_SDK_KEY_HERE" />-->

<activity
android:name="com.applovin.adview.AppLovinInterstitialActivity"
android:configChanges="orientation|screenSize" />

<activity
android:name="com.applovin.adview.AppLovinConfirmationActivity"
android:configChanges="orientation|screenSize" />
</application>

</manifest>

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target=android-19
android.library=true
7 changes: 3 additions & 4 deletions mediation/Vungle/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*
/*
* Gradle file to build a Unity package to add Vungle mediation support to the Google Mobile Ads Unity plugin.
* Usage: ./gradlew exportPackage
*/
Expand All @@ -17,7 +16,7 @@ project.ext {
}

if (!file(unity_exe).exists()) {
throw new GradleException('Unable to locate installation of Unity. Please create a' +
throw new GradleException('Unable to locate installation of Unity. Please create a ' +
'UNITY_EXE environment variable and point it to your Unity installation.')
}

Expand All @@ -29,13 +28,13 @@ project.ext {

// Build jar from android plugin source files using existing Gradle build file.
task buildAndroidPluginJar(type: GradleBuild) {
buildFile = 'source/android-library/app/build.gradle'
buildFile = 'source/android-library/vungle/build.gradle'
tasks = ['build']
}

// Move android plugin jar to temporary build directory.
task copyAndroidLibraryJar(type: Copy) {
from("source/android-library/app/build/intermediates/bundles/release/")
from("source/android-library/vungle/build/intermediates/bundles/release/")
into("${pluginBuildDir}/Assets/Plugins/Android/")
include('classes.jar')
rename('classes.jar', 'vungle-extras-library.jar')
Expand Down
10 changes: 3 additions & 7 deletions mediation/Vungle/source/android-library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
classpath 'com.android.tools.build:gradle:3.0.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -14,12 +15,7 @@ buildscript {

allprojects {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com'
}
flatDir {
dirs 'libs'
}
}
}
5 changes: 4 additions & 1 deletion mediation/Vungle/source/android-library/settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
include ':app'
include 'vungle'
include 'app'
project(':app').projectDir = new File('${projectDir}/../../../../../source/android-library/app')

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ apply plugin: 'com.android.library'

android {
compileSdkVersion 26
buildToolsVersion "22.0.1"

defaultConfig {
minSdkVersion 14
Expand All @@ -23,22 +22,8 @@ android {
}

dependencies {
compile files('libs/unity-plugin-library.jar')
compile 'com.google.ads.mediation:vungle:5.1.0.0'
}

// Build jar from android plugin source files using existing Gradle build file.
task buildAndroidPluginJar(type: GradleBuild) {
buildFile = '../../../../../source/android-library/app/build.gradle'
tasks = ['build']
}

// Move android plugin jar to libs directory.
task copyAndroidLibraryJar(type: Copy) {
from("../../../../../source/android-library/app/build/intermediates/bundles/release/")
into("libs")
include('classes.jar')
rename('classes.jar', 'unity-plugin-library.jar')
api project(':app')
api 'com.google.ads.mediation:vungle:5.3.0.0'
}

task clearJar(type: Delete) {
Expand All @@ -53,4 +38,3 @@ task makeJar(type: Copy) {
}

makeJar.dependsOn(clearJar, build)
preBuild.dependsOn(copyAndroidLibraryJar, buildAndroidPluginJar)
7 changes: 3 additions & 4 deletions source/android-library/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ apply plugin: 'com.android.library'

android {
compileSdkVersion 26
buildToolsVersion "22.0.1"

defaultConfig {
minSdkVersion 14
Expand All @@ -23,9 +22,9 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:26.0.0'
compile 'com.google.android.gms:play-services-ads:11.4.0'
api fileTree(dir: 'libs', include: ['*.jar'])
api 'com.android.support:appcompat-v7:26.1.0'
api 'com.google.android.gms:play-services-ads:11.6.0'
}

task clearJar(type: Delete) {
Expand Down
Loading

0 comments on commit 1288634

Please sign in to comment.