Skip to content

Commit

Permalink
feat(build): speed up build
Browse files Browse the repository at this point in the history
  1. merge KeystoreFactory and SolidityNode into FullNode
  2. delete unused task
  3. add dependsOn task
  • Loading branch information
halibobo1205 committed Aug 1, 2024
1 parent 1ed95aa commit 7710d37
Show file tree
Hide file tree
Showing 10 changed files with 229 additions and 298 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,14 @@ public class CommonParameter {
//If you are running a solidity node for java tron, this flag is set to true
@Getter
@Setter
@Parameter(names = {"--solidity"}, description = "running a solidity node for java tron")
public boolean solidityNode = false;
//If you are running KeystoreFactory, this flag is set to true
@Getter
@Setter
@Parameter(names = {"--keystore"}, description = "running KeystoreFactory")
public boolean keystore = false;

@Getter
@Setter
public int rpcPort;
Expand Down
34 changes: 6 additions & 28 deletions framework/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ def binaryRelease(taskName, jarName, mainClass) {
from(sourceSets.main.output) {
include "/**"
}

// explicit_dependency
dependsOn (project(':actuator').jar, project(':consensus').jar, project(':chainbase').jar,
project(':crypto').jar, project(':common').jar, project(':protocol').jar)
from {
configurations.runtimeClasspath.collect {
it.isDirectory() ? it : zipTree(it)
Expand Down Expand Up @@ -226,37 +228,13 @@ startScripts.enabled = false
run.enabled = false
tasks.distTar.enabled = false

createScript(project, 'org.tron.program.SolidityNode', 'SolidityNode')
createScript(project, 'org.tron.program.FullNode', 'FullNode')
createScript(project, 'org.tron.program.KeystoreFactory', 'KeystoreFactory')
createScript(project, 'org.tron.program.DBConvert', 'DBConvert')

def releaseBinary = hasProperty('binaryRelease') ? getProperty('binaryRelease') : 'true'
def skipSolidity = hasProperty('skipSolidity') ? true : false
def skipKeystore = hasProperty('skipKeystore') ? true : false
def skipConvert = hasProperty('skipConvert') ? true : false
def skipAll = hasProperty('skipAll') ? true : false
if (releaseBinary == 'true') {
artifacts {
archives(binaryRelease('buildFullNodeJar', 'FullNode', 'org.tron.program.FullNode'))
}
if (!skipAll) {
if (!skipSolidity) {
artifacts {
archives(binaryRelease('buildSolidityNodeJar', 'SolidityNode', 'org.tron.program.SolidityNode'))}
}
if (!skipKeystore) {
artifacts {
archives(binaryRelease('buildKeystoreFactoryJar', 'KeystoreFactory', 'org.tron.program.KeystoreFactory'))}
}
if (!skipConvert) {
artifacts {
archives(binaryRelease('buildDBConvertJar', 'DBConvert', 'org.tron.program.DBConvert'))}
}
}

artifacts {
archives(binaryRelease('buildFullNodeJar', 'FullNode', 'org.tron.program.FullNode'))
}


tasks.register('copyToParent', Copy) {
into "../build/distributions"
from "$buildDir/distributions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ public static void clearParam() {
PARAMETER.tcpNettyWorkThreadNum = 0;
PARAMETER.udpNettyWorkThreadNum = 0;
PARAMETER.solidityNode = false;
PARAMETER.keystore = false;
PARAMETER.trustNodeAddr = "";
PARAMETER.walletExtensionApi = false;
PARAMETER.estimateEnergy = false;
Expand Down
Loading

0 comments on commit 7710d37

Please sign in to comment.