Skip to content

Commit

Permalink
Make 'build' target phony once again
Browse files Browse the repository at this point in the history
In commit 5fb4b21 ("Refine deploy target..."), the 'build' target was
made normal, i.e. non-phony, but on further review it does in fact make
sense to declare 'build' phony, such that it is run no matter the status
of the root-level 'build' directory, but for different reasons.

Previously, we had been considering the presence of 'build' directory as
a reasonable proxy for determining whether the `./gradlew build` had
been run. If the directory was present, we considered the 'build' target
up-to-date. If not, then we would re-run `./gradlew build`. This is all
sensible enough, except for the fact that the root-level 'build'
directory has almost nothing to do with the actual output of `./gradlew
build`. Gradle does output 'build' directories, but in the respective
subdirectory for each module of the project. After `./gradlew build` has
been run, we would see a 'desktop/build' directory, a 'seednode/build'
directory and so forth. It just so happens that a root-level 'build'
directory was getting created at all due to idiosyncracies of a
particular Kotlin plugin.

This commit updates the makefile to better respect this reality by:

 - preserving the 'build' target but marking it once again as PHONY

 - introducing new 'seednode/build' and 'desktop/build' targets that
   trigger './gradlew :seednode:build` and ./gradlew :desktop:build`
   commands respectively.

 - making 'build' depend on these two new targets

In light of this realization of flawed thinking about the root-level
build dir, this change also restores `make clean` to calling `./gradlew
clean` instead of `rm -rf build`.
  • Loading branch information
cbeams committed Dec 2, 2019
1 parent eb2d6b3 commit 1453025
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,19 @@ setup: build .localnet
clean: clean-build clean-localnet

clean-build:
rm -rf build
./gradlew clean

clean-localnet:
rm -rf .localnet ./dao-setup

# Build all Bisq binaries and generate the shell scripts used to run
# them in the targets below
build:
./gradlew build
# Build Bisq binaries and shell scripts used in the targets below
build: seednode/build desktop/build

seednode/build:
./gradlew :seednode:build

desktop/build:
./gradlew :desktop:build

# Unpack and customize a Bitcoin regtest node and Alice and Bob Bisq
# nodes that have been preconfigured with a blockchain containing the
Expand Down Expand Up @@ -171,7 +175,7 @@ bitcoind: .localnet
-datadir=.localnet/bitcoind \
-blocknotify='.localnet/bitcoind/blocknotify %s'

seednode: build
seednode: seednode/build
./bisq-seednode \
--baseCurrencyNetwork=BTC_REGTEST \
--useLocalhostForP2P=true \
Expand All @@ -184,7 +188,7 @@ seednode: build
--userDataDir=.localnet \
--appName=seednode

seednode2: build
seednode2: seednode/build
./bisq-seednode \
--baseCurrencyNetwork=BTC_REGTEST \
--useLocalhostForP2P=true \
Expand All @@ -197,7 +201,7 @@ seednode2: build
--userDataDir=.localnet \
--appName=seednode2

mediator: build
mediator: desktop/build
./bisq-desktop \
--baseCurrencyNetwork=BTC_REGTEST \
--useLocalhostForP2P=true \
Expand Down Expand Up @@ -244,4 +248,4 @@ block:
-rpcpassword=bsq \
generatetoaddress 1

.PHONY: seednode
.PHONY: build seednode

0 comments on commit 1453025

Please sign in to comment.