DigixGlobal / doxity

📑 Documentation Generator for Solidity
BSD 3-Clause "New" or "Revised" License
212 stars 59 forks source link

Is `doxity compile` incompatible with dappsys? #24

Closed travs closed 6 years ago

travs commented 6 years ago

We are using dappsys to develop our smart contracts.

The way it works is with git submodules, which contain smart contracts we like to depend on. These dependency contracts are in ./lib, and the contract we actually develop are in ./src.

When I try to run doxity compile, I get errors like these:

$ doxity compile                                                                                                                                                                               
./lib/ds-group/src/group.sol:15:1: Error: Source "ds-exec/exec.sol" not found: Unknown exception in read callback.                                                                             
import "ds-exec/exec.sol";                                                                                                                                                                     
^------------------------^                                                                                                                                                                     
./lib/ds-group/src/group.sol:16:1: Error: Source "ds-note/note.sol" not found: Unknown exception in read callback.                                                                             
import "ds-note/note.sol";                                                                                                                                                                     
^------------------------^                                                                                                                                                                     
./lib/ds-weth/src/weth.sol:3:1: Error: Source "erc20/erc20.sol" not found: Unknown exception in read callback.                                                                                 
import "erc20/erc20.sol";                                                                                                                                                                      
^-----------------------^                                                                                                                                                                      
./src/Fund.sol:12:1: Error: Source "ds-math/math.sol" not found: Unknown exception in read callback.                                                                                           
import "ds-math/math.sol";

In our .doxityrc, src is mapped to our contracts (basically boils down to $(find src -name '*.sol')).

Is there a way to compile without using doxity, and feed doxity the result? Or maybe there is a way to resolve these dependencies within doxity that I don't see yet.

travs commented 6 years ago

Have found a workaround for this. By passing extra arguments in the .doxityrc src field, we can actually add compiler options. If we do something like:

"src": "--overwrite $(echo $(dapp remappings)) $(find ./src -type f -name '*.sol' -not -name '*.t.sol') ="

then the --overwrite $(echo $(dapp remappings)) part will give the compiler the correct paths to search for dappsys packages. The remaining commands just discover solidity files that are not testfiles.

Might be helpful if there is an added comipler-args field in .doxityrc specifically for these things, but as it stands this issue is resolved I think