Skip to content

Commit 39cc616

Browse files
committed
Start copying over the files.
1 parent 0a2c9da commit 39cc616

File tree

65 files changed

+12126
-4
lines changed

Some content is hidden

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

65 files changed

+12126
-4
lines changed

.github/workflows/integration_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717
required: true
1818
apis:
1919
description: 'CSV of apis to build and test'
20-
default: 'analytics,app_check,auth,database,dynamic_links,firestore,functions,gma,installations,messaging,remote_config,storage'
20+
default: 'analytics,app_check,auth,database,dynamic_links,firestore,functions,gma,installations,messaging,remote_config,storage,ump'
2121
required: true
2222
operating_systems:
2323
description: 'CSV of VMs to run on'
@@ -192,7 +192,7 @@ jobs:
192192
# list. Then we can use fromJson to define the field in the matrix for the tests job.
193193
if [[ "${{ github.event.schedule }}" == "0 9 * * *" ]]; then
194194
# at 1am PST/2am PDT. Running integration tests and generate test report for all testapps except firestore
195-
apis="analytics,app_check,auth,database,dynamic_links,functions,gma,installations,messaging,remote_config,storage"
195+
apis="analytics,app_check,auth,database,dynamic_links,functions,gma,installations,messaging,remote_config,storage,ump"
196196
echo "::warning ::Running main nightly tests"
197197
elif [[ "${{ github.event.schedule }}" == "0 10 * * *" || "${{ github.event.schedule }}" == "0 11 * * *" ]]; then
198198
# at 2am PST/3am PDT and 3am PST/4am PDT. Running integration tests for firestore and generate test report.

