office-gobmx/solenv/maven/mvn.py
Rene Engelhard ea8d6cd596 Adapt buck build to jars merged into libreoffice.jar
Since ae855bf481 and
35518c9236 the ridl,jurt und unoil jars
were merged into libreoffice.jar. Adapt the buck build correspondingly.

Preserve the publishing of merged jars for now with dummy content and
consider to remove them in future releases.

Test Plan:

1. To replace version number with upcoming release version:

  $ solenv/bin/version.py 7.1.0

2. To install the API to local Maven repository:

  $ VERBOSE=1 buck build api_install

3. To deploy the API to Maven Central:

  $ VERBOSE=1 buck build api_deploy

Change-Id: Id1b2135682ab962c901b944f3c26aeead9a4b19b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93724
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2020-11-30 11:27:47 +01:00

78 lines
2.1 KiB
Python
Executable file

#!/usr/bin/python
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import print_function
from optparse import OptionParser
from os import path, environ
from subprocess import check_output
from sys import stderr
M = {
'juh': 'javaunohelper',
'jurt': 'jurt',
'officebean': 'bean',
'ridl': 'ridljar',
'unoil': 'unoil',
'unoloader': 'ridljar',
'libreoffice': 'ridljar',
}
opts = OptionParser()
opts.add_option('--repository', help='maven repository id')
opts.add_option('--url', help='maven repository url')
opts.add_option('-o')
opts.add_option('-a', help='action (valid actions are: install,deploy)')
opts.add_option('-v', help='gerrit version')
opts.add_option('-s', action='append', help='triplet of artifactId:type:path')
args, ctx = opts.parse_args()
if not args.v:
print('version is empty', file=stderr)
exit(1)
root = path.abspath(__file__)
while not path.exists(path.join(root, '.buckconfig')):
root = path.dirname(root)
if 'install' == args.a:
cmd = [
'mvn',
'install:install-file',
'-Dversion=%s' % args.v,
]
elif 'deploy' == args.a:
cmd = [
'mvn',
'gpg:sign-and-deploy-file',
'-DrepositoryId=%s' % args.repository,
'-Durl=%s' % args.url,
]
else:
print("unknown action -a %s" % args.a, file=stderr)
exit(1)
for spec in args.s:
artifact, packaging_type, src = spec.split(':')
exe = cmd + [
'-DpomFile=%s' % path.join(root, '%s/pom.%s.xml' % (M[artifact], artifact)),
'-Dpackaging=%s' % packaging_type,
'-Dfile=%s' % src,
]
try:
if environ.get('VERBOSE'):
print(' '.join(exe), file=stderr)
check_output(exe)
except Exception as e:
print('%s command failed: %s' % (args.a, e), file=stderr)
exit(1)
with open(args.o, 'w') as fd:
if args.repository:
print('Repository: %s' % args.repository, file=fd)
if args.url:
print('URL: %s' % args.url, file=fd)
print('Version: %s' % args.v, file=fd)