# Developer Guide ## Communication * General questions and discussion: [dtp-discuss@googlegroups.com](mailto:dtp-discuss@googlegroups.com) * [Slack channel](https://portability.slack.com), email [portability-maintainers@googlegroups.com](mailto:portability-maintainers@googlegroups.com) for invitation * Office Hours for anyone interested, developers, participants, etc.: * Times: Tuesday 2pm CST and Thursday 10am CST To attend: 1. Send email stating your desired topic to discuss to [dtp-discuss@googlegroups.com](mailto:dtp-discuss@googlegroups.com) 1. You will receive a Google Hangout link (or let us know if you prefer another method of communication) ## Where to start ### Understanding the project * Read the [Technical Overview](Overview.md) page, particularly the architecture section * Read the latest white papers at [datatransferproject.dev](https://datatransferproject.dev) ### Understanding the code * Read the README files in each top level directory * Integrate a new service provider or data model via the [Integration Guide](Integration.md) ### Running the project * See the instructions below to run locally ### Start coding * See the issues with label [good first issue](https://github.com/google/data-transfer-project/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) ## First Run/Setup From the top level data-transfer-project directory: * Install Git: `sudo apt-get install git-all` * Install Gradle: `sudo apt-get install gradle` * Install NVM: `curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash` * Install Node: [mac installer](https://nodejs.org/dist/v16.15.1/node-v16.15.1.pkg) or `nvm install v16.15.1` * Install Angular: `npm install -g @angular/cli` * [Install Docker](https://docs.docker.com/install/) * Install the Angular CLI `./gradlew client-rest:installLocalAngularCli` * In the `client-rest/` directory, run `npm install` ### IntelliJ setup The following instructions work for IntelliJ IDEA version 2017.2.6. #### Import the project * Open IntelliJ -> Import Project * Navigate to the 'data-transfer-project' directory where you have git cloned the repo * Import project from external model (Gradle) -> uncheck 'Create separate module per source set' -> Finish #### Enable annotation processing * Go to File -> Settings -> Build, Execution, Deployment -> Compiler -> Annotation Processors * Check 'Enable annotation processing' * Store generated sources relative to: 'Module content root' (not the default) * Production sources directory: `build/classes/java/` #### Setup formatting * File -> Settings -> Editor -> General -> Ensure line feed at file end on Save * Install [the 'google-java-format' plugin](https://plugins.jetbrains.com/plugin/8527-google-java-format), and enable it in Settings * Apply [intellij-java-google-style.xml](https://github.com/google/styleguide/blob/gh-pages/intellij-java-google-style.xml) to [IntelliJ settings](https://www.jetbrains.com/help/idea/configuring-code-style.html#aadfdd2f) #### Setup automatic license header * Go to File -> Settings -> Editor -> Copyright -> Copyright Profiles * Click the green + button, add a new profile called "Data-Transfer-Project-Authors". Use this as the text: ``` Copyright $today.year The Data Transfer Project Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ``` * Create a new temp file (e.g. Test.java) in Intellij. * Inside the file, enter Alt-Insert -> Copyright * It should prompt you to select the new Copyright profile * The copyright should be added to all new files from now on (note: it might be collapsed so not immediately obvious) ## Running locally with Docker See [Running Locally](RunningLocally.md) for instructions. ## Deploying in production A demo distribution for Google Cloud Platform is available at `distributions/demo-google-deployment`. A demo Azure distribution is also in development. These distributions have :dockerize tasks which generate dockerfiles and build images, similar to our local demo. ## Build Problem F.A.Q ### AutoValue errors If you get an error `error: duplicate class... final class AutoValue_...` it is indicative of your IDE and gradle clashing. To fix it you want to delete the referenced build/classes directory. ## Misc updates There is a rest version of the client and demo-server in progress. While it is not complete yet and lacks some of the features in the http based client, it is still runnable and works for all services that implement OAuth2. The following runs the client-rest api * `cd client-rest` * `ng serve --ssl --port 3000 --proxy-config proxy.conf.json` The following builds and runs the demo-server (which contains the worker and the api) with the jettyrest transport to be used with the client-rest UI. * `docker network create dataportability` * `./gradlew -PtransportType=jettyrest -PapiPort=3000 -PcloudType=local clean check :distributions:demo-server:dockerize` * `docker run --rm -p 8080:8080 -p 5005:5005 -p 3000:3000 --env-file distributions/demo-server/env.secrets --name demoserver --network dataportability datatransferproject/demo` ## Publishing to Maven Central See [here](Publishing.md) for more details.