Skip to content

Commit

Permalink
Merge pull request tronprotocol#2533 from tronprotocol/feature/multi_…
Browse files Browse the repository at this point in the history
…module

Feature/multi_module meger to develop
  • Loading branch information
xxo1shine authored Oct 12, 2019
2 parents 0598e4f + 2ce0146 commit b732245
Show file tree
Hide file tree
Showing 1,768 changed files with 39,114 additions and 35,635 deletions.
364 changes: 363 additions & 1 deletion .gitignore

Large diffs are not rendered by default.

69 changes: 69 additions & 0 deletions actuator/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
description = "actuator – a series of transactions for blockchain."

// Dependency versions
// ---------------------------------------

def junitVersion = "4.12"
def mockitoVersion = "2.1.0"
def testNgVersion = "6.11"
def slf4jVersion = "1.7.25"
// --------------------------------------

dependencies {
compile project(":chainbase")
compile project(":protocol")
testImplementation "junit:junit:$junitVersion"
testImplementation "org.mockito:mockito-core:$mockitoVersion"

testImplementation "org.testng:testng:$testNgVersion"

compile "org.slf4j:jcl-over-slf4j:$slf4jVersion"
compile "com.madgag.spongycastle:core:1.58.0.0"
compile 'com.github.tronprotocol:zksnark-java-sdk:master-SNAPSHOT'
compile group: 'commons-codec', name: 'commons-codec', version: '1.11'
compile 'org.reflections:reflections:0.9.11'
}

test {

testLogging {
// showing skipped occasionally should prevent CI timeout due to lack of standard output
events=["skipped", "failed"] // "started", "passed"
// showStandardStreams = true
exceptionFormat="full"

debug.events = ["skipped", "failed"]
debug.exceptionFormat="full"

info.events = ["failed", "skipped"]
info.exceptionFormat="full"

warn.events = ["failed", "skipped"]
warn.exceptionFormat="full"
}

maxHeapSize = "1200m"

if (System.getenv("CI") == null) {
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
}
}

task testng(type: Test) {
useTestNG()
testLogging {
events=["skipped", "failed"]
exceptionFormat="full"

debug.events = ["skipped", "failed"]
debug.exceptionFormat="full"

info.events = ["failed", "skipped"]
info.exceptionFormat="full"

warn.events = ["failed", "skipped"]
warn.exceptionFormat="full"
}
}

check.dependsOn testng
24 changes: 24 additions & 0 deletions actuator/gradle/buildViaTravis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
# This script will build the project.

buildTag="$TRAVIS_TAG"

if [ "$buildTag" != "" ] && [ "${buildTag:0:3}" != "v2." ]; then
echo -e "Wrong tag on the 2.x brach: $buildTag : build stopped"
exit 1
fi

export GRADLE_OPTS=-Xmx1024m

if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo -e "Build Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]"
./gradlew -PreleaseMode=pr build
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then
echo -e 'Build Branch with Snapshot => Branch ['$TRAVIS_BRANCH']'
./gradlew -PreleaseMode=branch -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" build --stacktrace
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then
echo -e 'Build Branch for Release => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG']'
./gradlew -PreleaseMode=full -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" build --stacktrace
else
echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']'
fi
34 changes: 34 additions & 0 deletions actuator/gradle/javadoc_cleanup.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// remove the excessive whitespaces between method arguments in the javadocs
task javadocCleanup(dependsOn: "javadoc") doLast {
fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/Flowable.html'));
fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/Observable.html'));
fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/Single.html'));
fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/Maybe.html'));
fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/Completable.html'));

fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/flowables/ConnectableFlowable.html'));
fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/observables/ConnectableObservable.html'));

fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/subjects/ReplaySubject.html'));
fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/processors/ReplayProcessor.html'));
fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/plugins/RxJavaPlugins.html'));
}

