Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Java 17, some cleanup

Table of Contents
minLevel3

...

  1. Create a GitHub user account if you don't already have one.
    1. Contributors should fork the repository and submit GitHub Pull Requests for code inclusion.
  2. Set up your local git environment according to Sage’s GitHub Security guidance

  3. Fork the Sage-Bionetworks SynapseWebClient repository into your own GitHub account: https://help.github.com/articles/fork-a-repo

  4. Clone

    the

    your fork of SynapseWebClient project

    down

    to your

    computer: git clone 

    local machine and enter the project root directory

    Code Block
    languagebash
    git clone https://github.com/[YOUR
     GITHUB
     GITHUB NAME]/SynapseWebClient.git
    Change into the proper directory: 
    
    cd SynapseWebClient


  5. 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
  6. Set up upstream with: 
    git remote add upstream https://github.com/Sage-Bionetworks/SynapseWebClient
  7. Fetch and merge changes from the Sage Bionetworks repo, which was named upstream: 
    git fetch upstream
  8. Configure settings.xml –- its a configuration file for running maven
    1. The file needs to placed in $HOME/.m2/settings.xml (e.g. jane/.m2/settings.xml)
    2. This should be the content of this file:

      Code Block
      languagexml
      titlesettings.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>


...

  1. Download IntelliJ community edition, it comes pre-built with GWT and Maven support. 
  2. Install GWT SDK (install the actual SDK, not the eclipse plugin version)
    1. If downloading Java for the first time then download Java 8 17 as well.
  3. 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.
  4. Import the SWC into IntelliJ by File → New Project From Existing Sources... <Select Path to SWC Location>
  5. To Setup running the GWT server from Intellij
    1. In the Menu bar Run > Edit configurations
    2. Click the "+" button to add an new configuration and choose "GWT Configuration".
    3. This is what the configuration looks like on Windows, adapt the file paths to your project repository's location
      1. Dev Mode Parameter should be:
        1. -war target/portal-develop-SNAPSHOT

    4. The "Before Launch" tools can be ignored.
      1. It is simply a shortcut a execute the same command executed by the libsass-maven-plugin in the root pom.xml if using Maven to run GWT.
      2. 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.
  6. If running Maven manually run like so (see note below on saving build time by running in debug mode):
    1. Run 'mvn clean install'
    2. Run 'mvn gwt:run'
      1. Not recommended because it currently does not detect changes to the .ui.xml files, which forces you to kill, redo mvn clean install, and restart the server.
      2. Running in the IDE will detect .ui.xml changes

...

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:

...