Skip to content

Commit effd39f

Browse files
committed
Add copybara logic to handle CL description errors
This is what the documentation recommends to do. PiperOrigin-RevId: 346662580
1 parent e227d5b commit effd39f

19 files changed

+1701
-0
lines changed

installations/CMakeLists.txt

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Copyright 2020 Google
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_installations library
16+
17+
# Common source files used by all platforms
18+
set(common_SRCS
19+
src/installations.cc)
20+
21+
# Source files used by the Android implementation.
22+
set(android_SRCS
23+
src/android/installations_android.cc)
24+
25+
# Source files used by the iOS implementation.
26+
set(ios_SRCS
27+
src/ios/installations_ios.mm)
28+
29+
# Source files used by the desktop implementation.
30+
set(desktop_SRCS
31+
src/desktop/installations_stub.cc)
32+
33+
if(ANDROID)
34+
set(installations_platform_SRCS
35+
"${android_SRCS}")
36+
elseif(IOS)
37+
set(installations_platform_SRCS
38+
"${ios_SRCS}")
39+
else()
40+
set(installations_platform_SRCS
41+
"${desktop_SRCS}")
42+
endif()
43+
44+
if(ANDROID OR IOS OR use_stub)
45+
set(additional_link_LIB)
46+
else()
47+
set(additional_link_LIB
48+
firebase_installations_desktop_impl)
49+
endif()
50+
51+
add_library(firebase_installations STATIC
52+
${common_SRCS}
53+
${installations_platform_SRCS})
54+
55+
set_property(TARGET firebase_installations PROPERTY FOLDER "Firebase Cpp")
56+
57+
# Set up the dependency on Firebase App.
58+
target_link_libraries(firebase_installations
59+
PUBLIC
60+
firebase_app
61+
PRIVATE
62+
${additional_link_LIB}
63+
)
64+
# Public headers all refer to each other relative to the src/include directory,
65+
# while private headers are relative to the entire C++ SDK directory.
66+
target_include_directories(firebase_installations
67+
PUBLIC
68+
${CMAKE_CURRENT_LIST_DIR}/src/include
69+
PRIVATE
70+
${FIREBASE_CPP_SDK_ROOT_DIR}
71+
)
72+
target_compile_definitions(firebase_installations
73+
PRIVATE
74+
-DINTERNAL_EXPERIMENTAL=1
75+
)
76+
# Automatically include headers that might not be declared.
77+
if(MSVC)
78+
add_definitions(/FI"assert.h" /FI"string.h" /FI"stdint.h")
79+
else()
80+
add_definitions(-include assert.h -include string.h)
81+
endif()
82+
83+
if(ANDROID)
84+
firebase_cpp_proguard_file(installations)
85+
elseif(IOS)
86+
# Enable Automatic Reference Counting (ARC).
87+
set_property(
88+
TARGET firebase_installations
89+
APPEND_STRING PROPERTY
90+
COMPILE_FLAGS "-fobjc-arc")
91+
92+
setup_pod_headers(
93+
firebase_installations
94+
POD_NAMES
95+
FirebaseCore
96+
FirebaseInstallations
97+
)
98+
endif()
99+
100+
if(FIREBASE_CPP_BUILD_TESTS)
101+
# Add the tests subdirectory
102+
add_subdirectory(tests)
103+
endif()
104+
105+
cpp_pack_library(firebase_installations "")
106+
cpp_pack_public_headers()

installations/build.gradle

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
// Copyright 2020 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+
jcenter()
19+
}
20+
dependencies {
21+
classpath 'com.android.tools.build:gradle:3.2.1'
22+
}
23+
}
24+
allprojects {
25+
repositories {
26+
google()
27+
jcenter()
28+
}
29+
}
30+
31+
apply plugin: 'com.android.library'
32+
33+
android {
34+
compileSdkVersion 28
35+
buildToolsVersion '28.0.3'
36+
37+
sourceSets {
38+
main {
39+
manifest.srcFile '../android_build_files/AndroidManifest.xml'
40+
}
41+
}
42+
43+
externalNativeBuild {
44+
cmake {
45+
path '../CMakeLists.txt'
46+
}
47+
}
48+
49+
defaultConfig {
50+
// This is the platform API where NativeActivity was introduced.
51+
minSdkVersion 9
52+
targetSdkVersion 28
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_installations'
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_INSTALLATIONS=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/generate_proguard.gradle"
84+
project.afterEvaluate {
85+
generateProguardFile('installations')
86+
}

0 commit comments

Comments
 (0)