forked from hyperledger-iroha/iroha-dco
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into trunk/mst_experimental
Signed-off-by: Kitsu <[email protected]>
- Loading branch information
Showing
86 changed files
with
4,201 additions
and
3,507 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,74 @@ | ||
#!/usr/bin/env groovy | ||
|
||
def doBindings() { | ||
def cmake_options = "" | ||
if (params.JavaBindings) { | ||
cmake_options += " -DSWIG_JAVA=ON " | ||
} | ||
if (params.PythonBindings) { | ||
cmake_options += " -DSWIG_PYTHON=ON " | ||
} | ||
// In case language specific options were not set, | ||
// build for each language | ||
if (!params.JavaBindings && !params.PythonBindings) { | ||
cmake_options += " -DSWIG_JAVA=ON -DSWIG_PYTHON=ON " | ||
} | ||
def doJavaBindings(buildType=Release) { | ||
def currentPath = sh(script: "pwd", returnStdout: true).trim() | ||
def commit = env.GIT_COMMIT | ||
def artifactsPath = sprintf('%1$s/java-bindings-%2$s-%3$s-%4$s.zip', | ||
[currentPath, buildType, sh(script: 'date "+%Y%m%d"', returnStdout: true).trim(), commit.substring(0,6)]) | ||
sh """ | ||
cmake \ | ||
-H. \ | ||
-Bbuild \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
${cmake_options} | ||
-DCMAKE_BUILD_TYPE=$buildType \ | ||
-DSWIG_JAVA=ON | ||
""" | ||
sh "cd build; make -j${params.PARALLELISM} irohajava" | ||
sh "zip -j $artifactsPath build/shared_model/bindings/*.java build/shared_model/bindings/libirohajava.so" | ||
sh "cp $artifactsPath /tmp/bindings-artifact" | ||
return artifactsPath | ||
} | ||
|
||
def doPythonBindings(buildType=Release) { | ||
def currentPath = sh(script: "pwd", returnStdout: true).trim() | ||
def commit = env.GIT_COMMIT | ||
def supportPython2 = "OFF" | ||
def artifactsPath = sprintf('%1$s/python-bindings-%2$s-%3$s-%4$s-%5$s.zip', | ||
[currentPath, env.PBVersion, buildType, sh(script: 'date "+%Y%m%d"', returnStdout: true).trim(), commit.substring(0,6)]) | ||
// do not use preinstalled libed25519 | ||
sh "rm -rf /usr/local/include/ed25519*; unlink /usr/local/lib/libed25519.so; rm -f /usr/local/lib/libed25519.so.1.2.2" | ||
if (env.PBVersion == "python2") { supportPython2 = "ON" } | ||
sh """ | ||
cmake \ | ||
-H. \ | ||
-Bbuild \ | ||
-DCMAKE_BUILD_TYPE=$buildType \ | ||
-DSWIG_PYTHON=ON \ | ||
-DSUPPORT_PYTHON2=$supportPython2 | ||
""" | ||
sh "cmake --build build --target python_tests" | ||
sh "cd build; make -j${params.PARALLELISM} irohajava irohapy" | ||
sh "cd build; make -j${params.PARALLELISM} irohapy" | ||
sh "protoc --proto_path=schema --python_out=build/shared_model/bindings block.proto primitive.proto commands.proto queries.proto responses.proto endpoint.proto" | ||
sh "${env.PBVersion} -m grpc_tools.protoc --proto_path=schema --python_out=build/shared_model/bindings --grpc_python_out=build/shared_model/bindings endpoint.proto yac.proto ordering.proto loader.proto" | ||
sh "zip -j $artifactsPath build/shared_model/bindings/*.py build/shared_model/bindings/*.so" | ||
sh "cp $artifactsPath /tmp/bindings-artifact" | ||
return artifactsPath | ||
} | ||
|
||
def doAndroidBindings(abiVersion) { | ||
def currentPath = sh(script: "pwd", returnStdout: true).trim() | ||
def commit = env.GIT_COMMIT | ||
def artifactsPath = sprintf('%1$s/android-bindings-%2$s-%3$s-%4$s-%5$s-%6$s.zip', | ||
[currentPath, "\$PLATFORM", abiVersion, "\$BUILD_TYPE_A", sh(script: 'date "+%Y%m%d"', returnStdout: true).trim(), commit.substring(0,6)]) | ||
sh """ | ||
(cd /iroha; git init; git remote add origin https://github.com/hyperledger/iroha.git; \ | ||
git fetch --depth 1 origin develop; git checkout -t origin/develop) | ||
""" | ||
sh """ | ||
. /entrypoint.sh; \ | ||
sed -i.bak "s~find_package(JNI REQUIRED)~SET(CMAKE_SWIG_FLAGS \\\${CMAKE_SWIG_FLAGS} -package \${PACKAGE})~" /iroha/shared_model/bindings/CMakeLists.txt; \ | ||
# TODO: might not be needed in the future | ||
sed -i.bak "/target_include_directories(\\\${SWIG_MODULE_irohajava_REAL_NAME} PUBLIC/,+3d" /iroha/shared_model/bindings/CMakeLists.txt; \ | ||
sed -i.bak "s~swig_link_libraries(irohajava~swig_link_libraries(irohajava \"/protobuf/.build/lib\${PROTOBUF_LIB_NAME}.a\" \"\${NDK_PATH}/platforms/android-$abiVersion/\${ARCH}/usr/\${LIBP}/liblog.so\"~" /iroha/shared_model/bindings/CMakeLists.txt; \ | ||
sed -i.bak "s~find_library(protobuf_LIBRARY protobuf)~find_library(protobuf_LIBRARY \${PROTOBUF_LIB_NAME})~" /iroha/cmake/Modules/Findprotobuf.cmake; \ | ||
sed -i.bak "s~find_program(protoc_EXECUTABLE protoc~set(protoc_EXECUTABLE \"/protobuf/host_build/protoc\"~" /iroha/cmake/Modules/Findprotobuf.cmake; \ | ||
cmake -H/iroha/shared_model -B/iroha/shared_model/build -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=$abiVersion -DCMAKE_ANDROID_ARCH_ABI=\$PLATFORM \ | ||
-DANDROID_NDK=\$NDK_PATH -DCMAKE_ANDROID_STL_TYPE=c++_static -DCMAKE_BUILD_TYPE=\$BUILD_TYPE_A -DTESTING=OFF \ | ||
-DSHARED_MODEL_DISABLE_COMPATIBILITY=ON -DSWIG_JAVA=ON -DCMAKE_PREFIX_PATH=\$DEPS_DIR | ||
""" | ||
sh "cmake --build /iroha/shared_model/build --target irohajava -- -j${params.PARALLELISM}" | ||
sh "zip -j $artifactsPath /iroha/shared_model/build/bindings/*.java /iroha/shared_model/build/bindings/libirohajava.so" | ||
sh "cp $artifactsPath /tmp/bindings-artifact" | ||
return artifactsPath | ||
} | ||
|
||
return this |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env groovy | ||
|
||
def remoteFilesDiffer(f1, f2) { | ||
sh "curl -sSL -o /tmp/${env.GIT_COMMIT}/f1 --create-dirs ${f1}" | ||
sh "curl -sSL -o /tmp/${env.GIT_COMMIT}/f2 ${f2}" | ||
diffExitCode = sh(script: "diff -q /tmp/${env.GIT_COMMIT}/f1 /tmp/${env.GIT_COMMIT}/f2", returnStatus: true) | ||
return diffExitCode != 0 | ||
} | ||
|
||
return this |
Oops, something went wrong.