Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add absl. #1061

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 14 additions & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,20 @@ properties of the app.
The settings.gradle (or settings.gradle.kts) file configures repositories for
fetching dependencies, and declares each app module.

### CMake

Contains CMake modules used by the samples. See [CMake/README.md] for details.

[CMake/README.md]: CMake/README.md

### third_party

Contains third-party code used by the samples. These should be kept to a minimum
to avoid the samples being too difficult to reuse. See [third_party/README.md]
for more information.

[third_party/README.md]: third_party/README.md

### Metadata directories

#### .github
Expand Down
6 changes: 6 additions & 0 deletions CMake/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# CMake modules

This directory contains CMake modules used by the samples. They can be imported
in any sample with `include(<NAME>)`, where `<NAME>` is the name of the module
file without the extension. For example, `include(absl)` will include absl in
the build and make those libraries available to the sample.
2 changes: 2 additions & 0 deletions CMake/absl.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include_guard()
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/absl ${CMAKE_CURRENT_BINARY_DIR}/absl)
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import org.gradle.kotlin.dsl.configure

class AndroidApplicationConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
val modulePath = target.rootProject.rootDir.resolve("CMake")
with(target) {
with(pluginManager) {
apply("com.android.application")
Expand All @@ -19,6 +20,12 @@ class AndroidApplicationConventionPlugin : Plugin<Project> {
defaultConfig {
minSdk = Versions.MIN_SDK
targetSdk = Versions.TARGET_SDK

externalNativeBuild {
cmake {
arguments.add("-DCMAKE_MODULE_PATH=$modulePath")
}
}
}
compileOptions {
sourceCompatibility = Versions.JAVA
Expand Down
2 changes: 2 additions & 0 deletions third_party/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DisableFormat: true
SortIncludes: never
13 changes: 13 additions & 0 deletions third_party/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# third_party

This directory contains third-party code used by the samples. Currently this
directory contains only absl, which provides things like `LOG(ERROR)` and
`CHECK()`.

Note that absl does **not** have a stable ABI at the time of writing. As such,
if you are a middleware developer who distributes native libraries in binary
form (whether `.so` or `.a`), you probably cannot use absl. See [Advice for
middleware vendors] for more details.

[Advice for middleware vendors]:
https://developer.android.com/ndk/guides/middleware-vendors
4 changes: 4 additions & 0 deletions third_party/absl/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
Language: Cpp
BasedOnStyle: Google
...
53 changes: 53 additions & 0 deletions third_party/absl/.github/ISSUE_TEMPLATE/00-bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Bug Report
description: Let us know that something does not work as expected.
title: "[Bug]: Please title this bug report"
body:
- type: textarea
id: what-happened
attributes:
label: Describe the issue
description: What happened, and what did you expect to happen?
validations:
required: true
- type: textarea
id: steps
attributes:
label: Steps to reproduce the problem
description: It is important that we are able to reproduce the problem that you are experiencing. Please provide all code and relevant steps to reproduce the problem, including your `BUILD`/`CMakeLists.txt` file and build commands. Links to a GitHub branch or [godbolt.org](https://godbolt.org/) that demonstrate the problem are also helpful.
validations:
required: true
- type: textarea
id: version
attributes:
label: What version of Abseil are you using?
description: Please include the output of `git rev-parse HEAD` or the name of the LTS release that you are using.
validations:
required: true
- type: textarea
id: os
attributes:
label: What operating system and version are you using?
description: If you are using a Linux distribution please include the name and version of the distribution as well.
validations:
required: true
- type: textarea
id: compiler
attributes:
label: What compiler and version are you using?
description: Please include the output of `gcc -v` or `clang -v`, or the equivalent for your compiler.
validations:
required: true
- type: textarea
id: buildsystem
attributes:
label: What build system are you using?
description: Please include the output of `bazel --version` or `cmake --version`, or the equivalent for your build system.
validations:
required: true
- type: textarea
id: additional
attributes:
label: Additional context
description: Add any other context about the problem here.
validations:
required: false
5 changes: 5 additions & 0 deletions third_party/absl/.github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Question
url: https://github.com/abseil/abseil-cpp/discussions
about: Have a question? Ask us anything! :-)
8 changes: 8 additions & 0 deletions third_party/absl/.github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Thank you for your contribution to Abseil!

Before submitting this PR, please be sure to read our [contributing
guidelines](https://github.com/abseil/abseil-cpp/blob/master/CONTRIBUTING.md).

If you are a Googler, please also note that it is required that you send us a
Piper CL instead of using the GitHub pull-request process. The code propagation
process will deliver the change to GitHub.
17 changes: 17 additions & 0 deletions third_party/absl/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Bzlmod lockfile
MODULE.bazel.lock
# Ignore all bazel-* symlinks.
/bazel-*
# Ignore Bazel verbose explanations
--verbose_explanations
# Ignore CMake usual build directory
build
# Ignore Vim files
*.swp
# Ignore QtCreator Project file
CMakeLists.txt.user
# Ignore VS Code files
.vscode/*
# Ignore generated python artifacts
*.pyc
copts/__pycache__/
22 changes: 22 additions & 0 deletions third_party/absl/ABSEIL_ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Please submit a new Abseil Issue using the template below:

## [Short title of proposed API change(s)]

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

## Background

[Provide the background information that is required in order to evaluate the
proposed API changes. No controversial claims should be made here. If there are
design constraints that need to be considered, they should be presented here
**along with justification for those constraints**. Linking to other docs is
good, but please keep the **pertinent information as self contained** as
possible in this section.]

## Proposed API Change (s)

[Please clearly describe the API change(s) being proposed. If multiple changes,
please keep them clearly distinguished. When possible, **use example code
snippets to illustrate before-after API usages**. List pros-n-cons. Highlight
the main questions that you want to be answered. Given the Abseil project compatibility requirements, describe why the API change is safe.]
6 changes: 6 additions & 0 deletions third_party/absl/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This is the list of Abseil authors for copyright purposes.
#
# This does not necessarily list everyone who has contributed code, since in
# some cases, their employer may be the copyright holder. To see the full list
# of contributors, see the revision history in source control.
Google Inc.
25 changes: 25 additions & 0 deletions third_party/absl/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# Copyright 2020 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

package(default_visibility = ["//visibility:public"])

licenses(["notice"]) # Apache 2.0

# Expose license for external usage through bazel.
exports_files([
"AUTHORS",
"LICENSE",
])
Loading
Loading