Skip to content

Commit

Permalink
Merge pull request #1277 from unfoldingWord-dev/develop
Browse files Browse the repository at this point in the history
Release 12.1
  • Loading branch information
jag3773 authored Oct 25, 2019
2 parents fd7d47d + cc0328a commit 0c569c7
Show file tree
Hide file tree
Showing 52 changed files with 15,993 additions and 7,034 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/env", "@babel/react"]
}
108 changes: 54 additions & 54 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ env:
# - node_modules
before_install:
- ./scripts/skip_travis_commits.sh
- sudo add-apt-repository --yes ppa:ubuntu-wine/ppa
- sudo add-apt-repository --yes ppa:arx/release
- sudo apt-get update -d
- sudo apt-get install -y -q innoextract wine python-software-properties
- wine --version
- innoextract --version
- "./scripts/innosetup/innoinstall.sh"
- sudo cp scripts/innosetup/iscc /usr/local/bin/iscc
- iscc /? 2> /dev/null | grep "Inno Setup Preprocessor"
# private keys for app
- if [ "${TRAVIS_SECURE_ENV_VARS}" != "false" ]; then openssl aes-256-cbc -K $encrypted_8efd489acff0_key
-iv $encrypted_8efd489acff0_iv -in private.json.enc -out src/config/private.json
-d; fi
# dropbox uploader key
- if [ "${TRAVIS_SECURE_ENV_VARS}" != "false" ]; then openssl aes-256-cbc -K $encrypted_8efd489acff0_key
-iv $encrypted_8efd489acff0_iv -in .dropbox_uploader.enc -out ~/.dropbox_uploader
-d; fi
#- sudo add-apt-repository --yes ppa:ubuntu-wine/ppa
#- sudo add-apt-repository --yes ppa:arx/release
#- sudo apt-get update -d
#- sudo apt-get install -y -q innoextract wine python-software-properties
#- wine --version
#- innoextract --version
#- "./scripts/innosetup/innoinstall.sh"
#- sudo cp scripts/innosetup/iscc /usr/local/bin/iscc
#- iscc /? 2> /dev/null | grep "Inno Setup Preprocessor"
## private keys for app
#- if [ "${TRAVIS_SECURE_ENV_VARS}" != "false" ]; then openssl aes-256-cbc -K $encrypted_8efd489acff0_key
# -iv $encrypted_8efd489acff0_iv -in private.json.enc -out src/config/private.json
# -d; fi
## dropbox uploader key
#- if [ "${TRAVIS_SECURE_ENV_VARS}" != "false" ]; then openssl aes-256-cbc -K $encrypted_8efd489acff0_key
# -iv $encrypted_8efd489acff0_iv -in .dropbox_uploader.enc -out ~/.dropbox_uploader
# -d; fi

