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>
This commit is contained in:
Rene Engelhard 2020-05-08 14:19:45 +02:00 committed by Christian Lohmaier
parent e35b2eede0
commit ea8d6cd596
10 changed files with 79 additions and 34 deletions

9
BUCK
View file

@ -34,6 +34,12 @@ prebuilt_jar(
visibility = ['PUBLIC'], visibility = ['PUBLIC'],
) )
prebuilt_jar(
name = 'libreoffice',
binary_jar = 'instdir/program/classes/libreoffice.jar',
visibility = ['PUBLIC'],
)
zip_file( zip_file(
name = 'api', name = 'api',
srcs = [ srcs = [
@ -55,5 +61,8 @@ zip_file(
':unoloader', ':unoloader',
'//ridljar/source/unoloader:unoloader-src', '//ridljar/source/unoloader:unoloader-src',
'//ridljar/source/unoloader:unoloader-javadoc', '//ridljar/source/unoloader:unoloader-javadoc',
':libreoffice',
'//ridljar:libreoffice-src',
'//ridljar:libreoffice-javadoc',
] ]
) )

View file

@ -2,6 +2,7 @@
java_sources( java_sources(
name = 'officebean-src', name = 'officebean-src',
srcs = glob(['com/**']), srcs = glob(['com/**']),
root = '.',
visibility = ['PUBLIC'], visibility = ['PUBLIC'],
) )
@ -14,10 +15,8 @@ java_doc(
paths = ['.'], paths = ['.'],
srcs = glob(['com/**']), srcs = glob(['com/**']),
deps = [ deps = [
'//:juh', '//:libreoffice',
'//:officebean', '//:officebean',
'//:unoil',
'//:ridl',
], ],
visibility = ['PUBLIC'], visibility = ['PUBLIC'],
) )

View file

@ -1,20 +1,21 @@
genrule(
java_sources(
name = 'juh-src', name = 'juh-src',
srcs = glob(['com/**']), cmd = ' && '.join([
'cd $TMP',
'echo "FAKE SOURCE ARCHIVE" > README',
'zip -qr $OUT *',
]),
out = 'juh-src.jar',
visibility = ['PUBLIC'], visibility = ['PUBLIC'],
) )
java_doc( genrule(
name = 'juh-javadoc', name = 'juh-javadoc',
title = 'LibreOffice Makes it easier to use UNO with Java', cmd = ' && '.join([
pkgs = [ 'cd $TMP',
'com.sun.star', 'echo "FAKE JAVADOC ARCHIVE" > README',
], 'zip -qr $OUT *',
paths = ['.'], ]),
srcs = glob(['com/**']), out = 'juh-javadoc.jar',
deps = [
'//:juh',
],
visibility = ['PUBLIC'], visibility = ['PUBLIC'],
) )

View file

@ -1,21 +1,23 @@
java_sources( genrule(
name = 'jurt-src', name = 'jurt-src',
srcs = glob(['com/**']), cmd = ' && '.join([
'cd $TMP',
'echo "FAKE SOURCE ARCHIVE" > README',
'zip -qr $OUT *',
]),
out = 'jurt-src.jar',
visibility = ['PUBLIC'], visibility = ['PUBLIC'],
) )
java_doc( genrule(
name = 'jurt-javadoc', name = 'jurt-javadoc',
title = 'LibreOffice Java Uno Runtime', cmd = ' && '.join([
pkgs = [ 'cd $TMP',
'com.sun.star', 'echo "FAKE JAVADOC ARCHIVE" > README',
], 'zip -qr $OUT *',
paths = ['.'], ]),
srcs = glob(['com/**']), out = 'jurt-javadoc.jar',
deps = [
'//:jurt',
'//:unoloader',
],
visibility = ['PUBLIC'], visibility = ['PUBLIC'],
) )

View file

@ -1,20 +1,46 @@
genrule(
name = 'ridl-src',
cmd = ' && '.join([
'cd $TMP',
'echo "FAKE SOURCE ARCHIVE" > README',
'zip -qr $OUT *',
]),
out = 'ridl-src.jar',
visibility = ['PUBLIC'],
)
genrule(
name = 'ridl-javadoc',
cmd = ' && '.join([
'cd $TMP',
'echo "FAKE JAVADOC ARCHIVE" > README',
'zip -qr $OUT *',
]),
out = 'ridl-javadoc.jar',
visibility = ['PUBLIC'],
)
java_sources( java_sources(
name = 'ridl-src', name = 'libreoffice-src',
srcs = glob(['com/**']), srcs = glob(['com/**']),
root = '.',
visibility = ['PUBLIC'], visibility = ['PUBLIC'],
) )
java_doc( java_doc(
name = 'ridl-javadoc', name = 'libreoffice-javadoc',
title = 'LibreOffice types for the Java Uno typesystem', title = 'LibreOffice types for the Java Uno typesystem',
pkgs = [ pkgs = [
'com.sun.star', 'com.sun.star.comp',
'com.sun.star.lib',
'com.sun.star.uno',
], ],
paths = ['.'], paths = ['.'],
srcs = glob(['com/**']), srcs = glob(['com/**']),
deps = [ deps = [
'//:ridl', '//:unoloader',
'//:libreoffice',
], ],
visibility = ['PUBLIC'], visibility = ['PUBLIC'],
) )