Android/firebase_dependencies.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ def firebaseDependenciesMap = [
2929
'functions' : ['com.google.firebase:firebase-functions'],
3030
'gma' : ['com.google.android.gms:play-services-ads:23.0.0',
3131
'com.google.android.ump:user-messaging-platform:2.2.0'],
32+
'ump' : ['com.google.android.gms:play-services-ads:23.0.0',
33+
'com.google.android.ump:user-messaging-platform:2.2.0'],
3234
'installations' : ['com.google.firebase:firebase-installations'],
3335
'invites' : ['com.google.firebase:firebase-invites'],
3436
// Messaging has an additional local dependency to include.

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ option(FIREBASE_INCLUDE_FUNCTIONS
5050
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
5151
option(FIREBASE_INCLUDE_GMA "Include the GMA library."
5252
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
53+
option(FIREBASE_INCLUDE_UMP "Include the UMP library."
54+
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
5355
option(FIREBASE_INCLUDE_INSTALLATIONS
5456
"Include the Firebase Installations library."
5557
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
@@ -123,9 +125,10 @@ if(FIREBASE_CPP_BUILD_TESTS OR FIREBASE_CPP_BUILD_STUB_TESTS)
123125
endif()
124126

125127
if (PLATFORM STREQUAL TVOS OR PLATFORM STREQUAL SIMULATOR_TVOS)
126-
# GMA and FDL are not supported on tvOS.
128+
# GMA, UMP, and FDL are not supported on tvOS.
127129
set(FIREBASE_INCLUDE_DYNAMIC_LINKS OFF)
128130
set(FIREBASE_INCLUDE_GMA OFF)
131+
set(FIREBASE_INCLUDE_UMP OFF)
129132
endif()
130133

131134
# Occasionally ANDROID is not being set correctly when invoked by gradle, so
@@ -630,6 +633,9 @@ endif()
630633
if (FIREBASE_INCLUDE_GMA)
631634
add_subdirectory(gma)
632635
endif()
636+
if (FIREBASE_INCLUDE_UMP)
637+
add_subdirectory(gma)
638+
endif()
633639
if (FIREBASE_INCLUDE_INSTALLATIONS)
634640
add_subdirectory(installations)
635641
endif()

build_scripts/packaging.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# List of all Firebase products to include in the binary SDK package.
44
readonly -a product_list=(analytics app app_check auth database
55
dynamic_links firestore functions gma installations messaging
6-
remote_config storage)
6+
remote_config storage ump)

release_build_files/Android/firebase_dependencies.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ def firebaseDependenciesMap = [
2929
'functions' : ['com.google.firebase:firebase-functions'],
3030
'gma' : ['com.google.android.gms:play-services-ads:23.0.0',
3131
'com.google.android.ump:user-messaging-platform:2.2.0'],
32+
'ump' : ['com.google.android.gms:play-services-ads:23.0.0',
33+
'com.google.android.ump:user-messaging-platform:2.2.0'],
3234
'installations' : ['com.google.firebase:firebase-installations'],
3335
'invites' : ['com.google.firebase:firebase-invites'],
3436
// Messaging has an additional local dependency to include.

scripts/gha/report_build_status.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ def format_errors(all_errors, severity, event):
193193
product_name = 'missing logs'
194194
elif product == 'gma':
195195
product_name = product.upper()
196+
elif product == 'ump':
197+
product_name = product.upper()
196198
else:
197199
product_name = product.replace('_', ' ').title()
198200

@@ -664,6 +666,7 @@ def main(argv):
664666
latest = latest.replace(" ", " ")
665667
product = product.replace("_", " ")
666668
product = product.upper() if product == "gma" else product.title()
669+
product = product.upper() if product == "ump" else product.title()
667670
if len(test_list[test_id]['links']) > 0:
668671
latest = "[%s](%s)" % (latest, test_list[test_id]['links'][-1])
669672

ump/CMakeLists.txt

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Copyright 2021 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# CMake file for the firebase_ump library
16+
17+
# Common source files used by all platforms
18+
set(common_SRCS
19+
src/common/ump/consent_info.cc
20+
src/common/ump/consent_info_internal.cc
21+
src/common/gma_common.cc
22+
)
23+
24+
# Define the resource build needed for Android
25+
firebase_cpp_gradle(":ump:ump_resources:generateDexJarRelease"
26+
"${CMAKE_CURRENT_LIST_DIR}/ump_resources/build/ump_resources_lib.jar")
27+
binary_to_array("ump_resources"
28+
"${CMAKE_CURRENT_LIST_DIR}/ump_resources/build/ump_resources_lib.jar"
29+
"firebase_ump"
30+
"${FIREBASE_GEN_FILE_DIR}/ump")
31+
32+
# Source files used by the Android implementation.
33+
set(android_SRCS
34+
${ump_resources_source}
35+
src/android/ump/consent_info_internal_android.cc
36+
src/android/gma_android.cc
37+
)
38+
39+
# Source files used by the iOS implementation.
40+
set(ios_SRCS
41+
src/ios/ump/consent_info_internal_ios.mm
42+
src/ios/gma_ios.mm
43+
)
44+
45+
# Source files used by the stub implementation.
46+
set(stub_SRCS
47+
src/stub/ump/consent_info_internal_stub.cc
48+
)
49+
50+
if(ANDROID)
51+
set(ump_platform_SRCS
52+
"${android_SRCS}")
53+
elseif(IOS)
54+
set(ump_platform_SRCS
55+
"${ios_SRCS}")
56+
else()
57+
set(ump_platform_SRCS
58+
"${stub_SRCS}")
59+
endif()
60+
61+
add_library(firebase_ump STATIC
62+
${common_SRCS}
63+
${ump_platform_SRCS})
64+
65+
set_property(TARGET firebase_ump PROPERTY FOLDER "Firebase Cpp")
66+
67+
# Set up the dependency on Firebase App.
68+
target_link_libraries(firebase_ump
69+
PUBLIC firebase_app)
70+
# Public headers all refer to each other relative to the src/include directory,
71+
# while private headers are relative to the entire C++ SDK directory.
72+
target_include_directories(firebase_ump
73+
PUBLIC
74+
${CMAKE_CURRENT_LIST_DIR}/src/include
75+
PRIVATE
76+
${FIREBASE_CPP_SDK_ROOT_DIR}
77+
)
78+
target_compile_definitions(firebase_ump
79+
PRIVATE
80+
-DINTERNAL_EXPERIMENTAL=1
81+
)
82+
# Automatically include headers that might not be declared.
83+
if(MSVC)
84+
add_definitions(/FI"assert.h" /FI"string.h" /FI"stdint.h")
85+
else()
86+
add_definitions(-include assert.h -include string.h)
87+
endif()
88+
89+
if(ANDROID)
90+
firebase_cpp_proguard_file(ump)
91+
elseif(IOS)
92+
# UMP for iOS uses weak references, which requires enabling Automatic
93+
# Reference Counting (ARC). Also enable BitCode.
94+
target_compile_options(firebase_ump
95+
PUBLIC "-fobjc-arc" "-fembed-bitcode")
96+
target_link_libraries(firebase_ump
97+
PUBLIC "-fembed-bitcode")
98+
99+
setup_pod_headers(
100+
firebase_ump
101+
POD_NAMES
102+
Google-Mobile-Ads-SDK
103+
GoogleUserMessagingPlatform
104+
)
105+
106+
# UMP expects the header files to be in a subfolder, so set up a symlink to
107+
# accomplish that.
108+
symlink_pod_headers(firebase_ump GoogleUserMessagingPlatform UserMessagingPlatform)
109+
110+
if (FIREBASE_XCODE_TARGET_FORMAT STREQUAL "frameworks")
111+
set_target_properties(firebase_ump PROPERTIES
112+
FRAMEWORK TRUE
113+
)
114+
endif()
115+
endif()
116+
117+
cpp_pack_library(firebase_ump "")
118+
cpp_pack_public_headers()

ump/build.gradle

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
// Copyright 2021 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
buildscript {
16+
repositories {
17+
google()
18+
mavenCentral()
19+
}
20+
dependencies {
21+
classpath 'com.android.tools.build:gradle:7.4.2'
22+
}
23+
}
24+
allprojects {
25+
repositories {
26+
google()
27+
mavenCentral()
28+
}
29+
}
30+
31+
apply plugin: 'com.android.library'
32+
33+
android {
34+
compileSdkVersion 34
35+
ndkPath System.getenv('ANDROID_NDK_HOME')
36+
buildToolsVersion '32.0.0'
37+
38+
sourceSets {
39+
main {
40+
manifest.srcFile '../android_build_files/AndroidManifest.xml'
41+
}
42+
}
43+
44+
externalNativeBuild {
45+
cmake {
46+
path '../CMakeLists.txt'
47+
}
48+
}
49+
50+
defaultConfig {
51+
minSdkVersion 23
52+
targetSdkVersion 34
53+
versionCode 1
54+
versionName "1.0"
55+
56+
buildTypes {
57+
release {
58+
minifyEnabled false
59+
}
60+
}
61+
62+
externalNativeBuild {
63+
cmake {
64+
targets 'firebase_ump'
65+
// Args are: Re-use app library prebuilt by app gradle project.
66+
// Don't configure all the cmake subprojects.
67+
// Only include needed project.
68+
arguments '-DFIREBASE_CPP_USE_PRIOR_GRADLE_BUILD=ON',
69+
'-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF',
70+
'-DFIREBASE_INCLUDE_UMP=ON'
71+
}
72+
}
73+
}
74+
75+
lintOptions {
76+
abortOnError false
77+
}
78+
}
79+
80+
dependencies {
81+
implementation project(':app')
82+
}
83+
apply from: "$rootDir/android_build_files/android_abis.gradle"
84+
apply from: "$rootDir/android_build_files/extract_and_dex.gradle"
85+
apply from: "$rootDir/android_build_files/generate_proguard.gradle"
86+
project.afterEvaluate {
87+
generateProguardFile('ump')
88+
setupDexDependencies(':ump:ump_resources')
89+
preBuild.dependsOn(':app:build')
90+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/* Copyright 2021 Google LLC
4+
**
5+
** Licensed under the Apache License, Version 2.0 (the "License");
6+
** you may not use this file except in compliance with the License.
7+
** You may obtain a copy of the License at
8+
**
9+
** http://www.apache.org/licenses/LICENSE-2.0
10+
**
11+
** Unless required by applicable law or agreed to in writing, software
12+
** distributed under the License is distributed on an "AS IS" BASIS,
13+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
** See the License for the specific language governing permissions and
15+
** limitations under the License.
16+
*/
17+
-->
18+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
19+
package="com.google.android.admob.testapp"
20+
android:versionCode="1"
21+
android:versionName="1.0">
22+
<uses-permission android:name="android.permission.INTERNET" />
23+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
24+
<uses-permission android:name="android.permission.WAKE_LOCK" />
25+
<application android:label="@string/app_name">
26+
<!-- You may replace the sample App ID below with your own App ID. -->
27+
<meta-data
28+
android:name="com.google.android.gms.ads.APPLICATION_ID"
29+
android:value="ca-app-pub-3940256099942544~3347511713"/>
30+
<activity android:name="android.app.NativeActivity"
31+
android:exported="true"
32+
android:screenOrientation="portrait"
33+
android:configChanges="orientation|screenSize">
34+
<meta-data android:name="android.app.lib_name"
35+
android:value="android_integration_test_main" />
36+
<intent-filter>
37+
<action android:name="android.intent.action.MAIN" />
38+
<category android:name="android.intent.category.LAUNCHER" />
39+
</intent-filter>
40+
<intent-filter>
41+
<action android:name="com.google.intent.action.TEST_LOOP"/>
42+
<category android:name="android.intent.category.DEFAULT"/>
43+
<data android:mimeType="application/javascript"/>
44+
</intent-filter>
45+
<intent-filter>
46+
<action android:name="com.google.intent.action.UI_TEST"/>
47+
<category android:name="android.intent.category.DEFAULT"/>
48+
<data android:mimeType="application/javascript"/>
49+
</intent-filter>
50+
</activity>
51+
<meta-data android:name="com.google.test.loops" android:value="1" />
52+
</application>
53+
</manifest>

0 commit comments

Comments
 (0)