-
Notifications
You must be signed in to change notification settings - Fork 61
/
Gruntfile.coffee
224 lines (204 loc) · 7.49 KB
/
Gruntfile.coffee
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
#
# * grunt-phonegap
# * https://github.com/logankoester/grunt-phonegap
# *
# * Copyright (c) 2013-2014 Logan Koester
# * Licensed under the MIT license.
#
module.exports = (grunt) ->
# Project configuration.
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
# Configuration to be run (and then tested).
phonegap:
config:
root: 'test/fixtures/www'
cordova: 'test/fixtures/.cordova'
name: 'TestFixtureApp'
path: 'test/phonegap'
cleanBeforeBuild: true
plugins: ['./test/fixtures/org.apache.cordova.core.device']
platforms: ['android', 'ios']
debuggable: false
config:
template: 'test/fixtures/www/custom_config.xml'
data:
id: 'com.phonegap.test'
version: '1.0.0'
name: 'TestFixtureApp'
description: 'A text fixture app'
author:
email: '[email protected]'
href: 'http://logankoester.com'
text: 'Logan Koester'
verbose: false
releases: 'test/releases'
releaseName: 'TestFixtureApp-0.0.0'
androidManifest:
application:
'applicationKey' : 'applicationValue'
activity:
'activityKey' : 'activityValue'
key:
store: 'test/fixtures/release.keystore'
alias: 'release'
aliasPassword: -> 'testAliasPassword'
storePassword: -> 'testStorePassword'
icons:
android:
ldpi: 'test/fixtures/www/icon-36-ldpi.png'
mdpi: 'test/fixtures/www/icon-48-mdpi.png'
hdpi: 'test/fixtures/www/icon-72-hdpi.png'
xhdpi: 'test/fixtures/www/icon-96-xhdpi.png'
xxhdpi: 'test/fixtures/www/icon-144-xxhdpi.png'
xxxhdpi: 'test/fixtures/www/icon-192-xxxhdpi.png'
ios:
icon29: 'test/fixtures/www/icon29.png'
icon29x2: 'test/fixtures/www/icon29x2.png'
icon40: 'test/fixtures/www/icon40.png'
icon40x2: 'test/fixtures/www/icon40x2.png'
icon57: 'test/fixtures/www/icon57.png'
icon57x2: 'test/fixtures/www/icon57x2.png'
icon60x2: 'test/fixtures/www/icon60x2.png'
icon72: 'test/fixtures/www/icon72.png'
icon72x2: 'test/fixtures/www/icon72x2.png'
icon76: 'test/fixtures/www/icon76.png'
icon76x2: 'test/fixtures/www/icon76x2.png'
icon512: 'test/fixtures/www/icon512.png'
icon512x2: 'test/fixtures/www/icon512x2.png'
screens:
android:
ldpi: 'test/fixtures/www/screen-ldpi-portrait.png'
ldpiLand: 'test/fixtures/www/screen-ldpi-landscape.png'
mdpi: 'test/fixtures/www/screen-mdpi-portrait.png'
mdpiLand: 'test/fixtures/www/screen-mdpi-landscape.png'
hdpi: 'test/fixtures/www/screen-hdpi-portrait.png'
hdpiLand: 'test/fixtures/www/screen-hdpi-landscape.png'
xhdpi: 'test/fixtures/www/screen-xhdpi-portrait.png'
xhdpiLand: 'test/fixtures/www/screen-xhdpi-landscape.png'
wp8:
app: 'test/fixtures/www/icon-62-tile.png'
tile: 'test/fixtures/www/icon-173-tile.png'
ios:
ipadLand: 'test/fixtures/www/screen-ipad-landscape.png'
ipadLandx2: 'test/fixtures/www/screen-ipad-landscape-2x.png'
ipadPortrait: 'test/fixtures/www/screen-ipad-portrait.png'
ipadPortraitx2: 'test/fixtures/www/screen-ipad-portrait-2x.png'
iphonePortrait: 'test/fixtures/www/screen-iphone-portrait.png'
iphonePortraitx2: 'test/fixtures/www/screen-iphone-portrait-2x.png'
iphone568hx2: 'test/fixtures/www/screen-iphone-568h-2x.png'
iosStatusBar: 'WhiteAndTransparent'
versionCode: -> 2
targetSdkVersion: -> 18
minSdkVersion: -> 11
permissions: ['ACCESS_NETWORK_STATE']
androidApplicationName: 'com.phonegap.test_custom_app'
screenOrientation: 'portrait'
# Before generating any new files, remove any previously-created files.
clean:
tasks: ['tasks']
test: ['test']
# Unit tests.
nodeunit:
tests: ['test/**/*_test.js']
# Copy files
copy:
test_fixtures:
files: [{
expand: true
cwd: 'src/test/fixtures'
src: ['**/*']
dest: 'test/fixtures/'
}]
test_cordova:
files: [{
expand: true
cwd: 'src/test/fixtures/.cordova'
src: ['**/*']
dest: 'test/fixtures/.cordova'
}]
# Coffeescript
coffee:
tasks:
expand: true
cwd: 'src/tasks/'
src: '**/*.coffee'
dest: 'tasks/'
ext: '.js'
test:
expand: true
cwd: 'src/test/'
src: '**/*.coffee'
dest: 'test/'
ext: '.js'
watch:
coffee:
files: ['src/**/*.coffee', 'Gruntfile.coffee']
tasks: ['default']
bump:
options:
commit: true
commitMessage: 'Release v%VERSION%'
commitFiles: ['package.json']
createTag: true
tagName: 'v%VERSION%'
tagMessage: 'Version %VERSION%'
push: false
signCommits: true
signTags: true
readme_generator:
readme:
options:
readme_folder: 'docs'
output: 'README.md'
table_of_contents: true
toc_extra_links: []
generate_changelog: true
changelog_folder: 'docs/releases'
changelog_version_prefix: 'v'
changelog_insert_before: 'legal.md'
banner: 'banner.md'
has_travis: false
github_username: 'logankoester'
generate_footer: false
generate_title: false
package_title: null
informative: true
h1: '#'
h2: '##'
back_to_top_custom: '#grunt-phonegap'
order:
'requirements.md': 'Requirements'
'getting-started.md': 'Getting Started'
'overview.md': 'Overview'
'features/dynamic-config.md': 'Dynamic config.xml'
'features/app-icons.md': 'App Icons'
'features/version-code.md': 'versionCode'
'features/debugging.md': 'Android Debugging'
'features/sdk-version.md': 'minSdkVersion and targetSdkVersion'
'features/permissions.md': 'Android Permissions'
'features/screen-orientation.md': 'Android Screen Orientation'
'features/application-name.md': 'Application Name'
'features/phonegap-build.md': 'Phonegap Build'
'tasks.md': 'Tasks'
'test-suite.md': 'Running the test suite'
'../CONTRIBUTING.md': 'Contributing'
'legal.md': 'License'
# These plugins provide necessary tasks.
grunt.loadNpmTasks 'grunt-contrib-clean'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-copy'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-nodeunit'
grunt.loadNpmTasks 'grunt-bump'
grunt.loadNpmTasks 'grunt-readme-generator'
# Load this plugin's tasks (deferred until build is ready)
grunt.registerTask 'test', ->
grunt.loadTasks 'tasks'
grunt.task.run 'phonegap:build', 'phonegap:debug:android', 'phonegap:release:android', 'nodeunit'
grunt.registerTask 'run', ->
grunt.loadTasks 'tasks'
grunt.task.run 'phonegap:run'
grunt.registerTask 'docs', ['readme_generator']
grunt.registerTask 'build', ['clean', 'copy', 'coffee', 'docs']
grunt.registerTask 'default', ['build', 'test']