Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 3pp files for org_checkerframework_checker_util.
Needed by downstream guava target. I think we could also try to fine tune the filter as the file is probably getting eaten by it. https://critique.corp.google.com/cl/477290627/depot/google3/chrome/android/autoroll/build/generate_trimmed_jar.bzl Bug: 1340593 Change-Id: I906a4c14ad1bbc2d3cf8456c01d83b537b30eded Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3925475 Reviewed-by: Andrew Grieve <agrieve@chromium.org> Commit-Queue: Benjamin Joyce (Ben) <bjoyce@chromium.org> Cr-Commit-Position: refs/heads/main@{#1052845}
- Loading branch information
Ben Joyce
authored and
Chromium LUCI CQ
committed
Sep 29, 2022
1 parent
c6bc453
commit 562ddfb
Showing
10 changed files
with
154 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
third_party/android_deps/libs/org_checkerframework_checker_util/3pp/3pp.pb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2021 The Chromium Authors | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
# This is generated, do not edit. Update BuildConfigGenerator.groovy instead. | ||
|
||
create { | ||
source { | ||
script { name: "fetch.py" } | ||
} | ||
} | ||
|
||
upload { | ||
pkg_prefix: "chromium/third_party/android_deps/libs" | ||
universal: true | ||
} |
78 changes: 78 additions & 0 deletions
78
third_party/android_deps/libs/org_checkerframework_checker_util/3pp/fetch.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright 2021 The Chromium Authors | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
# This is generated, do not edit. Update BuildConfigGenerator.groovy and | ||
# 3ppFetch.template instead. | ||
|
||
import argparse | ||
import json | ||
import os | ||
import re | ||
import urllib.request | ||
|
||
_REPO_URL = 'https://repo.maven.apache.org/maven2' | ||
_GROUP_NAME = 'org/checkerframework' | ||
_MODULE_NAME = 'checker-util' | ||
_FILE_EXT = 'jar' | ||
_OVERRIDE_LATEST = None | ||
_PATCH_VERSION = 'cr1' | ||
|
||
|
||
def do_latest(): | ||
if _OVERRIDE_LATEST is not None: | ||
print(_OVERRIDE_LATEST + f'.{_PATCH_VERSION}') | ||
return | ||
maven_metadata_url = '{}/{}/{}/maven-metadata.xml'.format( | ||
_REPO_URL, _GROUP_NAME, _MODULE_NAME) | ||
metadata = urllib.request.urlopen(maven_metadata_url).read().decode( | ||
'utf-8') | ||
# Do not parse xml with the python included parser since it is susceptible | ||
# to maliciously crafted xmls. Only use regular expression parsing to be | ||
# safe. RE should be enough to handle what we need to extract. | ||
match = re.search('<latest>([^<]+)</latest>', metadata) | ||
if match: | ||
latest = match.group(1) | ||
else: | ||
# if no latest info was found just hope the versions are sorted and the | ||
# last one is the latest (as is commonly the case). | ||
latest = re.findall('<version>([^<]+)</version>', metadata)[-1] | ||
print(latest + f'.{_PATCH_VERSION}') | ||
|
||
|
||
def get_download_url(version): | ||
# Remove the patch version when getting the download url | ||
version_no_patch, patch = version.rsplit('.', 1) | ||
if patch.startswith('cr'): | ||
version = version_no_patch | ||
file_url = '{0}/{1}/{2}/{3}/{2}-{3}.{4}'.format(_REPO_URL, _GROUP_NAME, | ||
_MODULE_NAME, version, | ||
_FILE_EXT) | ||
file_name = file_url.rsplit('/', 1)[-1] | ||
|
||
partial_manifest = { | ||
'url': [file_url], | ||
'name': [file_name], | ||
'ext': '.' + _FILE_EXT, | ||
} | ||
print(json.dumps(partial_manifest)) | ||
|
||
|
||
def main(): | ||
ap = argparse.ArgumentParser() | ||
sub = ap.add_subparsers() | ||
|
||
latest = sub.add_parser('latest') | ||
latest.set_defaults(func=lambda _opts: do_latest()) | ||
|
||
download = sub.add_parser('get_url') | ||
download.set_defaults( | ||
func=lambda _opts: get_download_url(os.environ['_3PP_VERSION'])) | ||
|
||
opts = ap.parse_args() | ||
opts.func(opts) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
22 changes: 22 additions & 0 deletions
22
third_party/android_deps/libs/org_checkerframework_checker_util/LICENSE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Checker Framework utilities | ||
Copyright 2004-present by the Checker Framework developers | ||
|
||
MIT License: | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
1 change: 1 addition & 0 deletions
1
third_party/android_deps/libs/org_checkerframework_checker_util/OWNERS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
file://third_party/android_deps/OWNERS |
14 changes: 14 additions & 0 deletions
14
third_party/android_deps/libs/org_checkerframework_checker_util/README.chromium
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Name: Checker Util | ||
Short Name: checker-util | ||
URL: https://checkerframework.org | ||
Version: 3.22.1 | ||
License: MIT | ||
License File: LICENSE | ||
CPEPrefix: unknown | ||
Security Critical: yes | ||
|
||
Description: | ||
checker-util contains utility classes for programmers to use at run time. | ||
|
||
Local Modifications: | ||
No modifications. |
10 changes: 10 additions & 0 deletions
10
third_party/android_deps/libs/org_checkerframework_checker_util/cipd.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright 2018 The Chromium Authors | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
# To create CIPD package run the following command. | ||
# cipd create --pkg-def cipd.yaml -tag version:2@3.22.1.cr1 | ||
package: chromium/third_party/android_deps/libs/org_checkerframework_checker_util | ||
description: "Checker Util" | ||
data: | ||
- file: checker-util-3.22.1.jar |