# install git lfs
#- mkdir -p $HOME/bin
Expand All @@ -50,29 +50,29 @@ before_script:
#- npm install door43-client -g
script: npm test
after_success:
- test $TRAVIS_TEST_RESULT == 0 && $TRAVIS_PULL_REQUEST == "false"
- test -z $TRAVIS_TAG && ./scripts/bump.sh
#- door43-client index -i src/index/index.sqlite -f
- test -f src/index/index.sqlite
#- door43-client download -i src/index/index.sqlite -d src/index/resource_containers -f -c
- test -d src/index/resource_containers
- bower install
# ensure bower installed correctly
- test -d src/components
- gulp prince
# ensure prince was installed
- test -d src/prince
- gulp build --win
- gulp build --linux
- gulp build --osx
- gulp release
# upload to dropbox
- if [ -f ~/.dropbox_uploader ]; then
echo 'uploading build to dropbox';
./dropbox_uploader.sh -q upload ./release/ travis-artifacts/$TRAVIS_JOB_NUMBER/;
else
echo 'missing ~/.dropbox_uploader. Skipping dropbox upload.';
fi
#- test $TRAVIS_TEST_RESULT == 0 && $TRAVIS_PULL_REQUEST == "false"
#- test -z $TRAVIS_TAG && ./scripts/bump.sh
##- door43-client index -i src/index/index.sqlite -f
#- test -f src/index/index.sqlite
##- door43-client download -i src/index/index.sqlite -d src/index/resource_containers -f -c
#- test -d src/index/resource_containers
#- bower install
## ensure bower installed correctly
#- test -d src/components
#- gulp prince
## ensure prince was installed
#- test -d src/prince
#- gulp build --win
#- gulp build --linux
#- gulp build --osx
#- gulp release
## upload to dropbox
#- if [ -f ~/.dropbox_uploader ]; then
# echo 'uploading build to dropbox';
# ./dropbox_uploader.sh -q upload ./release/ travis-artifacts/$TRAVIS_JOB_NUMBER/;
# else
# echo 'missing ~/.dropbox_uploader. Skipping dropbox upload.';
# fi
deploy:
## develop branch
#- provider: surge
Expand Down Expand Up @@ -101,17 +101,17 @@ deploy:
# tags: false
# condition: "-d ./release && $TRAVIS_BRANCH =~ ^release-.*$"
# master branch
- provider: releases
api_key:
secure: brjmL3cyCTr6swNCqka2fkc41j+PO2tqXZhE9QyNoDEXcxR1FOwPoPut/8h4N/pISfkf2FibtsWqThhW1Xz1pVNNMBlHRblJsSecfvXOtn7kneCsAV+QBngbPuA8OKzfhXTUeIQNlIpfG+rwlDg28wOthDI/7ADBOYgGQWeOd7o=
file:
- release/*.exe
- release/*.zip
file_glob: true
skip_cleanup: true
overwrite: true
draft: true
on:
tags: true
repo: unfoldingWord-dev/ts-desktop
condition: "-d ./release"
#- provider: releases
# api_key:
# secure: brjmL3cyCTr6swNCqka2fkc41j+PO2tqXZhE9QyNoDEXcxR1FOwPoPut/8h4N/pISfkf2FibtsWqThhW1Xz1pVNNMBlHRblJsSecfvXOtn7kneCsAV+QBngbPuA8OKzfhXTUeIQNlIpfG+rwlDg28wOthDI/7ADBOYgGQWeOd7o=
# file:
# - release/*.exe
# - release/*.zip
# file_glob: true
# skip_cleanup: true
# overwrite: true
# draft: true
# on:
# tags: true
# repo: unfoldingWord-dev/ts-desktop
# condition: "-d ./release"
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ The following commands are available from within the project directory:

> Note: You can open the Chrome Developer Tools while the app is running by pressing `Ctrl+Shift+I` on Windows/Linux or `Cmd-Shift-I` on macOS.
### Building tA
tA has been built using react and es6. If you need to work on this part of the code, work in `src/js/academy-es6` and then run `npm run compile-ta`.

### Included Resources
The application is bundled with resources from the following languages

Expand Down
47 changes: 31 additions & 16 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,29 @@ const gulp = require('gulp'),
mkdirp = require('mkdirp'),
fs = require('fs'),
util = require('./src/js/lib/utils'),
princePackager = require('./src/js/prince-packager');
princePackager = require('./src/js/prince-packager'),
requireES6 = require('./src/js/require-es6'),
{ pack: packagetA } = requireES6(path.join(__dirname, './src/js/academy/package-ta'));

const APP_NAME = 'translationStudio',
JS_FILES = './src/js/**/*.js',
UNIT_TEST_FILES = './unit_tests/**/*.js',
BUILD_DIR = 'out/',
RELEASE_DIR = 'release/';

gulp.task('test', function () {
function test() {
return gulp.src(UNIT_TEST_FILES, { read: false })
.pipe(mocha({reporter: 'spec', grep: (argv.grep || argv.g)}));
});
}

gulp.task('clean', function () {
function clean(done) {
rimraf.sync('src/logs');
rimraf.sync('logs');
rimraf.sync('ssh');
});
done();
}

gulp.task('bump', function () {
function bump() {
var build = require('./package').build;

var bumped = ++build;
Expand All @@ -44,23 +47,23 @@ gulp.task('bump', function () {
return gulp.src(['package.json'])
.pipe(replace(/("build"\s*:\s*)"\d+"(.*)/, replaceString))
.pipe(gulp.dest('./'));
});
}

/**
* This will download and install prince binaries for all os'
*/
gulp.task('prince', function(done) {
function prince(done) {
var tempDir = 'src/prince';

util.chain(princePackager.install.bind(null, tempDir))(['win', 'linux', 'osx'])
.then(function() {
done();
})
.catch(done);
});
}

// pass parameters like: gulp build --win --osx --linux
gulp.task('build', ['clean'], function (done) {
function build(done) {

var platforms = [];

Expand All @@ -80,13 +83,13 @@ gulp.task('build', ['clean'], function (done) {
RELEASE_DIR,
'vendor',
'scripts',
'\\.'
'\\.(?!babelrc)'
]).map(function (name) {
return new RegExp('(^/' + name + '|' + '^/node_modules/' + name + ')');
});

packager({
'asar': true,
'asar': false,
'arch': argv.win ? 'all' : 'x64',
'platform': platforms,
'dir': '.',
Expand Down Expand Up @@ -129,9 +132,9 @@ gulp.task('build', ['clean'], function (done) {
// }
// });
// }
});
}

gulp.task('release', function(done) {
function release(done) {
const p = require('./package');
const archiver = require('archiver');
const exec = require('child_process').exec;
Expand Down Expand Up @@ -329,6 +332,18 @@ gulp.task('release', function(done) {
done();
}).catch(done);
});
});
}

gulp.task('default', ['test']);
function packTA() {
return packagetA(path.join(__dirname, './src/index/ta'));
}


module.exports.default = test;
module.exports.test = test;
module.exports.release = release;
module.exports.packTA = packTA;
module.exports.build = gulp.series(clean, build);
module.exports.prince = prince;
module.exports.bump = bump;
module.exports.clean = clean;
Loading

0 comments on commit 0c569c7

Please sign in to comment.