Skip to content

Commit

Permalink
Merge pull request #1 from EthersocialNetwork/esn-support
Browse files Browse the repository at this point in the history
ESN Wallet v0.3.5 (Mist v0.12.0)
  • Loading branch information
hackmod authored Apr 10, 2019
2 parents 742078a + b8caaf8 commit 9977ab8
Show file tree
Hide file tree
Showing 91 changed files with 3,522 additions and 350 deletions.
3 changes: 2 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
url = git://github.com/ethereum/dapp-styles.git
[submodule "meteor-dapp-wallet"]
path = meteor-dapp-wallet
url = https://github.com/ethereum/meteor-dapp-wallet.git
url = https://github.com/EthersocialNetwork/meteor-dapp-wallet.git
branch = ethersocial
13 changes: 7 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ matrix:
- gcc-multilib
- g++-multilib
after_failure:
- cat ~/.config/Ethereum\ Wallet/logs/all.*
- cat ~/.config/*Wallet/logs/all.*

# MAC, MIST
- os: osx
Expand Down Expand Up @@ -82,12 +82,16 @@ matrix:
before_install:
- npm install -g yarn
after_failure:
- cat ~/Library/Application\ Support/Ethereum\ Wallet/logs/all.*
- cat ~/Library/Application\ Support/*Wallet/logs/all.*

install:
- PATH=$PATH:$HOME/.meteor && curl -L https://raw.githubusercontent.com/arunoda/travis-ci-meteor-packages/1390e0f96162d0d70fc1e60a6b0f4f891a0e8f42/configure.sh | /bin/sh
- meteor --version
- cp local.example.json local.json

- (cd meteor-dapp-wallet/app && mkdir packages && cd packages && git clone https://github.com/EthersocialNetwork/meteor-package-tools && git clone https://github.com/EthersocialNetwork/meteor-package-elements)
- (cd interface && mkdir packages && cd packages && git clone https://github.com/EthersocialNetwork/meteor-package-tools && git clone https://github.com/EthersocialNetwork/meteor-package-elements)
- (cd meteor-dapp-wallet/app && yarn)
- yarn

script:
Expand All @@ -100,7 +104,4 @@ script:
fi

after_success:
- if [ $TRAVIS_BRANCH == "master" ]; then
yarn dist:${PRODUCT} --$GULP_PLATFORM;
fi

- yarn dist:${PRODUCT} --$GULP_PLATFORM;
33 changes: 29 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ environment:
# increasing `meteor build` memory allocation
# https://github.com/meteor/meteor/issues/9568
TOOL_NODE_FLAGS: "--max-old-space-size=4096"
TIMEOUT_SCALE_FACTOR: 8

APPVEYOR_RDP_PASSWORD:
secure: ErXQkfrN/bX6LtqcjtnLGw==

matrix:
- product: mist
- product: wallet
- product: mist

artifacts:
- path: dist_mist\release\*
Expand All @@ -38,20 +39,44 @@ install:
- git submodule update --init --recursive

# installs global dependencies
- choco install meteor
- choco install meteor --params="'/RELEASE:1.8.1'"
- choco install nsis
- choco install 7zip

- refreshenv
- ps: refreshenv

- node --version

# prepare meteor-dapp-wallet
- cp local.example.json local.json
- cd meteor-dapp-wallet/app && mkdir packages && cd packages
- git clone https://github.com/EthersocialNetwork/meteor-package-tools && git clone https://github.com/EthersocialNetwork/meteor-package-elements
- cd .. && yarn install
- cd ..\..\..
- cd

- meteor --version
# download 7za
- curl -L http://www.7-zip.org/a/7z1900-extra.7z -o extra.7z
- 7z.exe x extra.7z
- copy x64\7za.exe "C:\\Program Files\\7-zip\\7za.exe"
- copy "C:\\Program Files\\7-zip\\7za.exe" C:\Users\appveyor\AppData\Local\.meteor\packages\meteor-tool\1.8.1\mt-os.windows.x86_64\dev_bundle\bin\7z.exe && exit 0
# fix console.js to show progress
- cat C:\Users\appveyor\AppData\Local\.meteor\packages\meteor-tool\1.8.1\mt-os.windows.x86_64\tools\console\console.js | sed "s@!this._stream.isTTY ||@@" > fix.js
- copy fix.js C:\Users\appveyor\AppData\Local\.meteor\packages\meteor-tool\1.8.1\mt-os.windows.x86_64\tools\console\console.js

# installs JS dependencies
- yarn install
- cd interface && yarn install
- cd interface && mkdir packages && cd packages && git clone https://github.com/EthersocialNetwork/meteor-package-tools && git clone https://github.com/EthersocialNetwork/meteor-package-elements
- cd .. && yarn install
- cd ..\..
- cd

build_script:
- ps: yarn build:$env:product --win --skipTasks=build-interface
- ps: |
$env:METEOR_PROGRESS_DEBUG = 1
yarn build:$env:product --win --verbose --debug
- ps: yarn dist:$env:product

test_script:
Expand Down
35 changes: 35 additions & 0 deletions default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "Ethereum",
"ticker": "ETH",
"symbol": "Ξ",
"walletName": "Ethereum Wallet",
"homepage": "https://github.com/ethereum/mist",
"appPrefix": "org.ethereum",
"githubUploadUrl": "https://uploads.github.com/repos/ethereum/mist/releases",
"githubApiUrl": "https://api.github.com/repos/ethereum/mist/releases",
"homeUrl": "https://ethereum.org",
"homeRedirect": "https://ethereum.org",
"walletHomeUrl": "https://ethereum.org",
"walletHomeRedirect": "https://wallet.ethereum.org",
"clientBinariesJson": "https://raw.githubusercontent.com/ethereum/mist/master/clientBinaries.json",
"downloadUrl": "https://github.com/ethereum/mist/releases",
"wikiUrl": "https://github.com/ethereum/mist/wiki",
"gitterUrl": "https://gitter.im/ethereum/mist",
"issueUrl": "https://github.com/ethereum/mist/issues",
"binaryUrl": "https://www.ethereum.org/download/clientBinaries.json",
"keystorePath" : {
"darwin": "/Library/Ethereum/keystore",
"unix": "/.ethereum/keystore",
"win32": "\\Ethereum\\keystore"
},
"ipcPath": {
"darwin": "/Library/Ethereum/geth.ipc",
"unix": "/.ethereum/geth.ipc",
"win32": "\\\\.\\pipe\\geth.ipc"
},
"userPath": {
"darwin": "/Library/Ethereum/keystore",
"unix": "/.ethereum/keystore",
"win32": "\\Ethereum\\keystore"
}
}
Binary file added ethersocial/icons/mist/icon.icns
Binary file not shown.
Binary file added ethersocial/icons/mist/icon.ico
Binary file not shown.
Binary file added ethersocial/icons/mist/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ethersocial/icons/mist/icon2x.fw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ethersocial/icons/mist/icon2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ethersocial/icons/wallet/icon.icns
Binary file not shown.
Binary file added ethersocial/icons/wallet/icon.ico
Binary file not shown.
Binary file added ethersocial/icons/wallet/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ethersocial/icons/wallet/icon2x.fw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ethersocial/icons/wallet/icon2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
144 changes: 123 additions & 21 deletions gulpTasks/building.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const _ = require('underscore');
const builder = require('electron-builder');
const del = require('del');
const { exec, execSync } = require('child_process');
const spawn = require('cross-spawn');
const fs = require('fs');
const gulp = require('gulp');
const babel = require('gulp-babel');
Expand All @@ -11,8 +12,17 @@ const Q = require('bluebird');
const shell = require('shelljs');
const version = require('../package.json').version;

var settings = {};
try {
_.extend(settings, require('../local.json'));
} catch (error) {
_.extend(settings, require('../default.json'));
}

const type = options.type;
const applicationName = options.wallet ? 'Ethereum Wallet' : 'Mist';
const applicationName = options.wallet ? settings.walletName : 'Mist';

settings.appId = `${settings.appPrefix}.${type}`;

gulp.task('clean-dist', cb => {
return del([`./dist_${type}`], cb);
Expand Down Expand Up @@ -56,35 +66,66 @@ gulp.task('transpile-modules', () => {
});

gulp.task('copy-build-folder-files', () => {
let imgSrcDir = './';
if (settings.imgSrcDir) {
imgSrcDir = settings.imgSrcDir;
}

// copy all custom icons
gulp.src([`${imgSrcDir}icons/${type}/icon*`])
.pipe(gulp.dest(`./dist_${type}/app/icons/${type}`));

return gulp
.src([`./icons/${type}/*`, './interface/public/images/dmg-background.jpg'])
.src([`${imgSrcDir}icons/${type}/*`, `${imgSrcDir}interface/public/images/dmg-background.jpg`])
.pipe(gulp.dest(`./dist_${type}/build`));
});

gulp.task('switch-production', cb => {
var config = {
production: true,
mode: type
};
const appPath = path.join(__dirname, `../dist_${type}`, 'app');
shell.mkdir('-p', appPath);
config.public = settings;
fs.writeFile(
`./dist_${type}/app/config.json`,
JSON.stringify({
production: true,
mode: type
}),
JSON.stringify(config),
cb
);
});

gulp.task('pack-wallet', cb => {
del(['./wallet']).then(() => {
const fromPath = path.resolve('meteor-dapp-wallet', 'build');
const toPath = path.resolve('wallet');
const srcPath = path.resolve('meteor-dapp-wallet');

if (!fs.existsSync(fromPath)) {
if (!fs.existsSync(srcPath)) {
throw new Error(
`${fromPath} could not be found. Did you run "git submodule update --recursive?"`
`${srcPath} could not be found. Did you run "git submodule update --recursive?"`
);
}

shell.cp('-R', fromPath, toPath);
cb();
console.log('Use local wallet at meteor-dapp-wallet/app');
let opts = ['run', 'meteor-build-client'];
const configPath = path.resolve(`dist_${type}/app/config.json`);
const walletPath = path.resolve('wallet');
opts.push(walletPath);
opts.push('-s', configPath);
opts.push('-p', " ");
if (options.debug) opts.push('--debug');
if (options.verbose) opts.push('--verbose');

let cmd = spawn('yarn',
opts,
{ cwd: 'meteor-dapp-wallet/app' },
(err, stdout, stderr) => {
console.log(stderr);
}
);
cmd.stdout.pipe(process.stdout);
cmd.on('close', (code) => {
cb(code);
});
});
});

Expand All @@ -101,21 +142,46 @@ gulp.task('move-wallet', cb => {
});

gulp.task('build-interface', cb => {
console.log('Build build-interface');
let opts = ['run', 'meteor-build-client'];
const interfaceBuildPath = path.resolve('build-interface');
exec(
`yarn run meteor-build-client ${interfaceBuildPath} -p ""`,
const configPath = path.resolve(`dist_${type}/app/config.json`);
opts.push(interfaceBuildPath);
opts.push('-s', configPath);
opts.push('-p', " ");
if (options.debug) opts.push('--debug');
if (options.verbose) opts.push('--verbose');

let cmd = spawn('yarn',
opts,
{ cwd: 'interface' },
(err, stdout) => {
console.log(stdout);
cb(err);
(err, stdout, stderr) => {
console.log(stderr);
}
);
cmd.stdout.pipe(process.stdout);
cmd.stderr.pipe(process.stderr);
cmd.on('close', (code) => {
cb(code);
});
});

gulp.task('copy-interface', () => {
return gulp
.src(['build-interface/**/*'])
.pipe(gulp.dest(`dist_${type}/app/interface`));
.pipe(gulp.dest(`dist_${type}/app/interface`, { mode: 0644 }));
});