View file

@ -2,6 +2,7 @@
java_sources( java_sources(
name = 'unoloader-src', name = 'unoloader-src',
srcs = glob(['com/**']), srcs = glob(['com/**']),
root = '.',
visibility = ['PUBLIC'], visibility = ['PUBLIC'],
) )

View file

@ -12,6 +12,7 @@ M = {
'ridl': 'ridljar', 'ridl': 'ridljar',
'unoil': 'unoil', 'unoil': 'unoil',
'unoloader': 'ridljar', 'unoloader': 'ridljar',
'libreoffice': 'ridljar',
} }
parser = OptionParser() parser = OptionParser()
@ -40,7 +41,7 @@ def replace_in_file(filename, src_pattern):
src_pattern = re.compile(r'^(\s*<version>)([-.@\w]+)(</version>\s*)$', src_pattern = re.compile(r'^(\s*<version>)([-.@\w]+)(</version>\s*)$',
re.MULTILINE) re.MULTILINE)
for a in ['juh', 'jurt', 'officebean', 'ridl', 'unoil', 'unoloader']: for a in ['juh', 'jurt', 'libreoffice', 'officebean', 'ridl', 'unoil', 'unoloader']:
replace_in_file(os.path.join(M[a], 'pom.%s.xml' % a), src_pattern) replace_in_file(os.path.join(M[a], 'pom.%s.xml' % a), src_pattern)
src_pattern = re.compile(r"^(LIBREOFFICE_VERSION = ')([-.@\w]+)(')$", src_pattern = re.compile(r"^(LIBREOFFICE_VERSION = ')([-.@\w]+)(')$",

View file

@ -1,11 +1,13 @@
def java_sources( def java_sources(
name, name,
srcs, srcs,
root = None,
visibility = [] visibility = []
): ):
java_library( java_library(
name = name, name = name,
resources = srcs, resources = srcs,
resources_root = root,
visibility = visibility, visibility = visibility,
) )

View file

@ -16,6 +16,7 @@ maven_package(
'ridl': '//:ridl', 'ridl': '//:ridl',
'unoil': '//:unoil', 'unoil': '//:unoil',
'unoloader': '//:unoloader', 'unoloader': '//:unoloader',
'libreoffice': '//:libreoffice',
}, },
src = { src = {
'juh': '//javaunohelper:juh-src', 'juh': '//javaunohelper:juh-src',
@ -24,6 +25,7 @@ maven_package(
'ridl': '//ridljar:ridl-src', 'ridl': '//ridljar:ridl-src',
'unoil': '//unoil:unoil-src', 'unoil': '//unoil:unoil-src',
'unoloader': '//ridljar/source/unoloader:unoloader-src', 'unoloader': '//ridljar/source/unoloader:unoloader-src',
'libreoffice': '//ridljar:libreoffice-src',
}, },
doc = { doc = {
'juh': '//javaunohelper:juh-javadoc', 'juh': '//javaunohelper:juh-javadoc',
@ -32,6 +34,7 @@ maven_package(
'ridl': '//ridljar:ridl-javadoc', 'ridl': '//ridljar:ridl-javadoc',
'unoil': '//unoil:unoil-javadoc', 'unoil': '//unoil:unoil-javadoc',
'unoloader': '//ridljar/source/unoloader:unoloader-javadoc', 'unoloader': '//ridljar/source/unoloader:unoloader-javadoc',
'libreoffice': '//ridljar:libreoffice-javadoc',
}, },
) )

View file

@ -18,6 +18,7 @@ M = {
'ridl': 'ridljar', 'ridl': 'ridljar',
'unoil': 'unoil', 'unoil': 'unoil',
'unoloader': 'ridljar', 'unoloader': 'ridljar',
'libreoffice': 'ridljar',
} }
opts = OptionParser() opts = OptionParser()