Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
CS-Tao committed Nov 20, 2018
2 parents dc01cc4 + 8cd09a9 commit f48d275
Show file tree
Hide file tree
Showing 13 changed files with 270 additions and 277 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ before_install:

script:
- sudo npm install -g cordova
- cordova -v
- yarn
- yarn build
- cordova -v
# Fix bug of https://github.com/apache/cordova-android/issues/521 temporarily.
- rm -f ./platforms/android/CordovaLib/build.gradle && mv ./.travis/cordova.patforms.android.CordovaLib.build.gradle ./platforms/android/CordovaLib/build.gradle
- yarn release:android
- mv ./platforms/android/app/build/outputs/apk/release/app-release.apk whu-library-seat-mobile_$TRAVIS_TAG.apk

Expand Down
137 changes: 0 additions & 137 deletions .travis/cordova.patforms.android.CordovaLib.build.gradle

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

- 下载链接

[whu-library-seat-mobile_v1.5.0.apk](https://github.com/CS-Tao/whu-library-seat-mobile/releases/download/v1.5.0/whu-library-seat-mobile_v1.5.0.apk)
[whu-library-seat-mobile_v1.5.1.apk](https://github.com/CS-Tao/whu-library-seat-mobile/releases/download/v1.5.0/whu-library-seat-mobile_v1.5.1.apk)

- 二维码:

Expand Down
24 changes: 23 additions & 1 deletion build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,37 @@ var config = require('../config')
var ora = require('ora')
var webpack = require('webpack')
var webpackConfig = require('./webpack.prod.conf')

var { say } = require('cfonts')
var chalk = require('chalk')
var spinner = ora('building for production...')
const isCI = process.env.CI || false

greeting()
spinner.start()

var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory)
rm('-rf', assetsPath)
mkdir('-p', assetsPath)
cp('-R', 'static/.', assetsPath)

function greeting () {
const cols = process.stdout.columns
let text = ''

if (cols > 85) text = 'lets-build'
else if (cols > 60) text = 'lets-|build'
else text = false

if (text && !isCI) {
say(text, {
colors: ['yellow'],
font: 'simple3d',
space: false
})
} else console.log(chalk.yellow.bold('\n lets-build'))
console.log()
}

webpack(webpackConfig, function (err, stats) {
spinner.stop()
if (err) throw err
Expand Down
13 changes: 10 additions & 3 deletions build/dev-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ require('eventsource-polyfill')
var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')

hotClient.subscribe(function (event) {
if (event.action === 'reload') {
window.location.reload()
}
/**
* Reload browser when HTMLWebpackPlugin emits a new index.html
*
* Currently disabled until jantimon/html-webpack-plugin#680 is resolved.
* https://github.com/SimulatedGREG/electron-vue/issues/437
* https://github.com/jantimon/html-webpack-plugin/issues/680
*/
// if (event.action === 'reload') {
// window.location.reload()
// }
})
43 changes: 31 additions & 12 deletions build/dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ var path = require('path')
var express = require('express')
var webpack = require('webpack')
var opn = require('opn')
var { say } = require('cfonts')
var chalk = require('chalk')
var proxyMiddleware = require('http-proxy-middleware')
var webpackConfig = require('./webpack.dev.conf')

Expand All @@ -26,12 +28,9 @@ var devMiddleware = require('webpack-dev-middleware')(compiler, {
})

var hotMiddleware = require('webpack-hot-middleware')(compiler)
// force page reload when html-webpack-plugin template changes
compiler.plugin('compilation', function (compilation) {
compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
hotMiddleware.publish({ action: 'reload' })
cb()
})

compiler.plugin('watch-run', (compilation, done) => {
done()
})

// proxy api requests
Expand Down Expand Up @@ -74,16 +73,36 @@ app.get(
}
})

module.exports = app.listen(port, function (err) {
if (err) {
console.log(err)
return
}
function greeting () {
const cols = process.stdout.columns
let text = ''

if (cols > 104) text = 'cordova-vue'
else if (cols > 76) text = 'cordova-|vue'
else text = false

if (text) {
say(text, {
colors: ['yellow'],
font: 'simple3d',
space: false
})
} else console.log(chalk.yellow.bold('\n cordova-vue'))

var uri = 'http://localhost:' + port
console.log('Listening at ' + uri + '\n')
console.log(chalk.blue(' listening at ' + uri) + '\n')
console.log(chalk.hex('#3eaf7c')(' getting ready...') + '\n')

// when env is testing, don't need open it
if (process.env.NODE_ENV !== 'testing') {
opn(uri)
}
}

module.exports = app.listen(port, function (err) {
if (err) {
console.log(err)
return
}
greeting()
})
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="cc.cs_tao.whu_library_seat_mobile" version="1.5.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="cc.cs_tao.whu_library_seat_mobile" version="1.5.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>whu-library-seat-mobile</name>
<description>
武汉大学图书馆抢座软件
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "whu-library-seat-mobile",
"version": "1.5.0",
"version": "1.5.1",
"author": "CS-Tao <whucstao@qq.com>",
"description": "武汉大学图书馆抢座软件",
"license": null,
Expand Down Expand Up @@ -46,6 +46,7 @@
"babel-preset-env": "^1.7.0",
"babel-preset-stage-2": "^6.24.1",
"babel-register": "^6.26.0",
"cfonts": "^2.2.3",
"chalk": "^2.1.0",
"connect-history-api-fallback": "^1.5.0",
"cross-env": "^5.0.5",
Expand Down
Loading

0 comments on commit f48d275

Please sign in to comment.