public class JHBuildJavaWrapper
A wrapper around GNOME's JHBuild build and dependency manager which allows to automatic download of tarballs and checkout of source roots with various SCMs, automatic build, test and installation into a user prefix as well as specification and resolution of dependencies. The wrapper uses some system binaries which are expected to be present and otherwise need to be installed manually by the caller (e.g. sh and make. Other non-system binaries, like git and jhbuild itself are searched for and automatically downloaded and installed in case of absence. Both system and non-system binaries are search for in the environment variable PATH and the subdirectory bin of the specified installationPrefix so that it's possible to install them as non-root user (system-binaries don't necessarily have to be installed manually into installationPrefix since any other installation prefix can be added to PATH before the wrapper is used). stdout and stderr of build processes are redirected to stdout and stderr of the JVM except silenceStdout or silenceStderr are set to true. In this case the content of both process streams is wrapped in a BuildFailureException in case a build process returns a code which is unequal 0. The Wrapper make JHBuild use it's default cache directory for downloads and build results under the user's home directory since there's few incentive to make the location configurable. Only the is allowed to be called from another thread, calls to other methods from other threads result in unpredictable behaviour. The initialization routine makes sure that a C compiler and JHBuildJavaWrapper.cancelInstallModulesetmake are provided by the system since it's very hard or impossible to build a C compiler without an existing one as well as building make without make. The initialization routine then builds and installs git and all of its prerequisites and then uses it to clone the jhbuild repository and build and install it. A tarball of jhbuild could be used, but that's a TODO.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CC_DEFAULT |
static java.io.File |
CONFIG_DIR |
static java.lang.String |
CPAN_DEFAULT |
static java.io.File |
DOWNLOAD_DIR_DEFAULT |
static java.lang.String |
GIT_DEFAULT |
static java.io.File |
INSTALLATION_PREFIX_DIR_DEFAULT |
static java.lang.String |
JHBUILD_DEFAULT |
static java.lang.String |
MAKE_DEFAULT |
static java.lang.String |
MSGFMT_DEFAULT |
static java.lang.String |
OPENSSL_DEFAULT |
static java.lang.String |
PATCH_DEFAULT |
static java.lang.String |
PYTHON_DEFAULT |
static java.lang.String |
SH_DEFAULT |
| Constructor and Description |
|---|
JHBuildJavaWrapper() |
JHBuildJavaWrapper() |
JHBuildJavaWrapper() |
| Modifier and Type | Method and Description |
|---|---|
static int |
calculateParallelism() |
void |
cancelInstallModuleset()
Allows cancelation (with minimal delay) from another thread.
|
boolean |
checkLibPresence()
Checks presence of a
.pc file in the specified installation prefix which allows to conclude that the library is installed in a rudimentary way. |
java.io.File |
getDownloadDir() |
java.io.File |
getInstallationPrefixDir() |
boolean |
installModuleset()
Tries to find
moduleName in the default moduleset on the classpath shipped with archive. The module installation can be canceled from another thread with . |
boolean |
installModuleset()
Installs module
moduleName from JHBuild moduleset provided by modulesetInputStream. The module installation can be canceled from another thread with . |
boolean |
isCanceled()
Check canceled state.
|
public static java.lang.String GIT_DEFAULT
public static java.lang.String JHBUILD_DEFAULT
public static java.lang.String SH_DEFAULT
public static java.lang.String MAKE_DEFAULT
public static java.lang.String PYTHON_DEFAULT
public static java.lang.String CC_DEFAULT
public static java.lang.String MSGFMT_DEFAULT
public static java.lang.String CPAN_DEFAULT
public static java.lang.String PATCH_DEFAULT
public static java.lang.String OPENSSL_DEFAULT
public static java.io.File CONFIG_DIR
public static java.io.File INSTALLATION_PREFIX_DIR_DEFAULT
public static java.io.File DOWNLOAD_DIR_DEFAULT
public JHBuildJavaWrapper()
public JHBuildJavaWrapper()
public JHBuildJavaWrapper()
public static int calculateParallelism()
public java.io.File getDownloadDir()
public java.io.File getInstallationPrefixDir()
public void cancelInstallModuleset()
Allows cancelation (with minimal delay) from another thread.
public boolean isCanceled()
Check canceled state.
true if JHBuildJavaWrapper.cancelInstallModuleset has been invoked and no other build process started so far, false otherwisepublic boolean installModuleset()
Tries to find moduleName in the default moduleset on the classpath shipped with archive. The module installation can be canceled from another thread with .JHBuildJavaWrapper.cancelInstallModuleset
true if successful, false if canceledJHBuildJavaWrapper.cancelInstallModulesetpublic boolean installModuleset()
Installs module moduleName from JHBuild moduleset provided by modulesetInputStream. The module installation can be canceled from another thread with .JHBuildJavaWrapper.cancelInstallModuleset
true if successful, false if canceledmodulesetInputStream is nullJHBuildJavaWrapper.cancelInstallModulesetpublic boolean checkLibPresence()
Checks presence of a .pc file in the specified installation prefix which allows to conclude that the library is installed in a rudimentary way.
true if the file has been found, false otherwiseFiles#walk(Path, FileVisitOption...) throws such an exception