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'],
)
prebuilt_jar(
name = 'libreoffice',
binary_jar = 'instdir/program/classes/libreoffice.jar',
visibility = ['PUBLIC'],
)
zip_file(
name = 'api',
srcs = [
@ -55,5 +61,8 @@ zip_file(
':unoloader',
'//ridljar/source/unoloader:unoloader-src',
'//ridljar/source/unoloader:unoloader-javadoc',
':libreoffice',
'//ridljar:libreoffice-src',
'//ridljar:libreoffice-javadoc',
]
)

View file

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

View file

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

View file

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

View file

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

View file

@ -12,6 +12,7 @@ M = {
'ridl': 'ridljar',
'unoil': 'unoil',
'unoloader': 'ridljar',
'libreoffice': 'ridljar',
}
parser = OptionParser()
@ -40,7 +41,7 @@ def replace_in_file(filename, src_pattern):
src_pattern = re.compile(r'^(\s*<version>)([-.@\w]+)(</version>\s*)$',
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)
src_pattern = re.compile(r"^(LIBREOFFICE_VERSION = ')([-.@\w]+)(')$",

View file

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

View file

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

View file

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