diff options
author | David Ostrovsky <david@ostrovsky.org> | 2015-12-01 23:59:11 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2015-12-03 23:32:11 +0000 |
commit | 1fd41f43eb73c373cb94d32d82c5fb7a7e243367 (patch) | |
tree | 19f524103ac67e9a6f0438a76c8e5a62e810baa9 /solenv/buck/build.defs | |
parent | 44286a37cbb811661819e06ef5ab22cd89cde357 (diff) |
Add build toolchain to upload LibreOffice API to Maven Central
Set up the toolchain to create sources and javadocs artifacts in
addition to JARs created during the build. Use Buck build tool for
that: [1]. This is a fork of Google's build tool Blaze, created by
Xooglers at Facebook. This build tool (like Blaze itself) uses
Python to write build files.
Add needed tools and build files to install LibreOffice API artifacts
to local Maven repository or deploy them to Maven Central.
To build all needed artifacts LibreOffice must be built regularly
with GNU make first. To build the rest of the API (sources and
javadocs):
$> buck build api
To replace version number with upcoming release version:
$> solenv/bin/version.py 5.1.0
To install the API to local Maven repository:
$> buck build api_install
To deploy the API to Maven Central:
$> buck build api_deploy
Detailed documentation is added to document the prerequisites and
the workflow to upload LibreOffice API to Maven Central.
* [1] https://buckbuild.com
Change-Id: Ibdd552a01110836703bc069abe829b9921491cac
Reviewed-on: https://gerrit.libreoffice.org/20343
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'solenv/buck/build.defs')
-rw-r--r-- | solenv/buck/build.defs | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/solenv/buck/build.defs b/solenv/buck/build.defs new file mode 100644 index 000000000000..b7b81ec8cb3c --- /dev/null +++ b/solenv/buck/build.defs @@ -0,0 +1,49 @@ +def java_sources( + name, + srcs, + visibility = [] + ): + java_library( + name = name, + resources = srcs, + visibility = visibility, + ) + +def java_doc( + name, + title, + pkgs, + paths, + srcs = [], + deps = [], + visibility = [], + do_it_wrong = False, + ): + if do_it_wrong: + sourcepath = paths + else: + sourcepath = ['$SRCDIR/' + n for n in paths] + genrule( + name = name, + cmd = ' '.join([ + 'while ! test -f .buckconfig; do cd ..; done;', + 'javadoc', + '-quiet', + '-protected', + '-encoding UTF-8', + '-charset UTF-8', + '-notimestamp', + '-windowtitle "' + title + '"', + '-link http://docs.oracle.com/javase/7/docs/api', + '-subpackages ', + ':'.join(pkgs), + '-sourcepath ', + ':'.join(sourcepath), + ' -classpath ', + ':'.join(['$(location %s)' % n for n in deps]), + '-d $TMP', + ]) + ';jar cf $OUT -C $TMP .', + srcs = srcs, + out = name + '.jar', + visibility = visibility, +) |