Skip to content

Commit

Permalink
Version 3.1.1 of the Google Mobile Ads Unity Plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Ram Parameswaran committed Oct 21, 2016
1 parent add3cfc commit 2987ef5
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 30 deletions.
11 changes: 11 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
Google Mobile Ads Unity Plugin Change Log

*************
Version 3.1.1
*************
- Remove dependency on Android Support Library and update GMA iOS SDK
version in `AdMobDependencies.cs`.

Built and tested with:
- Google Play services 9.6.1
- Google Mobile Ads iOS SDK 7.13.0
- Unity Jar Resolver 1.2.2.0

*************
Version 3.1.0
*************
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ for the latest official version of the plugin.
Documentation
--------------
For instructions on using the plugin, please refer to
[this developer guide](//developers.google.com/admob/games#unity).
[this developer guide](//firebase.google.com/docs/admob/unity/start).

Be sure to also join the developer community on
[our forum](//groups.google.com/forum/#!categories/google-admob-ads-sdk/game-engines).
Expand Down
54 changes: 35 additions & 19 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,22 @@ project.ext {
if (unity_exe == null || unity_exe.isEmpty()) {
unity_exe ='/Applications/Unity/Unity.app/Contents/MacOS/Unity'
}
resolverPackageUri = System.getProperty("RESOLVER_PACKAGE_URI")
if (resolverPackageUri == null) {
resolverPackageUri = (
'https://github.com/googlesamples/unity-jar-resolver/raw/master/' +
'play-services-resolver-1.2.1.0.unitypackage')
git_exe = System.getProperty("GIT_EXE")
if (git_exe == null || git_exe.isEmpty()) {
git_exe = System.getenv("GIT_EXE")
}
if (git_exe == null || git_exe.isEmpty()) {
git_exe = 'git'
}

resolverPackageUri = System.getProperty("RESOLVER_PACKAGE_URI")
jarResolverRepo = 'https://github.com/googlesamples/unity-jar-resolver.git'

pluginSource = file('source/plugin').absolutePath
pluginBuildDir = file('temp/plugin-build-dir').absolutePath
buildPath = file('temp').absolutePath
exportPath = file('GoogleMobileAds.unitypackage').absolutePath
resolverPath = file('play-services-resolver.unitypackage').absolutePath
resolverDir = file("${buildPath}/jarresolver").absolutePath
}

// Delete existing android plugin jar file.
Expand All @@ -53,18 +58,23 @@ task copyAndroidLibraryJar(type: Copy) {
copyAndroidLibraryJar.dependsOn(clearJar, buildAndroidPluginJar)

task downloadResolver() {
description = "Download the Play Services Resolver"
doLast {
def resolver = new File("${resolverPath}")
if (!resolver.exists()) {
new URL("${resolverPackageUri}").withInputStream{
inputStream -> resolver.withOutputStream{ it << inputStream }}
description = "Download the Play Services Resolver"
if (resolverPackageUri != null) {
mkdir("${resolverDir}")
def resolver = new File("${resolverDir}/resolver.unitypackage")
new URL("${resolverPackageUri}").withInputStream {
inputStream -> resolver.withOutputStream { it << inputStream }
}
} else {
println 'clone ' + jarResolverRepo
def result = exec {
executable "${git_exe}"
args "clone", jarResolverRepo, "${resolverDir}"
}
if (result.exitValue == 0) {
println "Downloaded resolver from " + jarResolverRepo
}
}
}
}

task deleteResolver(type: Delete) {
delete { "${resolverPath}" }
}

// Build unity package using through command line interface.
Expand All @@ -74,13 +84,19 @@ task deleteResolver(type: Delete) {
task exportPackage() {
description = "Creates and exports the Plugin unity package"
doLast {
def tree = fileTree("${resolverDir}")
{
include '*.unitypackage'
}
def jarresolver_package = tree.getSingleFile()

exec {
executable "${unity_exe}"
args "-g.building",
"-batchmode",
"-projectPath", "${pluginBuildDir}",
"-logFile", "temp/unity.log",
"-importPackage", "${resolverPath}",
"-importPackage", "${jarresolver_package}",
"-exportPackage",
"Assets/GoogleMobileAds",
"Assets/Plugins",
Expand All @@ -102,4 +118,4 @@ task clearTempBuildFolder(type:Delete) {

exportPackage.dependsOn(createTempBuildFolder, copyAndroidLibraryJar,
downloadResolver)
exportPackage.finalizedBy(clearTempBuildFolder, deleteResolver)
exportPackage.finalizedBy(clearTempBuildFolder)
2 changes: 1 addition & 1 deletion source/plugin/Assets/GoogleMobileAds/Api/AdRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace GoogleMobileAds.Api
{
public class AdRequest
{
public const string Version = "3.1.0";
public const string Version = "3.1.1";
public const string TestDeviceSimulator = "SIMULATOR";

public class Builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ static void SetupDeps() {
"extra-google-m2repository",
"extra-android-m2repository"} }
});

// Marshmallow permissions requires app-compat.
Google.VersionHandler.InvokeInstanceMethod(
svcSupport, "DependOn",
new object[] { "com.android.support", "appcompat-v7", "23.1.0+" },
namedArgs: new Dictionary<string, object>() {
{"packageIds", new string[] { "extra-android-m2repository" }},
});
#elif UNITY_IOS
Type iosResolver = Google.VersionHandler.FindClass(
"Google.IOSResolver", "Google.IOSResolver");
Expand All @@ -67,7 +59,7 @@ static void SetupDeps() {
iosResolver, "AddPod",
new object[] { "Google-Mobile-Ads-SDK" },
namedArgs: new Dictionary<string, object>() {
{ "version", "7.8+" }
{ "version", "7.13+" }
});
#endif // UNITY_IOS
}
Expand Down

0 comments on commit 2987ef5

Please sign in to comment.