diff --git a/.gitignore b/.gitignore index 56bdcb6..c7867e8 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ docker/reports/ build/ tmp/ target/ +tools/dbfork/logs/ diff --git a/docker/build.gradle b/docker/build.gradle index 8c47a3b..85d0afc 100644 --- a/docker/build.gradle +++ b/docker/build.gradle @@ -16,7 +16,7 @@ apply plugin: "java-library" def getGitCommitDetails(length = 8) { try { - def gitFolder = "$projectDir/.git/" + def gitFolder = "${rootDir}/../.git/" if (!file(gitFolder).isDirectory()) { gitFolder = file(gitFolder).text.substring(length).trim() + "/" } @@ -63,15 +63,15 @@ def dockerArtifactName = project.hasProperty("dockerArtifactName") ? project.get def dockerImageName = "${dockerOrgName}/${dockerArtifactName}" task sourceDocker { - def dockerBuildDir = "build/docker-tron/" + def dockerBuildDir = "${rootDir}/build/docker-tron/" doLast { copy { - from file("${projectDir}/docker/Dockerfile") + from file("${rootDir}/../docker/Dockerfile") into(dockerBuildDir) } copy { - from file("${projectDir}/docker/docker-entrypoint.sh") + from file("${rootDir}/../docker/docker-entrypoint.sh") into "${dockerBuildDir}" } exec { @@ -102,7 +102,7 @@ def isInterimBuild(dockerBuildVersion) { task testDocker { dependsOn sourceDocker - def dockerReportsDir = "docker/reports/" + def dockerReportsDir = "reports/" doFirst { new File(dockerReportsDir).mkdir() @@ -110,8 +110,8 @@ task testDocker { doLast { exec { - def image = project.hasProperty('release.releaseVersion') ? "${dockerImageName}:" + project.property('release.releaseVersion') : "${dockerImageName}:${project.version}" - workingDir "${projectDir}/docker" + def image = "${dockerImageName}:${dockerBuildVersion}" + workingDir "${rootDir}/../docker" executable shell args "-c", "./test.sh ${image}" } @@ -149,4 +149,4 @@ task dockerUpload { tasks.named('jar') { enabled = false -} +} \ No newline at end of file diff --git a/build.gradle b/gradlew/build.gradle similarity index 100% rename from build.gradle rename to gradlew/build.gradle diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradlew/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from gradle/wrapper/gradle-wrapper.jar rename to gradlew/gradle/wrapper/gradle-wrapper.jar diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradlew/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from gradle/wrapper/gradle-wrapper.properties rename to gradlew/gradle/wrapper/gradle-wrapper.properties diff --git a/gradlew b/gradlew/gradlew similarity index 100% rename from gradlew rename to gradlew/gradlew diff --git a/gradlew.bat b/gradlew/gradlew.bat similarity index 100% rename from gradlew.bat rename to gradlew/gradlew.bat diff --git a/gradlew/settings.gradle b/gradlew/settings.gradle new file mode 100644 index 0000000..ec5bfd1 --- /dev/null +++ b/gradlew/settings.gradle @@ -0,0 +1,5 @@ +rootProject.name = 'tron-docker' +include('docker') +project(':docker').projectDir = new File(rootDir, '../docker') +include('tools:dbfork') +project(':tools:dbfork').projectDir = new File(rootDir, '../tools/dbfork') \ No newline at end of file diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 78e93af..0000000 --- a/settings.gradle +++ /dev/null @@ -1,3 +0,0 @@ -rootProject.name = 'tron-docker' -include('docker') -include('tools:dbfork') diff --git a/tools/README.md b/tools/README.md index 5bd424b..ca13a15 100644 --- a/tools/README.md +++ b/tools/README.md @@ -119,11 +119,11 @@ Execute database fork command: # clone the tron-docker git clone https://github.com/tronprotocol/tron-docker.git # enter the directory -cd tron-docker/tools +cd tron-docker/gradlew # compile the database fork tool -./gradlew build +./gradlew :tools:dbfork:build # execute full command -java -jar dbfork/build/libs/dbfork.jar -c fork.conf -d output-directory +cd .. && java -jar tools/dbfork/build/libs/dbfork.jar -c fork.conf -d output-directory ``` ### Launch the FullNode diff --git a/tools/dbfork/build.gradle b/tools/dbfork/build.gradle index 17dafa2..3dbfae7 100644 --- a/tools/dbfork/build.gradle +++ b/tools/dbfork/build.gradle @@ -61,7 +61,7 @@ jar { checkstyle { toolVersion = '8.41' - configFile = rootProject.file('tools/config/checkstyle/checkStyle.xml') + configFile = file("../config/checkstyle/checkStyle.xml") } task checkstyleDBForkMain(type: Checkstyle) {