Table of Contents | ||
---|---|---|
|
...
- Create a GitHub user account if you don't already have one.
- Contributors should fork the repository and submit GitHub Pull Requests for code inclusion.
Set up your local git environment according to Sage’s GitHub Security guidance
Fork the Sage-Bionetworks SynapseWebClient repository into your own GitHub account: https://help.github.com/articles/fork-a-repo
Clone
theyour fork of SynapseWebClient project
downto your
computer: git clonelocal machine and enter the project root directory
GITHUBCode Block language bash git clone https://github.com/[YOUR
Change into the proper directory:GITHUB NAME]/SynapseWebClient.git
cd SynapseWebClient
- If you didn't set up the global pre-commit hook in step #2, set up a local pre-commit hook to detect secrets (do this for all repos that you clone in the future!):
git secrets --install
git secrets --register-aws - Set up upstream with:
git remote add upstream https://github.com/Sage-Bionetworks/SynapseWebClient
- Fetch and merge changes from the Sage Bionetworks repo, which was named upstream:
git fetch upstream
- Configure settings.xml –- its a configuration file for running maven
- The file needs to placed in $HOME/.m2/settings.xml (e.g. jane/.m2/settings.xml)
This should be the content of this file:
Code Block language xml title settings.xml <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <localRepository/> <interactiveMode/> <usePluginRegistry/> <offline/> <pluginGroups/> <servers/> <mirrors/> <proxies/> <profiles> <profile> <id>dev-environment</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <org.sagebionetworks.portal.endpoint>http://127.0.0.1:8888/Portal.html</org.sagebionetworks.portal.endpoint> <org.sagebionetworks.repositoryservice.endpoint>https://repo-prod.prod.sagebase.org/repo/v1</org.sagebionetworks.repositoryservice.endpoint> <!-- insert properties described below here --> <!-- <org.sagebionetworks.repositoryservice.endpoint>https://repo-staging.prod.sagebase.org/repo/v1</org.sagebionetworks.repositoryservice.endpoint> --> </properties> </profile> </profiles> <activeProfiles/> </settings>
...
- Download IntelliJ community edition, it comes pre-built with GWT and Maven support.
- Install GWT SDK (install the actual SDK, not the eclipse plugin version)
- If downloading Java for the first time then download Java 8 17 as well.
- If you want to run Maven manually then install it from here (this will require you to add the mvn installation directory to your PATH as well), otherwise see notes here on configuring IntelliJ to run maven build.
- Import the SWC into IntelliJ by File → New Project From Existing Sources... <Select Path to SWC Location>
- To Setup running the GWT server from Intellij
- In the Menu bar
Run > Edit configurations
- Click the "+" button to add an new configuration and choose "GWT Configuration".
- This is what the configuration looks like on Windows, adapt the file paths to your project repository's location
- Dev Mode Parameter should be:
-war target/portal-develop-SNAPSHOT
- Dev Mode Parameter should be:
- The "Before Launch" tools can be ignored.
- It is simply a shortcut a execute the same command executed by the
libsass-maven-plugin
in the rootpom.xml
if using Maven to run GWT. - The alternative is to run this command manually in the command line, whenever the CSS gets messed up.
sass --no-source-map --load-path=node_modules --style=compressed --unicode --stop-on-error --update "./src/main/webapp/sass":"./target/portal-develop-SNAPSHOT"
- This is caused by the GWT runner in IntelliJ sometimes clearing out the
/target
directory when recompiling - Even setting up SASS command in the "before launch" does ensure the CSS is compiled automatically
- The CSS will be compiled immediately before the GWT server runs. The GWT server then clears out the
/target
folder containing the compiled CSS - The only benefit to the set up is that a tab for SASS is created next to the GWT Server's tab, which you can then manually run after the GWT server has started up.
- This is very annoying and any improvements to this workflow would be greatly appreciated.
- The CSS will be compiled immediately before the GWT server runs. The GWT server then clears out the
- This is caused by the GWT runner in IntelliJ sometimes clearing out the
- It is simply a shortcut a execute the same command executed by the
- In the Menu bar
- If running Maven manually run like so (see note below on saving build time by running in debug mode):
- Run 'mvn clean install'
- Run 'mvn gwt:run'
- Not recommended because it currently does not detect changes to the
.ui.xml
files, which forces you to kill, redomvn clean install
, and restart the server. - Running in the IDE will detect
.ui.xml
changes
- Not recommended because it currently does not detect changes to the
...
To point to the development stack set:
<org.sagebionetworks.repositoryservice.endpoint>https://repo-dev.dev.sagebase.org/repo/v1</org.sagebionetworks.repositoryservice.endpoint>
To point to staging set:
<org.sagebionetworks.repositoryservice.endpoint>https://repo-staging.prod.sagebase.org/repo/v1</org.sagebionetworks.repositoryservice.endpoint>
To point to production set:
...