def fixJavadocFile(file) {
println("Cleaning up: " + file);
String fileContents = file.getText('UTF-8')

// lots of spaces after the previous method argument
fileContents = fileContents.replaceAll(",\\s{4,}", ",\n ");

// lots of spaces after the @NonNull annotations
fileContents = fileContents.replaceAll("@NonNull</a>\\s{4,}", "@NonNull</a> ");

// lots of spaces after the @Nullable annotations
fileContents = fileContents.replaceAll("@Nullable</a>\\s{4,}", "@Nullable</a> ");

file.setText(fileContents, 'UTF-8');
}

javadocJar.dependsOn javadocCleanup
build.dependsOn javadocCleanup
120 changes: 120 additions & 0 deletions actuator/gradle/push_javadoc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
#!/bin/bash
# ----------------------------------------------------------
# Automatically push back the generated JavaDocs to gh-pages
# ----------------------------------------------------------
# based on https://gist.github.com/willprice/e07efd73fb7f13f917ea

# specify the common address for the repository
targetRepo=github.com/ReactiveX/RxJava.git
# =======================================================================

# only for main pushes, for now
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo -e "Pull request detected, skipping JavaDocs pushback."
exit 0
fi

# get the current build tag if any
buildTag="$TRAVIS_TAG"
echo -e "Travis tag: '$buildTag'"

if [ "$buildTag" == "" ]; then
buildTag="snapshot"
else
buildTag="${buildTag:1}"
fi

echo -e "JavaDocs pushback for tag: $buildTag"

# check if the token is actually there
if [ "$GITHUB_TOKEN" == "" ]; then
echo -e "No access to GitHub, skipping JavaDocs pushback."
exit 0
fi

# prepare the git information
git config --global user.email "[email protected]"
git config --global user.name "Travis CI"

# setup the remote
echo -e "Adding the target repository to git"
git remote add origin-pages https://${GITHUB_TOKEN}@${targetRepo} > /dev/null 2>&1

# stash changes due to chmod
echo -e "Stashing any local non-ignored changes"
git stash

# get the gh-pages
echo -e "Update branches and checking out gh-pages"
git fetch --all
git branch -a
git checkout -b gh-pages origin-pages/gh-pages

# releases should update 2 extra locations
if [ "$buildTag" != "snapshot" ]; then
# for releases, add a new directory with the new version
# and carefully replace the others

# 1.) main javadoc
# ----------------
# remove the io subdir
echo -e "Removing javadoc/io"
rm -r javadoc/io

# remove the html files
echo -e "Removing javadoc/*.html"
rm javadoc/*.html

# copy the new doc
echo -e "Copying to javadoc/"
yes | cp -rf ./build/docs/javadoc/ .

# 2.) 2.x javadoc
# remove the io subdir
echo -e "Removing 2.x/javadoc/io"
rm -r 2.x/javadoc/io

# remove the html files
echo -e "Removing 2.x/javadoc/*.html"
rm 2.x/javadoc/*.html

# copy the new doc
echo -e "Copying to 2.x/javadoc/"
yes | cp -rf ./build/docs/javadoc/ 2.x/
fi

# 3.) create a version/snapshot specific copy of the docs
# clear the existing tag
echo -e "Removing to 2.x/javadoc/${buildTag}"
rm -r 2.x/javadoc/${buildTag}

# copy the new doc
echo -e "Copying to 2.x/javadoc/${buildTag}"
yes | cp -rf ./build/docs/javadoc/ 2.x/javadoc/${buildTag}/


# stage all changed and new files
echo -e "Staging new files"
git add *.html
git add *.css
git add *.js
git add *package-list*

# remove tracked but deleted files
echo -e "Removing deleted files"
git add -u

# commit all
echo -e "commit Travis build: $TRAVIS_BUILD_NUMBER for $buildTag"
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER for $buildTag"

# debug file list
#find -name "*.html"

# push it
echo -e "Pushing back changes."
git push --quiet --set-upstream origin-pages gh-pages


# we are done
echo -e "JavaDocs pushback complete."
Loading

0 comments on commit b732245

Please sign in to comment.