Add jsr305 as a dependency to AAR.
jsr305 is necessary dependency for Nullable annotations. Also adds a flag to release_aar.py to specify the build directory manually. This makes it easier to test the script without full recompilation. Bug: webrtc:8881 Change-Id: Ib4b8cd4592ced9c92ca2810928bcbb6173d2164e Reviewed-on: https://webrtc-review.googlesource.com/65081 Commit-Queue: Sami Kalliomäki <sakal@webrtc.org> Reviewed-by: Magnus Jedvert <magjed@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22671}
This commit is contained in:

committed by
Commit Bot

parent
63b48df334
commit
002e710d07
@ -46,6 +46,7 @@ dependencies {
|
|||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
implementation fileTree(dir: '../../androidapp/third_party/autobanh/lib', include: ['autobanh.jar'])
|
implementation fileTree(dir: '../../androidapp/third_party/autobanh/lib', include: ['autobanh.jar'])
|
||||||
implementation 'com.android.support:appcompat-v7:26.1.0'
|
implementation 'com.android.support:appcompat-v7:26.1.0'
|
||||||
|
implementation 'com.google.code.findbugs:jsr305:3.0.2'
|
||||||
implementation 'org.webrtc:google-webrtc:1.0.+'
|
implementation 'org.webrtc:google-webrtc:1.0.+'
|
||||||
testImplementation 'junit:junit:4.12'
|
testImplementation 'junit:junit:4.12'
|
||||||
androidTestImplementation 'com.android.support.test:runner:1.0.1'
|
androidTestImplementation 'com.android.support.test:runner:1.0.1'
|
||||||
|
@ -69,6 +69,9 @@ def _ParseArgs():
|
|||||||
help='Skips running the tests.')
|
help='Skips running the tests.')
|
||||||
parser.add_argument('--publish', action='store_true', default=False,
|
parser.add_argument('--publish', action='store_true', default=False,
|
||||||
help='Automatically publishes the library if the tests pass.')
|
help='Automatically publishes the library if the tests pass.')
|
||||||
|
parser.add_argument('--build-dir', default=None,
|
||||||
|
help='Temporary directory to store the build files. If not specified, '
|
||||||
|
'a new directory will be created.')
|
||||||
parser.add_argument('--verbose', action='store_true', default=False,
|
parser.add_argument('--verbose', action='store_true', default=False,
|
||||||
help='Debug logging.')
|
help='Debug logging.')
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
@ -227,7 +230,7 @@ def _DeleteUnpublishedVersion(user, password, version):
|
|||||||
raise Exception('Failed to delete version. Response: %s' % response)
|
raise Exception('Failed to delete version. Response: %s' % response)
|
||||||
|
|
||||||
|
|
||||||
def ReleaseAar(use_goma, skip_tests, publish):
|
def ReleaseAar(use_goma, skip_tests, publish, build_dir):
|
||||||
version = '1.0.' + _GetCommitPos()
|
version = '1.0.' + _GetCommitPos()
|
||||||
commit = _GetCommitHash()
|
commit = _GetCommitHash()
|
||||||
logging.info('Releasing AAR version %s with hash %s', version, commit)
|
logging.info('Releasing AAR version %s with hash %s', version, commit)
|
||||||
@ -238,18 +241,21 @@ def ReleaseAar(use_goma, skip_tests, publish):
|
|||||||
raise Exception('Environment variables BINTRAY_USER and BINTRAY_API_KEY '
|
raise Exception('Environment variables BINTRAY_USER and BINTRAY_API_KEY '
|
||||||
'must be defined.')
|
'must be defined.')
|
||||||
|
|
||||||
tmp_dir = tempfile.mkdtemp()
|
# If build directory is not specified, create a temporary directory.
|
||||||
|
use_tmp_dir = not build_dir
|
||||||
|
if use_tmp_dir:
|
||||||
|
build_dir = tempfile.mkdtemp()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
base_name = ARTIFACT_ID + '-' + version
|
base_name = ARTIFACT_ID + '-' + version
|
||||||
aar_file = os.path.join(tmp_dir, base_name + '.aar')
|
aar_file = os.path.join(build_dir, base_name + '.aar')
|
||||||
third_party_licenses_file = os.path.join(tmp_dir, 'LICENSE.md')
|
third_party_licenses_file = os.path.join(build_dir, 'LICENSE.md')
|
||||||
pom_file = os.path.join(tmp_dir, base_name + '.pom')
|
pom_file = os.path.join(build_dir, base_name + '.pom')
|
||||||
|
|
||||||
logging.info('Building at %s', tmp_dir)
|
logging.info('Building at %s', build_dir)
|
||||||
BuildAar(ARCHS, aar_file,
|
BuildAar(ARCHS, aar_file,
|
||||||
use_goma=use_goma,
|
use_goma=use_goma,
|
||||||
ext_build_dir=os.path.join(tmp_dir, 'aar-build'))
|
ext_build_dir=os.path.join(build_dir, 'aar-build'))
|
||||||
_GeneratePom(pom_file, version, commit)
|
_GeneratePom(pom_file, version, commit)
|
||||||
|
|
||||||
_UploadFile(user, api_key, aar_file, version, base_name + '.aar')
|
_UploadFile(user, api_key, aar_file, version, base_name + '.aar')
|
||||||
@ -257,7 +263,7 @@ def ReleaseAar(use_goma, skip_tests, publish):
|
|||||||
'THIRD_PARTY_LICENSES.md')
|
'THIRD_PARTY_LICENSES.md')
|
||||||
_UploadFile(user, api_key, pom_file, version, base_name + '.pom')
|
_UploadFile(user, api_key, pom_file, version, base_name + '.pom')
|
||||||
|
|
||||||
tests_pass = skip_tests or _TestAAR(tmp_dir, user, api_key, version)
|
tests_pass = skip_tests or _TestAAR(build_dir, user, api_key, version)
|
||||||
if not tests_pass:
|
if not tests_pass:
|
||||||
logging.info('Discarding library.')
|
logging.info('Discarding library.')
|
||||||
_PublishAAR(user, api_key, version, {'discard': True})
|
_PublishAAR(user, api_key, version, {'discard': True})
|
||||||
@ -271,13 +277,14 @@ def ReleaseAar(use_goma, skip_tests, publish):
|
|||||||
logging.info('Note: The library has not not been published automatically.'
|
logging.info('Note: The library has not not been published automatically.'
|
||||||
' Please do so manually if desired.')
|
' Please do so manually if desired.')
|
||||||
finally:
|
finally:
|
||||||
shutil.rmtree(tmp_dir, True)
|
if use_tmp_dir:
|
||||||
|
shutil.rmtree(build_dir, True)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
args = _ParseArgs()
|
args = _ParseArgs()
|
||||||
logging.basicConfig(level=logging.DEBUG if args.verbose else logging.INFO)
|
logging.basicConfig(level=logging.DEBUG if args.verbose else logging.INFO)
|
||||||
ReleaseAar(args.use_goma, args.skip_tests, args.publish)
|
ReleaseAar(args.use_goma, args.skip_tests, args.publish, args.build_dir)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
@ -15,4 +15,12 @@
|
|||||||
<project.build.commitid>{{ commit }}</project.build.commitid>
|
<project.build.commitid>{{ commit }}</project.build.commitid>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.code.findbugs</groupId>
|
||||||
|
<artifactId>jsr305</artifactId>
|
||||||
|
<version>3.+</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
Reference in New Issue
Block a user