gulp.task('custom-interface', () => {
let imgSrcDir = './';
if (settings.imgSrcDir) {
imgSrcDir = settings.imgSrcDir;

// copy all custom image files
return gulp
.src([`${imgSrcDir}interface/public/images/*`])
.pipe(gulp.dest(`dist_${type}/app/interface/images`));
}
});

gulp.task('copy-i18n', () => {
Expand All @@ -126,16 +192,45 @@ gulp.task('copy-i18n', () => {
.pipe(gulp.dest(`./dist_${type}/app`));
});

// generate tab-i18n.json
gulp.task('tap-i18n', cb => {
const i18nPath = path.join('interface', 'public', 'i18n');
shell.mkdir('-p', i18nPath);

let i18nConf = fs.readFileSync('./interface/project-tap.i18n');
i18nConf = JSON.parse(i18nConf);

const resources = {};
i18nConf.supported_languages.forEach(lang => {
let uiTranslations = {};
try {
if (fs.existsSync(`./interface/i18n/app.${lang}.i18n.json`)) {
uiTranslations = require(`../interface/i18n/app.${lang}.i18n.json`);
}
} catch (e) {
// ignore
}
let mistTranslations = require(`../interface/i18n/mist.${lang}.i18n.json`);
resources[lang] = { project: _.extend(uiTranslations, mistTranslations) };

let out = JSON.stringify(resources[lang]);
fs.writeFileSync(path.join(i18nPath, `${lang}.json`), out);
});

let out = JSON.stringify(resources);
fs.writeFile(path.join(i18nPath, 'tap-i18n.json'), out, cb);
});

gulp.task('build-dist', cb => {
const appPackageJson = _.extend({}, require('../package.json'), {
// eslint-disable-line global-require
name: applicationName.replace(/\s/, ''),
productName: applicationName,
description: applicationName,
license: 'GPL-3.0',
homepage: 'https://github.com/ethereum/mist',
homepage: settings.homepage,
build: {
appId: `org.ethereum.${type}`,
appId: settings.appId,
asar: true,
directories: {
buildResources: '../build',
Expand Down Expand Up @@ -281,12 +376,19 @@ gulp.task('build-nsis', done => {

const typeString = `-DTYPE=${type}`;
const appNameString = `-DAPPNAME=${applicationName.replace(/\s/, '-')}`;
const networkString = `-DNETWORK=${settings.name}`;
const portString = `-DPORT=${settings.port}`;
const gethIdString = `-DGETHID=${settings.defaultNodeTypeId}`;
const gethString = `-DGETH=${settings.defaultNodeType}`;
const issueUrlString = `-DISSUEURL=${settings.issueUrl}`;
const downloadUrlString = `-DDOWNLOADURL=${settings.downloadUrl}`;
const homeUrlString = `-DHOMEURL=${settings.walletHomeUrl}`;
const versionParts = version.split('.');
const versionString = `-DVERSIONMAJOR=${versionParts[0]} -DVERSIONMINOR=${
versionParts[1]
} -DVERSIONBUILD=${versionParts[2]}`;

const cmdString = `makensis ${versionString} ${typeString} ${appNameString} scripts/windows-installer.nsi`;
const cmdString = `makensis ${versionString} ${typeString} ${appNameString} ${networkString} ${portString} ${gethIdString} ${gethString} ${issueUrlString} ${downloadUrlString} ${homeUrlString} scripts/windows-installer.nsi`;

exec(cmdString, done);
});
Loading

0 comments on commit 9977ab8

Please sign in to comment.