Skip to content

Commit

Permalink
Updated and patched soldiity docgen
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsam4 committed Apr 16, 2019
1 parent feeb072 commit 06e489c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 25 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"request-promise": "^4.2.2",
"sol-merger": "^0.1.2",
"solidity-coverage": "^0.5.11",
"solidity-docgen": "^0.1.0",
"solidity-docgen": "^0.1.1",
"solium": "^1.1.6",
"table": "^5.2.3",
"web3": "1.0.0-beta.35"
Expand Down
39 changes: 18 additions & 21 deletions scripts/docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ CORE_ROUTE=$PWD
# functions that used to create the documentation
create_docs() {

# getting the all available branches
# getting the all available branches
if [ "$(git branch | grep -w $latestTag)" == "" ];
then
# Check whether the branch is already present or not
if [ "$(git branch -r | grep "origin/$latestTag" | wc -l)" -ge 1 ];
then
then
echo "$latestTag Branch is already present on remote"
exit 0
fi
Expand All @@ -32,29 +32,23 @@ create_docs() {
cd $WEBSITE_DIRECTORY
fi

echo "Fetching solc binary"
curl -L -o solidity-ubuntu-trusty.zip https://github.com/ethereum/solidity/releases/download/v0.4.24/solidity-ubuntu-trusty.zip
unzip solidity-ubuntu-trusty.zip
CWD=$(pwd)
OLD_SOLC_PATH=$SOLC_PATH
export SOLC_PATH=$CWD/solc

echo "Generating the API documentation in branch $latestTag"
# Command to generate the documentation using the solidity-docgen

migrate=$(SOLC_ARGS="openzeppelin-solidity="$CORE_ROUTE"/node_modules/openzeppelin-solidity" \
solidity-docgen -x external/oraclizeAPI.sol,mocks/MockPolyOracle.sol,oracles/PolyOracle.sol $CORE_ROUTE $CORE_ROUTE/contracts $CORE_ROUTE/polymath-developer-portal/)

export SOLC_PATH=$OLD_SOLC_PATH

echo "Successfully docs are generated..."

echo "Installing npm dependencies..."
yarn install > /dev/null 2>&1

echo "Gererate versioning docs..."
yarn run version $versionNo

git config --global user.email "contact@mudit.blog"
git config --global user.name "polydocs"

# Commit the changes
echo "Commiting the new changes..."
git add .
Expand All @@ -67,7 +61,7 @@ solidity-docgen -x external/oraclizeAPI.sol,mocks/MockPolyOracle.sol,oracles/Pol
echo "Removing the repository from the system...."
cd ../../../
rm -rf polymath-developer-portal
exit 0
exit 0
}

reject_docs() {
Expand All @@ -87,10 +81,13 @@ versionNo=$(echo "$latestTag" | cut -b 2-6)
#print the tag
echo "Latest tag is: $latestTag"

# Fetch patched solidity docgen
curl -o node_modules/solidity-docgen/lib/index.js https://raw.githubusercontent.com/maxsam4/solidity-docgen/build/lib/index.js

# clone the polymath-developer-portal

if [ ! -d $DIRECTORY ]; then
git clone https://${GH_USR}:${GH_PWD}@github.com/PolymathNetwork/polymath-developer-portal.git > /dev/null 2>&1
git clone https://${GH_USR}:${GH_PWD}@github.com/PolymathNetwork/polymath-developer-portal.git > /dev/null 2>&1
cd $DIRECTORY
else
cd $DIRECTORY
Expand All @@ -102,9 +99,9 @@ cd website

if [ ! -d $WEBSITE_DIRECTORY ]; then
echo "Created: versioned_docs directory"
create_docs
else
for dir in $WEBSITE_DIRECTORY/*;
create_docs
else
for dir in $WEBSITE_DIRECTORY/*;
do
if [ "$(basename "$dir")" == "*" ]; then
echo "There is no version specific folders"
Expand All @@ -113,12 +110,12 @@ else
reponame=$(echo $(basename "$dir") | cut -d '-' -f2)
echo $reponame
if [ "$reponame" == "$versionNo" ]; then
reject_docs
reject_docs
fi
fi
fi
done
create_docs
fi

#reponame=$(echo $(basename "$dir") | cut -d '-' -f2 | cut -b 2-6)
# echo $reponame
# echo $reponame
7 changes: 4 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5562,9 +5562,10 @@ solidity-coverage@^0.5.11:
tree-kill "^1.2.0"
web3 "^0.18.4"

solidity-docgen@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/solidity-docgen/-/solidity-docgen-0.1.0.tgz#f3a56ff074e8c7d832af3a3d462c3b5abf0f64cb"
solidity-docgen@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/solidity-docgen/-/solidity-docgen-0.1.1.tgz#b9cd4cc414aab371094b7db8a0a45c535bd6e875"
integrity sha512-BJiE5yqpXjpmmEKPZ/RU98i48xa4/0JRk8AJheKK6+LSckv/MduGeC2sO4MD/btBi03+NicFze3lvlPUjj2jHg==
dependencies:
commander "^2.14.1"
lodash "^4.17.5"
Expand Down

0 comments on commit 06e489c

Please sign in to comment.