-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version 3.8.0 of the Google Mobile Ads Unity plugin
- Loading branch information
Showing
72 changed files
with
1,094 additions
and
73 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 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,93 @@ | ||
/* | ||
/* | ||
* Gradle file to build a Unity package to add Vungle 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('GoogleMobileAdsVungleMediation.unitypackage').absolutePath | ||
} | ||
|
||
// 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 temporary build directory. | ||
task copyAndroidLibraryJar(type: Copy) { | ||
from("source/android-library/app/build/intermediates/bundles/release/") | ||
into("${pluginBuildDir}/Assets/Plugins/Android/") | ||
include('classes.jar') | ||
rename('classes.jar', 'vungle-extras-library.jar') | ||
} | ||
|
||
// Copy Unity mediation extras interface to temporary build directory. | ||
task copyExtrasInterface(type: Copy) { | ||
from("../../source/plugin/Assets/GoogleMobileAds/Api/Mediation/") | ||
into("${pluginBuildDir}/Assets/GoogleMobileAds/Api/Mediation/") | ||
include('MediationExtras.cs') | ||
} | ||
|
||
copyAndroidLibraryJar.dependsOn(buildAndroidPluginJar) | ||
|
||
// 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/Api/Mediation/Vungle", | ||
"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, copyAndroidLibraryJar, copyExtrasInterface) | ||
exportPackage.finalizedBy(clearTempBuildFolder) |
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,6 @@ | ||
.gradle | ||
/local.properties | ||
/.idea/workspace.xml | ||
/.idea/libraries | ||
.DS_Store | ||
/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 @@ | ||
/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,56 @@ | ||
apply plugin: 'com.android.library' | ||
|
||
android { | ||
compileSdkVersion 26 | ||
buildToolsVersion "22.0.1" | ||
|
||
defaultConfig { | ||
minSdkVersion 14 | ||
targetSdkVersion 26 | ||
versionCode 1 | ||
versionName "1.0" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
|
||
lintOptions { | ||
abortOnError false | ||
} | ||
} | ||
|
||
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') | ||
} | ||
|
||
task clearJar(type: Delete) { | ||
delete 'build/libs/vungle-extras-library.jar' | ||
} | ||
|
||
task makeJar(type: Copy) { | ||
from('build/intermediates/bundles/release/') | ||
into('build/libs/') | ||
include('classes.jar') | ||
rename('classes.jar', 'vungle-extras-library.jar') | ||
} | ||
|
||
makeJar.dependsOn(clearJar, build) | ||
preBuild.dependsOn(copyAndroidLibraryJar, buildAndroidPluginJar) |
17 changes: 17 additions & 0 deletions
17
mediation/Vungle/source/android-library/app/proguard-rules.pro
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,17 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in /Users/rampara/Library/Android/sdk/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# 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 *; | ||
#} |
9 changes: 9 additions & 0 deletions
9
mediation/Vungle/source/android-library/app/src/main/AndroidManifest.xml
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,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
This Google Mobile Ads plugin library manifest will get merged with your | ||
application's manifest, adding the necessary activity and permissions | ||
required for displaying ads. | ||
--> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.google.unity.mediation.vungle"> | ||
</manifest> |
47 changes: 47 additions & 0 deletions
47
...library/app/src/main/java/com/google/unity/mediation/vungle/VungleUnityExtrasBuilder.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,47 @@ | ||
package com.google.unity.mediation.vungle; | ||
|
||
import android.os.Bundle; | ||
|
||
import com.google.unity.ads.AdNetworkExtras; | ||
import com.vungle.mediation.VungleExtrasBuilder; | ||
|
||
import java.util.HashMap; | ||
|
||
/** | ||
* Mediation extras bundle class for the Vungle adapter. | ||
*/ | ||
abstract class VungleUnityExtrasBuilder implements AdNetworkExtras { | ||
|
||
/** | ||
* Key to add and obtain all placements. | ||
*/ | ||
private static final String ALL_PLACEMENTS_KEY = "all_placements"; | ||
|
||
private static final String USER_ID_KEY = "user_id"; | ||
|
||
private static final String SOUND_ENABLED_KEY = "sound_enabled"; | ||
|
||
@Override | ||
public Bundle buildExtras(HashMap<String, String> extras) { | ||
String placements = extras.get(ALL_PLACEMENTS_KEY); | ||
if (placements == null) { | ||
return null; | ||
} | ||
|
||
VungleExtrasBuilder extrasBuilder = | ||
new VungleExtrasBuilder(extras.get(ALL_PLACEMENTS_KEY).split(",")); | ||
|
||
|
||
String soundEnabled = extras.get(SOUND_ENABLED_KEY); | ||
if (soundEnabled != null) { | ||
extrasBuilder.setSoundEnabled(Boolean.valueOf(soundEnabled)); | ||
} | ||
|
||
String userId = extras.get(USER_ID_KEY); | ||
if (userId != null) { | ||
extrasBuilder.setUserId(userId); | ||
} | ||
|
||
return extrasBuilder.build(); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...src/main/java/com/google/unity/mediation/vungle/VungleUnityInterstitialExtrasBuilder.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,14 @@ | ||
package com.google.unity.mediation.vungle; | ||
|
||
import com.vungle.mediation.VungleInterstitialAdapter; | ||
|
||
/** | ||
* Mediation extras bundle class for the Vungle adapter. | ||
*/ | ||
public class VungleUnityInterstitialExtrasBuilder extends VungleUnityExtrasBuilder { | ||
|
||
@Override | ||
public Class getAdapterClass() { | ||
return VungleInterstitialAdapter.class; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...rc/main/java/com/google/unity/mediation/vungle/VungleUnityRewardedVideoExtrasBuilder.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,14 @@ | ||
package com.google.unity.mediation.vungle; | ||
|
||
import com.vungle.mediation.VungleAdapter; | ||
|
||
/** | ||
* Mediation extras bundle class for the Vungle adapter. | ||
*/ | ||
public class VungleUnityRewardedVideoExtrasBuilder extends VungleUnityExtrasBuilder { | ||
|
||
@Override | ||
public Class getAdapterClass() { | ||
return VungleAdapter.class; | ||
} | ||
} |
Binary file added
BIN
+3.34 KB
...tion/Vungle/source/android-library/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.15 KB
...tion/Vungle/source/android-library/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.73 KB
...ion/Vungle/source/android-library/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.54 KB
...on/Vungle/source/android-library/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions
2
mediation/Vungle/source/android-library/app/src/main/res/values/strings.xml
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 @@ | ||
<resources> | ||
</resources> |
2 changes: 2 additions & 0 deletions
2
mediation/Vungle/source/android-library/app/src/main/res/values/styles.xml
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 @@ | ||
<resources> | ||
</resources> |
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,25 @@ | ||
// Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
|
||
buildscript { | ||
repositories { | ||
jcenter() | ||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:2.2.0' | ||
|
||
// NOTE: Do not place your application dependencies here; they belong | ||
// in the individual module build.gradle files | ||
} | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
jcenter() | ||
maven { | ||
url 'https://maven.google.com' | ||
} | ||
flatDir { | ||
dirs 'libs' | ||
} | ||
} | ||
} |
Binary file added
BIN
+53.4 KB
mediation/Vungle/source/android-library/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions
6
mediation/Vungle/source/android-library/gradle/wrapper/gradle-wrapper.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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#Wed Jul 12 16:58:21 PDT 2017 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0.1-bin.zip |
Oops, something went wrong.