This repository has been archived by the owner on Apr 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 392
/
Copy pathGruntfile.js
142 lines (133 loc) · 3.88 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
const os = require('os');
var path = require('path');
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.loadNpmTasks('grunt-electron-installer');
grunt.loadNpmTasks('grunt-electron');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-compress');
var appConfig = {
name: require('./app/package.json').name,
version: require('./app/package.json').version || '0.0.1',
author: require('./app/package.json').author,
};
var common_ignore_dir = [
'/node_modules/grunt($|/)',
'/map/package.json',
'/map/Gruntfile.js',
'.github',
'.git',
'map/contrib',
'map/docs',
'map/Tools',
'.DS_Store',
'.gitignore',
'ngrok-linux'
],
mac_ignore_dir = [
'ngrok-win32.exe',
'pywin',
'pylibs/win32'
],
win_ignore_dir = [
'ngrok-darwin',
'pylibs/osx64'
];
grunt.initConfig({
clean: {
osx_dist: [path.join(path.resolve(), 'dist', 'pokemon-go-map-darwin-x64')],
pyc: [path.join(path.resolve(), 'app', '**', '*.pyc')]
},
execute: {
build_map_assets: {
options: {
cwd: path.join(path.resolve(), 'app', 'map')
},
src: ['npm install && npm run build']
}
},
shell: {
compressOsx: {
command: [
'cd dist/pokemon-go-map-darwin-x64',
'mv "pokemon-go-map.app" "Pokemon GO Live Map.app"',
'rm -fr LICENSE LICENSES.chromium.html version',
'zip -9ryv ../PokemonGoMap-OSX.zip . >/dev/null'
].join('&&')
}
},
'create-windows-installer': {
ia32: {
appDirectory: path.join(path.resolve(), 'dist', 'pokemon-go-map-win32-ia32'),
outputDirectory: path.join(path.resolve(), 'dist', 'pokemon-go-map-win32-installer'),
title: 'Pokemon GO Live Map',
exe: "pokemon-go-map.exe",
noMsi: true,
setupExe: 'PokemonGoMap-Win.exe',
setupIcon: path.join(path.resolve(), 'pokemon.ico'),
iconUrl: 'https://raw.githubusercontent.com/mchristopher/PokemonGo-DesktopMap/master/pokemon.ico',
loadingGif: path.join(path.resolve(), 'installing.gif'),
productName: 'Pokemon GO Live Map',
remoteReleases: 'https://github.com/mchristopher/PokemonGo-DesktopMap/releases/download/v0.4.0'
}
},
'electron': {
macos: {
options: {
name: appConfig.name,
dir: 'app',
out: 'dist',
overwrite: true,
asar: false,
ignore: common_ignore_dir.concat(mac_ignore_dir),
version: '1.2.7',
platform: 'darwin',
arch: 'x64',
'app-version': appConfig.version,
icon: path.join(path.resolve(), 'pokemon.icns'),
'app-bundle-id': 'com.mchrstopher.pokemon-go-live-map',
'osx-sign': {
identity: 'Developer ID Application: EaglEye Computer Services, LLC (46DPF949NK)'
}
}
},
win32: {
options: {
name: appConfig.name,
dir: 'app',
out: 'dist',
overwrite: true,
asar: false,
ignore: common_ignore_dir.concat(win_ignore_dir),
version: '1.2.7',
platform: 'win32',
arch: 'ia32',
'app-version': appConfig.version,
icon: path.join(path.resolve(), 'pokemon.ico'),
'version-string': {
'CompanyName': appConfig.author,
'FileDescription': 'Pokemon GO Live Map',
'ProductName': 'Pokemon GO Live Map',
'OriginalFilename': 'pokemon-go-map.exe'
}
}
}
}
});
grunt.registerTask('default', [
'osx',
'win32'
]);
grunt.registerTask('osx', [
'clean:osx_dist',
'clean:pyc',
'execute',
'electron:macos',
'shell:compressOsx'
]);
grunt.registerTask('win32', [
'clean:pyc',
'electron:win32',
'create-windows-installer',
]);
};