Skip to content

Commit 9d292e9

Browse files
runnerrunner
authored andcommitted
Release 4.6.0
1 parent 00cf3b9 commit 9d292e9

File tree

176 files changed

+3688
-1875
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+3688
-1875
lines changed

app/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 30
4+
compileSdkVersion 32
55

66
defaultConfig {
77
applicationId "com.unity3d.ads.example"
88
minSdkVersion 19
9-
targetSdkVersion 30
10-
versionCode = 4500
11-
versionName = "4.5.0"
9+
targetSdkVersion 32
10+
versionCode = 4600
11+
versionName = "4.6.0"
1212
}
1313

1414
buildTypes {

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
<activity
1111
android:name=".UnityAdsTestApp"
1212
android:label="@string/title_activity_unity_ads_test_app"
13-
android:theme="@style/AppTheme.NoActionBar">
13+
android:theme="@style/AppTheme.NoActionBar"
14+
android:exported="true">
1415
<intent-filter>
1516
<action android:name="android.intent.action.MAIN" />
1617

build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ buildscript {
1010
kotlin_version = '1.4.32' // 1.5 deprecated Java6
1111
coroutines_version = '1.4.3' // 1.6.0 deprecated Java6
1212
dokka_version = '1.6.10'
13+
startup_runtime_version = '1.1.1'
14+
unity_identifiers_version = '1.0.0'
15+
lifecycle_version = '2.5.1'
1316
}
1417

1518
repositories {
@@ -18,7 +21,7 @@ buildscript {
1821
}
1922

2023
dependencies {
21-
classpath 'com.android.tools.build:gradle:4.2.2'
24+
classpath 'com.android.tools.build:gradle:7.1.3'
2225
classpath 'org.jacoco:org.jacoco.core:0.8.5'
2326
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.20.0'
2427
classpath 'io.github.gradle-nexus:publish-plugin:1.1.0'

fatAar.gradle

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,40 @@
1-
task deleteOldJar(type: Delete) {
2-
delete("../unity-ads/libs/${project.name}.jar")
3-
}
4-
5-
def copyJarTask(buildType) {
1+
def copyJarTask(String buildType) {
62
return tasks.create("copyJars${buildType}", Copy.class) {
7-
from("build/intermediates/compile_library_classes_jar/${buildType}/")
8-
into('../unity-ads/libs/')
3+
from(tasks.getByName("bundleLibCompileToJar${buildType}"))
4+
into("../unity-ads/libs/${buildType}/")
95
include('classes.jar')
106
rename('classes.jar', "${project.name}.jar")
11-
}.dependsOn(deleteOldJar)
7+
}
8+
}
9+
10+
static def tasksDependentOnScar(String buildType) {
11+
return [
12+
"copy${buildType}JniLibsProjectAndLocalJars",
13+
"compile${buildType}Kotlin",
14+
"merge${buildType}JavaResource",
15+
"sync${buildType}LibJars",
16+
"extract${buildType}Annotations",
17+
"dokkaJavadoc"
18+
]
1219
}
1320

1421
project.tasks.whenTaskAdded { Task theTask ->
15-
if (theTask.name == 'bundleLibCompileToJarRelease') {
16-
theTask.finalizedBy(copyJarTask("release"))
17-
}
18-
if (theTask.name == 'bundleLibCompileToJarDebug') {
19-
theTask.finalizedBy(copyJarTask("debug"))
22+
{
23+
["Release", "Debug"].each { buildType ->
24+
{
25+
if (theTask.name == "bundleLibCompileToJar${buildType}") {
26+
if (project.name != "unity-ads") {
27+
theTask.finalizedBy(copyJarTask("${buildType}"))
28+
}
29+
}
30+
if (tasksDependentOnScar("${buildType}").any { theTask.name == it }) {
31+
theTask.dependsOn(":unity-scaradapter-common:copyJars${buildType}")
32+
theTask.dependsOn(":unity-scaradapter-1920:copyJars${buildType}")
33+
theTask.dependsOn(":unity-scaradapter-1950:copyJars${buildType}")
34+
theTask.dependsOn(":unity-scaradapter-2000:copyJars${buildType}")
35+
theTask.dependsOn(":unity-scaradapter-2100:copyJars${buildType}")
36+
}
37+
}
38+
}
2039
}
2140
}

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1818
# org.gradle.parallel=true
1919
android.useAndroidX=true
20+
android.disableAutomaticComponentCreation=true
2021

2122
signing.keyId=34500891
2223
signing.secretKeyRingFile=../gpg-private-key.gpg

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip

unity-ads/build.gradle

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import com.android.ddmlib.DdmPreferences
22

33
apply plugin: 'com.android.library'
44
apply plugin: 'kotlin-android'
5+
apply from: '../fatAar.gradle'
56
apply from: '../dokka.gradle'
67

78
Properties properties = new Properties()
@@ -12,28 +13,31 @@ if (project.rootProject.file('local.properties').exists()) {
1213
ext {
1314
GROUP_ID = "com.unity3d.ads"
1415
ARTIFACT_ID = "unity-ads"
15-
VERSION_ID = "4.5.0"
16-
VERSION_CODE = 4500
16+
VERSION_ID = "4.6.0"
17+
VERSION_CODE = 4600
1718
SIGN_AAR = properties.getProperty("SIGN_AAR") ?: false
1819
}
1920

2021
android {
21-
compileSdkVersion 30
22+
namespace = GROUP_ID
23+
compileSdkVersion 32
2224
DdmPreferences.setLogLevel("verbose")
2325
DdmPreferences.setTimeOut(10 * 60000)
2426

25-
defaultPublishConfig "release"
26-
2727
lintOptions {
2828
abortOnError false
2929
}
3030

3131
defaultConfig {
32+
targetSdkVersion 32
3233
minSdkVersion 19
33-
targetSdkVersion 30
3434
versionCode = VERSION_CODE
3535
versionName = VERSION_ID
36-
36+
gradle.startParameter.taskNames.each {
37+
if (it.contains("AndroidTest")) {
38+
minSdkVersion 26
39+
}
40+
}
3741
setProperty("archivesBaseName", "unity-ads")
3842

3943
buildConfigField('String', 'WEBVIEW_BRANCH', getPropertyStringWithDefaultValue('WEBVIEW_BRANCH', '"' + versionName + '"'))
@@ -87,10 +91,14 @@ android {
8791
}
8892

8993
dependencies {
90-
implementation fileTree(dir: 'libs', include: ['*.jar'])
94+
debugImplementation fileTree(dir: 'libs/Debug', include: ['*.jar'])
95+
releaseImplementation fileTree(dir: 'libs/Release', include: ['*.jar'])
9196
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
9297
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
93-
androidTestCompileOnly project(':unity-scaradapter-2100')
98+
implementation "androidx.startup:startup-runtime:$startup_runtime_version"
99+
implementation "androidx.lifecycle:lifecycle-process:$lifecycle_version"
100+
implementation "com.unity3d.services.identifiers:unity-services-identifiers:$unity_identifiers_version"
101+
androidTestCompileOnly project(':unity-scaradapter-2100')
94102
androidTestCompileOnly project(':unity-scaradapter-2000')
95103
androidTestCompileOnly project(':unity-scaradapter-1950')
96104
androidTestCompileOnly project(':unity-scaradapter-1920')
@@ -100,10 +108,10 @@ dependencies {
100108
androidTestImplementation 'org.mockito:mockito-android:2.25.0'
101109
// A bug in Mockito requires us to add this until an update in released
102110
androidTestImplementation 'org.opentest4j:opentest4j:1.2.0'
103-
androidTestImplementation 'androidx.test:runner:1.3.0'
104-
androidTestImplementation 'androidx.test:rules:1.3.0'
105-
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
106-
androidTestImplementation 'com.google.android.gms:play-services-ads:19.5.0'
111+
androidTestImplementation 'androidx.test:runner:1.5.2'
112+
androidTestImplementation 'androidx.test:rules:1.5.0'
113+
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
114+
androidTestImplementation 'com.google.android.gms:play-services-ads:21.4.0'
107115
androidTestImplementation 'com.android.billingclient:billing:4.0.0'
108116
compileOnly 'com.google.ar:core:1.0.0'
109117
compileOnly project(':unity-scaradapter-2100')
@@ -120,6 +128,8 @@ dependencies {
120128
testImplementation 'com.android.billingclient:billing:4.0.0'
121129
testImplementation "io.mockk:mockk:1.11.0"
122130
testImplementation 'org.json:json:20180813'
131+
testImplementation 'org.powermock:powermock-api-mockito2:2.0.2'
132+
testImplementation 'org.powermock:powermock-module-junit4:2.0.2'
123133
}
124134

125135
task androidSourcesJar(type: Jar) {

unity-ads/jacoco.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ tasks.withType(Test) {
1010

1111
task jacocoTestReport(type: JacocoReport) {
1212
reports {
13-
xml.enabled = true
14-
html.enabled = true
13+
xml.getRequired().set(true)
14+
html.getRequired().set(true)
1515
}
1616

1717
def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*']

unity-ads/proguard-rules.pro

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,15 @@
1717
# Keep all classes in Unity Services package
1818
-keep class com.unity3d.services.** {
1919
*;
20-
}
20+
}
21+
22+
-keep class com.google.android.gms.ads.initialization.** {
23+
*;
24+
}
25+
26+
-keep class com.google.android.gms.ads.MobileAds {
27+
*;
28+
}
29+
30+
-dontwarn com.google.ads.mediation.admob.*
31+
-dontwarn com.google.android.gms.ads.**

unity-ads/src/androidTest/java/com/unity3d/ads/test/InstrumentationTestSuite.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,22 @@
1111
import com.unity3d.ads.test.instrumentation.services.ads.webplayer.WebPlayerViewCacheTest;
1212
import com.unity3d.ads.test.instrumentation.services.ads.webplayer.WebPlayerViewSettingsCacheTest;
1313
import com.unity3d.ads.test.instrumentation.services.banners.BannerViewCacheTests;
14-
import com.unity3d.ads.test.instrumentation.services.core.configuration.ExperimentObjectTest;
15-
import com.unity3d.ads.test.instrumentation.services.core.configuration.ExperimentObjectsTest;
16-
import com.unity3d.ads.test.instrumentation.services.core.configuration.ExperimentsReaderTest;
17-
import com.unity3d.ads.test.instrumentation.services.core.configuration.ExperimentsTest;
1814
import com.unity3d.ads.test.instrumentation.services.core.configuration.InitializationNotificationCenterTest;
19-
import com.unity3d.ads.test.instrumentation.services.core.configuration.PrivacyConfigStatusTest;
20-
import com.unity3d.ads.test.instrumentation.services.core.configuration.PrivacyConfigStorageTest;
21-
import com.unity3d.ads.test.instrumentation.services.core.configuration.PrivacyConfigTest;
2215
import com.unity3d.ads.test.instrumentation.services.core.device.AsyncTokenStorageTest;
2316
import com.unity3d.ads.test.instrumentation.services.core.device.DeviceInfoReaderCompressorTest;
2417
import com.unity3d.ads.test.instrumentation.services.core.device.DeviceInfoReaderFilterProviderTest;
2518
import com.unity3d.ads.test.instrumentation.services.core.device.DeviceInfoReaderWithFilterTest;
26-
import com.unity3d.ads.test.instrumentation.services.core.device.DeviceInfoReaderWithPIITest;
2719
import com.unity3d.ads.test.instrumentation.services.core.device.DeviceInfoReaderWithStorageInfoTest;
2820
import com.unity3d.ads.test.instrumentation.services.core.device.NativeTokenGeneratorTest;
29-
import com.unity3d.ads.test.instrumentation.services.core.device.pii.PiiDataSelectorTest;
30-
import com.unity3d.ads.test.instrumentation.services.core.device.pii.PiiDecisionDataTest;
31-
import com.unity3d.ads.test.instrumentation.services.core.device.pii.PiiTrackingStatusReaderTest;
3221
import com.unity3d.ads.test.instrumentation.services.core.misc.IntervalTimerTest;
33-
import com.unity3d.ads.test.instrumentation.services.core.misc.JsonFlattenerTest;
3422
import com.unity3d.ads.test.instrumentation.services.core.webview.WebViewUrlBuilderTest;
3523
import com.unity3d.ads.test.instrumentation.services.core.webview.bridge.WebViewBridgeSharedObjectTests;
3624
import com.unity3d.ads.test.instrumentation.services.core.webview.bridge.invocation.WebViewBridgeInvocationRunnableTests;
37-
import com.unity3d.ads.test.instrumentation.services.core.webview.bridge.invocation.WebViewBridgeInvocationTests;
3825
import com.unity3d.ads.test.instrumentation.services.store.gpbl.bridges.PurchasesResultBridgeTest;
3926
import com.unity3d.ads.test.legacy.ConfigurationTest;
4027
import com.unity3d.services.analytics.AcquisitionTypeTest;
4128
import com.unity3d.services.analytics.UnityAnalyticsTest;
4229
import com.unity3d.services.core.request.metrics.MetricCommonTagsTest;
43-
import com.unity3d.services.core.request.metrics.MetricsContainerTest;
4430
import com.unity3d.services.core.timer.BaseTimerTest;
4531

4632
import org.junit.runner.RunWith;
@@ -51,19 +37,11 @@
5137
UnityAnalyticsTest.class,
5238
AcquisitionTypeTest.class,
5339
InitializationNotificationCenterTest.class,
54-
ExperimentObjectTest.class,
55-
ExperimentObjectsTest.class,
56-
ExperimentsTest.class,
57-
ExperimentsReaderTest.class,
58-
PrivacyConfigStatusTest.class,
59-
PrivacyConfigStorageTest.class,
60-
PrivacyConfigTest.class,
6140
WebViewUrlBuilderTest.class,
6241
WebPlayerViewSettingsCacheTest.class,
6342
WebPlayerViewCacheTest.class,
6443
BannerViewCacheTests.class,
6544
WebViewBridgeSharedObjectTests.class,
66-
WebViewBridgeInvocationTests.class,
6745
WebViewBridgeInvocationRunnableTests.class,
6846
LoadOperationTests.class,
6947
LoadModuleTests.class,
@@ -76,18 +54,12 @@
7654
GmaScarTestSuite.class,
7755
AsyncTokenStorageTest.class,
7856
NativeTokenGeneratorTest.class,
79-
PiiTrackingStatusReaderTest.class,
80-
PiiDecisionDataTest.class,
81-
PiiDataSelectorTest.class,
8257
DeviceInfoReaderCompressorTest.class,
8358
DeviceInfoReaderFilterProviderTest.class,
8459
DeviceInfoReaderWithStorageInfoTest.class,
85-
DeviceInfoReaderWithPIITest.class,
8660
DeviceInfoReaderWithFilterTest.class,
87-
JsonFlattenerTest.class,
8861
PurchasesResultBridgeTest.class,
8962
MetricCommonTagsTest.class,
90-
MetricsContainerTest.class,
9163
IntervalTimerTest.class,
9264
BaseTimerTest.class
9365
})

0 commit comments

Comments
 (0)