Skip to content

Latest commit

 

History

History
84 lines (59 loc) · 3.01 KB

build.md

File metadata and controls

84 lines (59 loc) · 3.01 KB

How to Build

Prepare dependencies

  • JDK 1.8 (JDK 1.9+ are not supported yet)
  • On Linux Ubuntu system (e.g. Ubuntu 16.04.4 LTS), ensure that the machine has Oracle JDK 8, instead of having Open JDK 8 in the system. If you are building the source code by using Open JDK 8, you will get Build Failed result.
  • Open UDP ports for connection to the network
  • MINIMUM 2 CPU Cores

Build and Deploy automatically using scripts

Getting the code with git

  • Use Git from the console, see the Setting up Git and Fork a Repo articles.
  • develop branch: the newest code
  • master branch: more stable than develop. In the shell command, type:
git clone https://github.com/tronprotocol/java-tron.git
git checkout -t origin/master

Including java-tron as dependency

If you don't want to checkout the code and build the project, you can include it directly as a dependency.

Using gradle:

repositories {
   maven { url 'https://jitpack.io' }
}
dependencies {
   implementation 'com.github.tronprotocol:java-tron:develop-SNAPSHOT'
}

Using maven:

...
<repositories>
  <repository>    
      <id>jitpack.io</id>
      <url>https://jitpack.io</url>
  </repository>
</repositories>
...
<dependency>
    <groupId>com.github.tronprotocol</groupId>
    <artifactId>java-tron</artifactId>
    <version>develop-SNAPSHOT</version><!--You can use any of the tag/branch name available-->
</dependency>

Building from source code

Building using the console:

cd java-tron
./gradlew build
  • Building using IntelliJ IDEA (community version is enough):

    Please run ./gradlew build once to build the protocol files

    1. Start IntelliJ. Select File -> Open, then locate to the java-tron folder which you have git cloned to your local drive. Then click Open button on the right bottom.
    2. Check on Use auto-import on the Import Project from Gradle dialog. Select JDK 1.8 in the Gradle JVM option. Then click OK.
    3. IntelliJ will import the project and start gradle syncing, which will take several minutes, depending on your network connection and your IntelliJ configuration
    4. Enable Annotations, Preferences -> Search annotations -> check Enable Annotation Processing.
    5. When the syncing finishes, select Gradle -> Tasks -> build, and then double click build option.