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
  • Loading branch information
halibobo1205 committed Aug 1, 2024
1 parent de68d54 commit 05e3795
Show file tree
Hide file tree
Showing 9 changed files with 223 additions and 297 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,13 @@ 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
30 changes: 3 additions & 27 deletions framework/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -217,37 +217,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'))
}


task copyToParent(type: Copy) {
into "../build/distributions"
from "$buildDir/distributions"
Expand Down
3 changes: 2 additions & 1 deletion framework/src/main/java/org/tron/core/config/args/Args.java
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 Expand Up @@ -238,7 +239,7 @@ public static void clearParam() {
PARAMETER.maxUnsolidifiedBlocks = 54;
PARAMETER.allowOldRewardOpt = 0;
PARAMETER.allowEnergyAdjustment = 0;
GlobalContext.removeHeader();
GlobalContext.clear();
}

/**
Expand Down
Loading

0 comments on commit 05e3795

Please sign in to comment.