Skip to content

Commit

Permalink
Merge pull request #157 from aionnetwork/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
qoire authored Sep 13, 2018
2 parents b32b909 + 877b883 commit 5eccee6
Show file tree
Hide file tree
Showing 321 changed files with 15,551 additions and 553 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
/pack
/mod/updated
/out
Output

#IDE
*.iml
/.idea
.DS_Store

2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pipeline {

stage('Archive build output') {
when {expression { GIT_BRANCH == 'master' || GIT_BRANCH == 'dev' || GIT_BRANCH == 'aion_ui_Jenkins' }}
steps {archiveArtifacts artifacts: 'pack/aion_ui*.tar.gz'}
steps {archiveArtifacts artifacts: 'pack/aion_ui*.zip'}
}
/*
stage('Test') {
Expand Down
174 changes: 156 additions & 18 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="build_standalone" name="aion ui"
xmlns:if="ant:if" xmlns:unless="ant:unless">
>

<condition property="isWindows" value="true" else="false">
<os family="windows"/>
</condition>

<condition property="isLinux" value="true" else="false">
<os family="unix"/>
</condition>

<condition property="isMac" value="true" else="false">
<os family="mac"/>
</condition>

<property name="parent.mod" value="../mod"/>
<property name="project.name" value="aion_ui"/>
<property name="dir.lib" value="./lib"/>
<property name="dir.mod" value="./mod"/>
<property name="dir.pack" value="./pack"/>
<property name="dir.script" value="./scripts"/>
<property name="dir.cfg" value="./config"/>
<property name="dir.main" value="./src/main"/>
<property name="src.main" value="${dir.main}/java"/>
<property name="res.main" value="${dir.main}/resources"/>
Expand All @@ -18,6 +32,12 @@
<property name="out.test" value="./build/test"/>
<property name="test.report.dir" value="./build/report"/>

<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${dir.lib}/ant-contrib-0.6.jar"/>
</classpath>
</taskdef>

<macrodef name="git">
<attribute name="command"/>
<attribute name="options"/>
Expand All @@ -27,7 +47,7 @@
<sequential>
<echo message="git @{command} @{options}"/>
<exec executable="git" dir="@{dir}" outputproperty="@{output}">
<arg line="@{command} @{options}" />
<arg line="@{command} @{options}"/>
<args/>
</exec>
<echo message="${@{output}}"/>
Expand All @@ -43,7 +63,7 @@

<target name="get_version_from_git">
<git command="tag" output="git.version" options="-l --points-at HEAD"/>
<condition property="suffix" value="" else="-${git.version}" >
<condition property="suffix" value="" else="-${git.version}">
<equals arg1="${git.version}" arg2=""/>
</condition>
</target>
Expand Down Expand Up @@ -134,6 +154,7 @@
<available file="${parent.mod}" type="dir"/>
</condition>
<javac
debug="true"
debuglevel="source,lines,vars"
includeantruntime="false"
release="10"
Expand Down Expand Up @@ -167,22 +188,139 @@

<target name="pack" depends="build_standalone">
<mkdir dir="${dir.pack}"/>
<delete file="${dir.pack}/aion_ui*.tar.gz"/>
<tar destfile="${dir.pack}/aion_ui${suffix}.tar.gz" longfile="gnu" compression="gzip">
<tarfileset dir="${dir.lib}" filemode="755" prefix="${project.name}/lib">
<if>
<os family="mac"/>
<then>
<property name="native.source" value="${res.main}/native/mac"/>
<property name="native.dest" value="${project.name}/native/mac"/>
<property name="launcher" value="AionWalletLauncher"/>
</then>
<elseif>
<os family="windows"/>
<then>
<property name="native.source" value="${res.main}/native/win"/>
<property name="native.dest" value="${project.name}/native/win"/>
</then>
</elseif>
<elseif>
<os family="unix"/>
<then>
<property name="native.source" value="${res.main}/native/linux"/>
<property name="native.dest" value="${project.name}/native/linux"/>
<property name="launcher" value="aion_ui.sh"/>
</then>
</elseif>
</if>
<zip destfile="${dir.pack}/aion_ui${suffix}.zip">
<zipfileset dir="${dir.lib}" filemode="755" prefix="${project.name}/lib">
<include name="*.jar"/>
</tarfileset>
<tarfileset dir="${dir.mod}" filemode="755" prefix="${project.name}/mod">
<exclude name="ant-contrib-0.6.jar"/>
</zipfileset>
<zipfileset dir="${dir.mod}" filemode="755" prefix="${project.name}/mod">
<include name="*.jar"/>
</tarfileset>
<tarfileset dir="${dir.pack}" filemode="755" prefix="${project.name}/mod">
<include name="aion_ui${suffix}.jar"/>
</tarfileset>
<tarfileset dir="${res.main}/native" filemode="755" prefix="${project.name}/native"/>
<tarfileset dir="${dir.script}" filemode="755" prefix="${project.name}">
<include name="aion_ui.sh"/>
</tarfileset>
</tar>
</target>
</zipfileset>
<zipfileset dir="${dir.pack}" filemode="755" prefix="${project.name}/mod">
<include name="*.jar"/>
</zipfileset>
<zipfileset dir="${dir.cfg}" filemode="755" prefix="${project.name}/config">
<include name="*.xml"/>
</zipfileset>
<zipfileset dir="${native.source}" filemode="755" prefix="${native.dest}">
<include name="blake2b/**"/>
<include name="sodium/**"/>
<include name="zmq/**"/>
<include name="ledger/**"/>
</zipfileset>
<zipfileset dir="${dir.script}" filemode="755" prefix="${project.name}">
<include name="${launcher}"/>
</zipfileset>
</zip>
<delete file="${dir.pack}/aion_ui${suffix}.jar"/>
<if>
<os family="windows"/>
<then>
<unzip src="${dir.pack}/aion_ui${suffix}.zip" dest="${dir.pack}"/>
<copy file="${dir.script}/unzip.exe" todir="${dir.pack}/aion_ui"/>
<copy file="${dir.script}/wget.exe" todir="${dir.pack}/aion_ui"/>
<copy todir="${dir.pack}/aion_ui" overwrite="true" verbose="true">
<fileset dir="${dir.script}">
<filename regex="\/*.dll|\/*.pfx"/>
</fileset>
</copy>
<exec executable="${dir.script}/bat2exe.exe">
<arg value="/bat"/>
<arg value="${dir.script}\aion_ui.bat"/>
<arg value="/exe"/>
<arg value="${dir.pack}\aion_ui\AionWallet.exe"/>
<arg value="/icon"/>
<arg value="${res.main}\org\aion\wallet\ui\components\icons\aion_icon_IR4_icon.ico"/>
<arg value="/x64"/>
<arg value="/invisible"/>
<arg value="/overwrite"/>
</exec>
</then>
<elseif>
<os family="mac"/>
<then>
<unzip src="${dir.pack}/aion_ui${suffix}.zip" dest="${dir.pack}"/>
<delete file="${dir.pack}/aion_ui${suffix}.zip"/>

<mkdir dir="${dir.pack}/AionWallet"/>
<exec executable="ln">
<arg value="-s"/>
<arg value="/Applications"/>
<arg value="${dir.pack}/AionWallet/"/>
</exec>

<mkdir dir="${dir.pack}/AionWallet/AionWallet.app"/>
<property name="mac.dir" value="${dir.pack}/AionWallet/AionWallet.app/Contents"/>

<mkdir dir="${mac.dir}"/>
<copy todir="${mac.dir}" file="${dir.script}/Info.plist"/>

<!--Libraries-->
<mkdir dir="${mac.dir}/Java"/>
<copy todir="${mac.dir}/Java" overwrite="true" verbose="true">
<fileset dir="${dir.pack}/aion_ui/lib"/>
<fileset dir="${dir.pack}/aion_ui/mod"/>
</copy>

<!--Launcher and natives-->
<mkdir dir="${mac.dir}/MacOS"/>
<copy todir="${mac.dir}/MacOS" file="${dir.pack}/aion_ui${suffix}/AionWalletLauncher"/>
<copy todir="${mac.dir}/MacOS" overwrite="true" verbose="true">
<fileset dir="${dir.pack}/aion_ui">
<include name="native/**"/>
<include name="config/**"/>
</fileset>
</copy>
<exec executable="chmod">
<arg value="755"/>
<arg value="${mac.dir}/MacOS/AionWalletLauncher"/>
</exec>
<exec executable="chmod">
<arg value="755"/>
<arg value="${mac.dir}/MacOS/native/mac/ledger/hid.tar.gz"/>
</exec>
<exec executable="curl">
<arg value="-o"/>
<arg value="${mac.dir}/MacOS/jre-10.0.2.tar.gz"/>
<arg value="-L"/>
<arg value="-O"/>
<arg value="-H"/>
<arg value="'Cookie: oraclelicense=accept-securebackup-cookie'"/>
<arg value="-k"/>
<arg value="https://download.oracle.com/otn-pub/java/jdk/10.0.2+13/19aef61b38124481863b1413dce1855f/jre-10.0.2_osx-x64_bin.tar.gz"/>
</exec>

<!--icons-->
<mkdir dir="${mac.dir}/Resources"/>
<copy todir="${mac.dir}/Resources"
file="${res.main}/org/aion/wallet/ui/components/icons/aion-icon.icns"/>

<delete dir="${dir.pack}/aion_ui"/>
</then>
</elseif>
</if>
</target>
</project>
16 changes: 16 additions & 0 deletions config/apiconfig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<aion_api>
<secure-connect>true</secure-connect>

<log>
<SOL>INFO</SOL>
<EXE>INFO</EXE>
<BSE>INFO</BSE>
<CHN>INFO</CHN>
<CNT>INFO</CNT>
<ADM>INFO</ADM>
<TRX>INFO</TRX>
<NET>INFO</NET>
<WLT>INFO</WLT>
</log>
</aion_api>
Binary file added lib/AppleJavaExtensions-1.4.jar
Binary file not shown.
Binary file added lib/ant-contrib-0.6.jar
Binary file not shown.
Binary file removed lib/guava-19.0.jar
Binary file not shown.
Binary file added lib/guava-23.0.jar
Binary file not shown.
Binary file modified lib/logback-classic-1.2.3.jar
Binary file not shown.
Binary file modified lib/logback-core-1.2.3.jar
Binary file not shown.
Binary file added lib/modAionApi-v-2018-09-11.jar
Binary file not shown.
Binary file removed lib/modAionApi-v0.1.9.75f2e8c-2018-06-14.jar
Binary file not shown.
Binary file modified lib/slf4j-api-1.7.25.jar
Binary file not shown.
Binary file modified mod/modAionBase.jar
Binary file not shown.
Binary file modified mod/modCrypto.jar
Binary file not shown.
Binary file modified mod/modLogger.jar
Binary file not shown.
39 changes: 39 additions & 0 deletions scripts/AionWalletLauncher
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash -il

SCRIPT_PATH=$(dirname $0)

cd ${SCRIPT_PATH}

STORAGE_DIR=${HOME}/.aion
LOG_DIR=${STORAGE_DIR}/log
JAVA_INSTALL=${STORAGE_DIR}/jre-10.0.2.jre/Contents/Home
JAVA_CMD=${JAVA_INSTALL}/bin/java

if [ ! -f ${JAVA_CMD} ] || [ $(${JAVA_CMD} -version 2>&1 | grep "10.0.2" | wc -l) -lt 1 ]
then
mkdir -p ${JAVA_INSTALL}
tar -xzf jre-10.0.2.tar.gz -C ${STORAGE_DIR}
fi

LEDGER=${SCRIPT_PATH}/native/mac/ledger
HID=${LEDGER}/hid
PATH=$PATH:${HID}/node-v8.11.4-darwin-x64/bin
if [ ! -d ${HID} ]
then
pushd ${LEDGER}
pwd
tar -xzf hid.tar.gz
pushd ${HID}
pwd
npm i -g npm
npm install
pwd
popd
popd
open -a AionWallet
else
LIB_DIR=$(cd ../Java && pwd)/*
mkdir -p ${LOG_DIR}
${JAVA_CMD} -cp "${LIB_DIR}" -Dlocal.storage.dir=${STORAGE_DIR} -Xms300m -Xmx500m org.aion.wallet.WalletApplication &> ${LOG_DIR}/log
fi

25 changes: 25 additions & 0 deletions scripts/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" ?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>AionWalletLauncher</string><!-- relative to Contents/MacOS -->
<key>CFBundleGetInfoString</key>
<string>AionWallet</string>
<key>CFBundleIconFile</key>
<string>aion-icon.icns</string><!-- relative to Contents/Resources -->
<key>CFBundleInfoDictionaryVersion</key>
<string>1.1.0</string>
<key>CFBundleName</key>
<string>AionWallet</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.1.0</string>
</dict>
</plist>

44 changes: 44 additions & 0 deletions scripts/aion_ui.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
::[Bat To Exe Converter]
::
::YAwzoRdxOk+EWAjk
::fBw5plQjdCyDJGmW+0g1Kw9HcAWLM2WFE7wg+/r40+eGq0MhRucsd5rJ2bGdHO8B7XnlfJkj6m1blMcJGCdNdy6oYQIkpmBHuHCWC86fvAHydkmA6UUPEmZ7iVz5vn8EadBnlI0K0C/e
::YAwzuBVtJxjWCl3EqQJgSA==
::ZR4luwNxJguZRRnk
::Yhs/ulQjdF+5
::cxAkpRVqdFKZSzk=
::cBs/ulQjdF+5
::ZR41oxFsdFKZSDk=
::eBoioBt6dFKZSDk=
::cRo6pxp7LAbNWATEpCI=
::egkzugNsPRvcWATEpCI=
::dAsiuh18IRvcCxnZtBJQ
::cRYluBh/LU+EWAnk
::YxY4rhs+aU+JeA==
::cxY6rQJ7JhzQF1fEqQJQ
::ZQ05rAF9IBncCkqN+0xwdVs0
::ZQ05rAF9IAHYFVzEqQJQ
::eg0/rx1wNQPfEVWB+kM9LVsJDGQ=
::fBEirQZwNQPfEVWB+kM9LVsJDGQ=
::cRolqwZ3JBvQF1fEqQJQ
::dhA7uBVwLU+EWDk=
::YQ03rBFzNR3SWATElA==
::dhAmsQZ3MwfNWATElA==
::ZQ0/vhVqMQ3MEVWAtB9wSA==
::Zg8zqx1/OA3MEVWAtB9wSA==
::dhA7pRFwIByZRRnk
::Zh4grVQjdCyDJGmW+0g1Kw9HcAWLM2WFE7wg++vp5vqTsXE8Xe0xT47X1rGabuUL7yU=
::YB416Ek+ZG8=
::
::
::978f952a14a936cc963da21a135fa983

REM This file is used to generate an executable file with the bat2exe tool

@ECHO OFF
set CLASSPATH="%cd%\mod\*;%cd%\lib\*"
set STORAGE_DIR="%USERPROFILE%\.aion"
set LOG_DIR="%STORAGE_DIR%\log"

mkdir "%LOG_DIR%"

java -Dfile.encoding=UTF-8 -Dlocal.storage.dir=%STORAGE_DIR% -classpath %CLASSPATH% -Xms300m -Xmx500m org.aion.wallet.WalletApplication > "%LOG_DIR%\log" 2>&1
20 changes: 18 additions & 2 deletions scripts/aion_ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,24 @@ SCRIPT_PATH=$(dirname $(realpath $0))

cd ${SCRIPT_PATH}

STORAGE_DIR=${HOME}/.aion
LOG_DIR=${STORAGE_DIR}/log
JAVA_INSTALL=${STORAGE_DIR}/jre-10.0.2
JAVA_CMD=${JAVA_INSTALL}/bin/java

if [ ! -f ${JAVA_CMD} ] || [ $(${JAVA_CMD} -version 2>&1 | grep "10.0.2" | wc -l) -lt 1 ]
then
mkdir -p ${JAVA_INSTALL}
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" \
https://download.oracle.com/otn-pub/java/jdk/10.0.2+13/19aef61b38124481863b1413dce1855f/jre-10.0.2_linux-x64_bin.tar.gz \
-O java.tar.gz
tar -xzf java.tar.gz -C ${STORAGE_DIR}
rm java.tar.gz
fi

MOD_DIR=${SCRIPT_PATH}/mod/*
LIB_DIR=${SCRIPT_PATH}/lib/*
STORAGE_DIR=${HOME}/.aion

java -cp "${MOD_DIR}:${LIB_DIR}" -Dlocal.storage.dir=${STORAGE_DIR} -Xms300m -Xmx500m org.aion.wallet.WalletApplication
mkdir -p ${LOG_DIR}

${JAVA_CMD} -cp "${MOD_DIR}:${LIB_DIR}" -Dlocal.storage.dir=${STORAGE_DIR} -Xms300m -Xmx500m org.aion.wallet.WalletApplication &> ${LOG_DIR}/log &
Binary file added scripts/bat2exe.exe
Binary file not shown.
Binary file added scripts/cert.pfx
Binary file not shown.
Binary file added scripts/cygbz2-1.dll
Binary file not shown.
Binary file added scripts/cygintl-8.dll
Binary file not shown.
Binary file added scripts/cygwin1.dll
Binary file not shown.
Loading

0 comments on commit 5eccee6

Please sign in to comment.