Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Reorder link and install steps
Browse files Browse the repository at this point in the history
Take advantage of Yarn's preservation of links while installing and set up links
first and install second. This should result in a small speedup since we no
longer install the published SDKs just to replace them on the next line.
  • Loading branch information
jryans committed Mar 11, 2019
1 parent f646680 commit 4f24d6c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 30 deletions.
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,27 +137,26 @@ choice).
Using `yarn` instead of `npm` is recommended. Please see the Yarn [install
guide](https://yarnpkg.com/docs/install/) if you do not have it already.

Then check out the code and pull in dependencies:

```bash
git clone https://github.com/matrix-org/matrix-react-sdk.git
cd matrix-react-sdk
git checkout develop
yarn install
```

`matrix-react-sdk` depends on `matrix-js-sdk`. To make use of changes in the
latter and to ensure tests run against the develop branch of `matrix-js-sdk`,
you should check out `matrix-js-sdk`, change into that new directory, and run:
you should set up `matrix-js-sdk`:

```bash
git clone https://github.com/matrix-org/matrix-js-sdk
cd matrix-js-sdk
git checkout develop
yarn link
yarn install
```

Then, switch back to `matrix-react-sdk` and run:
Then check out `matrix-react-sdk` and pull in dependencies:

```bash
git clone https://github.com/matrix-org/matrix-react-sdk
cd matrix-react-sdk
git checkout develop
yarn link matrix-js-sdk
yarn install
```

See the [help for `yarn link`](https://yarnpkg.com/docs/cli/link) for more
Expand Down
14 changes: 9 additions & 5 deletions jenkins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ nvm use 10

set -x

# install the other dependencies
scripts/fetchdep.sh matrix-org matrix-js-sdk

pushd matrix-js-sdk
yarn link
yarn install
popd

scripts/fetchdep.sh matrix-org matrix-js-sdk
rm -r node_modules/matrix-js-sdk || true
ln -s ../matrix-js-sdk node_modules/matrix-js-sdk
(cd matrix-js-sdk && yarn install)
yarn link matrix-js-sdk

# install the other dependencies
yarn install

# run the mocha tests
yarn test --no-colors
Expand Down
16 changes: 7 additions & 9 deletions scripts/travis/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,17 @@ set -ev
RIOT_WEB_DIR=riot-web
REACT_SDK_DIR=`pwd`

yarn link

scripts/fetchdep.sh vector-im riot-web
pushd "$RIOT_WEB_DIR"

mkdir node_modules
yarn install
pushd "$RIOT_WEB_DIR"

# use the version of js-sdk we just used in the react-sdk tests
rm -r node_modules/matrix-js-sdk
ln -s "$REACT_SDK_DIR/node_modules/matrix-js-sdk" node_modules/matrix-js-sdk
yarn link matrix-js-sdk
yarn link matrix-react-sdk

# ... and, of course, the version of react-sdk we just built
rm -r node_modules/matrix-react-sdk
ln -s "$REACT_SDK_DIR" node_modules/matrix-react-sdk
yarn install

yarn build

popd
11 changes: 6 additions & 5 deletions scripts/travis/install-deps.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/sh

set -ex
yarn install

scripts/fetchdep.sh matrix-org matrix-js-sdk
rm -r node_modules/matrix-js-sdk || true
ln -s ../matrix-js-sdk node_modules/matrix-js-sdk

cd matrix-js-sdk
pushd matrix-js-sdk
yarn link
yarn install
cd ..
popd

yarn link matrix-js-sdk

0 comments on commit 4f24d6c

Please sign in to comment.