github.com/adnan-c/fabric_e2e_couchdb@v0.6.1-preview.0.20170228180935-21ce6b23cf91/core/chaincode/shim/java/javabuild.sh (about)

     1  #!/bin/bash
     2  
     3  #
     4  #Copyright DTCC 2016 All Rights Reserved.
     5  #
     6  #Licensed under the Apache License, Version 2.0 (the "License");
     7  #you may not use this file except in compliance with the License.
     8  #You may obtain a copy of the License at
     9  #
    10  #         http://www.apache.org/licenses/LICENSE-2.0
    11  #
    12  #Unless required by applicable law or agreed to in writing, software
    13  #distributed under the License is distributed on an "AS IS" BASIS,
    14  #WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    15  #See the License for the specific language governing permissions and
    16  #limitations under the License.
    17  #
    18  #
    19  set -e
    20  PARENTDIR=$(pwd)
    21  ARCH=`uname -m`
    22  
    23  function getProxyHost {
    24    ADDR=${1#*://}
    25    echo ${ADDR%:*}
    26  }
    27  
    28  function getProxyPort {
    29    ADDR=${1#*://}
    30    echo ${ADDR#*:}
    31  }
    32  
    33  [ -n "$http_proxy" ] && JAVA_OPTS="$JAVA_OPTS -Dhttp.proxyHost=$(getProxyHost $http_proxy) -Dhttp.proxyPort=$(getProxyPort $http_proxy)"
    34  [ -n "$https_proxy" ] && JAVA_OPTS="$JAVA_OPTS -Dhttps.proxyHost=$(getProxyHost $https_proxy) -Dhttps.proxyPort=$(getProxyPort $https_proxy)"
    35  [ -n "$HTTP_PROXY" ] && JAVA_OPTS="$JAVA_OPTS -Dhttp.proxyHost=$(getProxyHost $HTTP_PROXY) -Dhttp.proxyPort=$(getProxyPort $HTTP_PROXY)"
    36  [ -n "$HTTPS_PROXY" ] && JAVA_OPTS="$JAVA_OPTS -Dhttps.proxyHost=$(getProxyHost $HTTPS_PROXY) -Dhttps.proxyPort=$(getProxyPort $HTTPS_PROXY)"
    37  export JAVA_OPTS
    38  
    39  if [ x$ARCH == xx86_64 ]
    40  then
    41      gradle -q -b ${PARENTDIR}/core/chaincode/shim/java/build.gradle clean
    42      gradle -q -b ${PARENTDIR}/core/chaincode/shim/java/build.gradle build
    43      cp -r ${PARENTDIR}/core/chaincode/shim/java/build/libs /root/
    44  else
    45      echo "FIXME: Java Shim code needs work on ppc64le and s390x."
    46      echo "Commenting it for now."
    47  fi