Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Commit

Permalink
Fix gulpfile to package release by yarn, and add dependency of appdmg
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuki Hattori committed Mar 27, 2018
1 parent f98ecd9 commit ff5c27b
Show file tree
Hide file tree
Showing 4 changed files with 212 additions and 27 deletions.
17 changes: 4 additions & 13 deletions README.md
Expand Up @@ -36,8 +36,8 @@ foobar
### Getting started

```
npm install
npm start
yarn install
yarn start
```

### Customizing Slide CSS
Expand All @@ -47,7 +47,7 @@ It's easy, include a `<link>` tag at the top of your presentation, or alternativ
### Create release builds

```
gulp release
yarn gulp release
```

Please set application version in `package.json`.
Expand All @@ -60,16 +60,7 @@ If you want to build for Windows in other platforms, please install [Wine](https

##### OSX

To build for Darwin is only supported in OSX. Please install [appdmg](https://github.com/LinusU/node-appdmg) to create archive (`.dmg`) for Darwin release.

```
npm install appdmg
```

###### Notices

- **Don't add development dependency of `appdmg` to `package.json`.** The release task would fail in other platforms.
- *`gulp-appdmg` is no longer in use since v0.0.4.*
To build for Darwin is only supported in OSX.

## Licenses

Expand Down
18 changes: 10 additions & 8 deletions gulpfile.coffee
Expand Up @@ -16,6 +16,7 @@ packageOpts =
name: config.name
version: config.devDependencies['electron']
prune: true
packageManager: 'yarn'
overwrite: true
'app-bundle-id': 'jp.yhatt.marp'
'app-version': config.version
Expand Down Expand Up @@ -108,26 +109,29 @@ gulp.task 'dist', ['clean:dist'], ->
'package.json'
'example.md'
'LICENSE'
'yarn.lock'
], { base: '.' })
.pipe gulp.dest('dist')
.pipe $.install
production: true
commands:
'package.json': 'yarn'
yarn: ['--production']

gulp.task 'package', ['clean:packages', 'dist'], (done) ->
runSequence 'package:win32', 'package:darwin', 'package:linux', done

gulp.task 'package:win32', (done) ->
gulp.task 'package:win32', ->
packageElectron {
platform: 'win32'
arch: 'ia32,x64'
icon: Path.join(__dirname, 'resources/windows/marp.ico')
}, done
gulp.task 'package:linux', (done) ->
}
gulp.task 'package:linux', ->
packageElectron {
platform: 'linux'
arch: 'ia32,x64'
}, done
gulp.task 'package:darwin', (done) ->
}
gulp.task 'package:darwin', ->
packageElectron {
platform: 'darwin'
arch: 'x64'
Expand All @@ -145,7 +149,6 @@ gulp.task 'package:darwin', (done) ->
}
]
.pipe gulp.dest('.')
.on 'end', done

gulp.task 'build', (done) -> runSequence 'compile:production', 'package', done
gulp.task 'build:win32', (done) -> runSequence 'compile:production', 'dist', 'package:win32', done
Expand All @@ -170,7 +173,6 @@ gulp.task 'archive:darwin', (done) ->

unless appdmg
$.util.log 'Archiving for darwin is supported only OSX.'
$.util.log 'In OSX, please install appdmg (`npm install appdmg`)'
return done()

globFolders 'packages/*-darwin-*', (path, globDone) ->
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -15,6 +15,7 @@
"author": "Yuki Hattori",
"license": "MIT",
"devDependencies": {
"appdmg": "^0.5.2",
"coffee-script": "^1.10.0",
"del": "^3.0.0",
"electron": "1.8.4",
Expand Down

0 comments on commit ff5c27b

Please sign in to comment.