Clean libs when cleaning build.
This commit is contained in:
parent
4abb50ad9b
commit
d6617563fc
@ -1,6 +1,5 @@
|
||||
FROM alpine
|
||||
WORKDIR /mpw/gradle
|
||||
ADD . /mpw
|
||||
|
||||
RUN apk update && apk add libtool automake autoconf make g++ openjdk8
|
||||
RUN ./gradlew -i build
|
||||
RUN apk add --no-cache git libtool automake autoconf make g++ bash openjdk8
|
||||
RUN git clone --depth=3 $(: --shallow-submodules) --recurse-submodules https://gitlab.com/MasterPassword/MasterPassword.git /mpw
|
||||
RUN cd /mpw/gradle && ./gradlew -i clean build
|
||||
|
@ -69,16 +69,15 @@ _initialize_needs() {
|
||||
# By default, this will wipe the prefix, run `make distclean` and `git clean -fdx`.
|
||||
clean() { _clean "$@"; }
|
||||
_clean() {
|
||||
rm -rf "$prefix"
|
||||
|
||||
if [[ $platform = windows ]]; then
|
||||
printf '"%%VSINSTALLDIR%%\Common7\Tools\VsMSBuildCmd.bat" && msbuild /t:Clean' > .clean.bat
|
||||
cmd //c .clean.bat
|
||||
rm -f .clean.bat
|
||||
elif [[ -e Makefile ]] && make -s distclean; then :
|
||||
elif [[ -e .git ]] && git clean -fdx; then :
|
||||
fi
|
||||
|
||||
[[ ! -e Makefile ]] || make -s distclean
|
||||
[[ ! -e .git ]] || git clean -fdx
|
||||
rm -rf "$prefix"
|
||||
}
|
||||
|
||||
# prepare <prefix> <platform> [ <arch> ... ]
|
||||
@ -104,7 +103,7 @@ _prepare_clean() {
|
||||
local prefix=$1 platform=$2; shift 2
|
||||
|
||||
rm -rf "$prefix"
|
||||
install -d "$prefix"
|
||||
install -d "$prefix/out"
|
||||
}
|
||||
|
||||
# prepare_config <prefix> <platform> [ <arch> ... ]
|
||||
@ -116,9 +115,14 @@ prepare_config() { _prepare_config "$@"; }
|
||||
_prepare_config() {
|
||||
local prefix=$1 platform=$2; shift 2
|
||||
|
||||
[[ $platform = windows ]] && return
|
||||
[[ -e "$prefix/out/.prepared" ]] && return
|
||||
|
||||
[[ -e configure ]] || autoreconf --verbose --install --symlink 2> >(sed 's/^\([^:]*\):[0-9]\{1,\}: /\1: /')
|
||||
if [[ $platform = windows ]]; then :
|
||||
else
|
||||
autoreconf --verbose --install --symlink 2> >(sed 's/^\([^:]*\):[0-9]\{1,\}: /\1: /')
|
||||
fi
|
||||
|
||||
touch "$prefix/out/.prepared"
|
||||
}
|
||||
|
||||
# target <prefix> <platform> <arch>
|
||||
@ -142,9 +146,10 @@ target_prepare() { _target_prepare "$@"; }
|
||||
_target_prepare() {
|
||||
local prefix=$1 platform=$2 arch=$3; shift 3
|
||||
|
||||
[[ $platform = windows ]] && return
|
||||
|
||||
if [[ $platform = windows ]]; then :
|
||||
else
|
||||
[[ ! -e Makefile ]] || make -s clean
|
||||
fi
|
||||
}
|
||||
|
||||
# target_configure <prefix> <platform> <arch> [ <args> ... ]
|
||||
@ -220,7 +225,7 @@ _finalize_merge() {
|
||||
|
||||
[[ -e "$prefix/$archs/include" ]] && mv -f -- "$prefix/$archs/include" "$prefix/out/"
|
||||
|
||||
mkdir -p "$prefix/out/lib"
|
||||
install -d "$prefix/out/lib"
|
||||
case "$platform" in
|
||||
'linux')
|
||||
for arch in "${archs[@]}"; do
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit e3752b58945d23895535857ed136a5185bad02ce
|
||||
Subproject commit 3df1f98b4ab52f271dba5e13ec59cf4d1d093e1a
|
@ -1 +1 @@
|
||||
Subproject commit cfb0f94704841f943a5a11d9e335da409c55d58a
|
||||
Subproject commit 850edc1175c78ed72124cfbef073c7ecc655c476
|
@ -67,10 +67,16 @@ library {
|
||||
commandLine 'bash', '-x', "$rootDir/../lib/bin/build_libsodium-${system}"
|
||||
privateHeaders.from "$rootDir/../lib/libsodium/src/libsodium/include"
|
||||
}
|
||||
clean.dependsOn project.tasks.maybeCreate( "clean_libsodium-${system}", Exec.class ).configure {
|
||||
commandLine 'bash', '-x', "$rootDir/../lib/bin/build_libsodium-${system}", 'clean'
|
||||
}
|
||||
archive.dependsOn project.tasks.maybeCreate( "build_libjson-c-${system}", Exec.class ).configure {
|
||||
commandLine 'bash', '-x', "$rootDir/../lib/bin/build_libjson-c-${system}"
|
||||
privateHeaders.from "$rootDir/../lib/libjson-c/build-${system}~/out"
|
||||
}
|
||||
clean.dependsOn project.tasks.maybeCreate( "clean_libjson-c-${system}", Exec.class ).configure {
|
||||
commandLine 'bash', '-x', "$rootDir/../lib/bin/build_libjson-c-${system}", 'clean'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user