-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
241 lines (193 loc) · 10.4 KB
/
build.gradle
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
buildscript {
repositories {
mavenLocal()
maven {
url "https://m2.convertigo.com"
}
mavenCentral()
}
dependencies {
classpath 'org.eclipse.jgit:org.eclipse.jgit.ssh.jsch:[5.4,)'
classpath 'com.convertigo:gradle-plugin:8.3.0-SNAPSHOT'
}
}
apply plugin: 'convertigo'
/** Convertigo Gradle Plugin DSL **/
//// determines if the project needs to perform a mobile build before 'deploy' or 'car' tasks
//// can also be configured with a -Pconvertigo.performsMobileBuild as Gradle parameter
def performsMobileBuild = file('_c8oProject/mobilePages').exists() && !'false'.equals(project.properties['convertigo.performsMobileBuild'])
//// the 'load' task loads and migrates the project to the current plugin version
load {
//// change the 'version' property of the project at loading
//// can also be configured with a -Pconvertigo.load.projectVersion as Gradle parameter
// projectVersion '1.0.0-release'
//// change the 'Convertigo server endpoint' property of the project's mobile application at loading
//// can also be configured with a -Pconvertigo.load.mobileApplicationEndpoint as Gradle parameter
// mobileApplicationEndpoint 'https://myserver.com/convertigo'
//// specify a folder where to auto-import git references
//// can also be configured with a -Pconvertigo.load.gitContainer as Gradle parameter
// gitContainer '..'
doLast {
//// any property of the project can be changed here
// convertigoProject.comment += ' edited by gradle'
}
}
//// the 'export' task depends on 'load' and saves the project at the current plugin version
export {
//// mobile application can be built before the 'export', then 'car' and 'deploy' can use build result
if (performsMobileBuild) {
dependsOn compileMobileBuilder
}
}
//// the 'generateMobileBuilder' task depends on 'load' and generates sources of the Ionic application into _private/ionic
generateMobileBuilder {
//// configure the generation mode, can be can be production (default) or debugplus, debug, fast
//// if omitted, compileMobileBuilder.mode is used
//// can also be configured with a -Pconvertigo.generateMobileBuilder.mode as Gradle parameter
// mode 'production'
}
//// the 'compileMobileBuilder' task depends on 'generateMobileBuilder' and compiles the Ionic application with NPM into DisplayObject/mobile
compileMobileBuilder {
//// configure the generation mode, can be can be production (default) or debug
//// if omitted, generateMobileBuilder.mode is used
//// can also be configured with a -Pconvertigo.compileMobileBuilder.mode as Gradle parameter
// mode 'production'
}
//// the 'car' task allows to build a <projectName>.car inside the <projectdir>/build folder
car {
//// configure the destination of the <projectName>.car file (default 'build' folder)
//// can also be configured with a -Pconvertigo.car.destinationDir as Gradle parameter
// destinationDir 'build'
//// include TestCases (default true)
//// can also be configured with a -Pconvertigo.car.includeTestCases as Gradle parameter
// includeTestCases true
//// include Stubs (default true)
//// can also be configured with a -Pconvertigo.car.includeStubs as Gradle parameter
// includeStubs true
//// include built MobileApp (default true)
//// can also be configured with a -Pconvertigo.car.includeMobileApp as Gradle parameter
// includeMobileApp true
//// include built MobileApp assets (default true)
//// can also be configured with a -Pconvertigo.car.includeMobileAppAssets as Gradle parameter
// includeMobileAppAssets true
//// include mobile dataset (default true)
//// can also be configured with a -Pconvertigo.car.includeMobileDataset as Gradle parameter
// includeMobileDataset true
//// include mobile platform assets (default true)
//// can also be configured with a -Pconvertigo.car.includeMobilePlatformsAssets as Gradle parameter
// includeMobilePlatformsAssets true
doLast {
println "Saved Convertigo archive: $destinationFile"
}
}
//// the 'deploy' task depends on 'car' and allows to push the project to a Convertigo server
//// the task is auto skipped if properties are empties, following tasks can check deploy.state.didWork
deploy {
//// deploy the current project to <server> using user/password credentials
//// can also be configured with a -Pconvertigo.deploy.server as Gradle parameter
//// Note: the task is skipped if the property doesn't start with http
// server 'https://myserver.com/convertigo'
//// user used by the deploy action, default is 'admin'
//// can also be configured with a -Pconvertigo.deploy.user as Gradle parameter
//// Note: the task is skipped if the property is empty
// user 'admin'
//// password used by the deploy action, default is 'admin'
//// can also be configured with a -Pconvertigo.deploy.password as Gradle parameter
//// Note: the task is skipped if the property is empty
// user 'password'
//// deploy over an https <server> without checking certificates, default is false
//// can also be configured with a -Pconvertigo.deploy.trustAllCertificates as Gradle parameter
// trustAllCertificates false
//// assemble XSL files on deploy, default is false
//// can also be configured with a -Pconvertigo.deploy.assembleXsl as Gradle parameter
// assembleXsl false
//// retry <retry> times in case of deploy failure, default is 5
//// can also be configured with a -Pconvertigo.deploy.retry as Gradle parameter
// retry 5
}
//// the 'remoteBuild' task depends on 'load' and it's just a configurator for 'launchRemoteBuild' and 'downloadRemoteBuild'
remoteBuild {
if (performsMobileBuild) {
dependsOn compileMobileBuilder
}
//// set an array of platforms (Convertigo Platforms object) names to build, empty means all declared platforms
//// can also be configured with a -Pconvertigo.remoteBuild.platforms as Gradle parameter (names separated by comma)
// platforms = []
//// set authenticationToken from your phonegapbuild account, default use Convertigo one
//// can also be configured with a -Pconvertigo.remoteBuild.authenticationToken
// authenticationToken ''
//// set the platform used to build application, default is https://build.convertigo.net
//// can also be configured with a -Pconvertigo.remoteBuild.mobileBuilderPlatformURL
// mobileBuilderPlatformURL ''
//// set the iOS certificate title declared on your phonegapbuild account, default use Convertigo one
//// can also be configured with a -Pconvertigo.remoteBuild.iosCertificateTitle
// iosCertificateTitle ''
//// set the iOS certificate password declared on your phonegapbuild account, default use Convertigo one
//// can also be configured with a -Pconvertigo.remoteBuild.iosCertificatePassword
// iosCertificatePassword ''
//// set the Android certificate title declared on your phonegapbuild account, default use Convertigo one
//// can also be configured with a -Pconvertigo.remoteBuild.androidCertificateTitle
// androidCertificateTitle ''
//// set the Android certificate password declared on your phonegapbuild account, default use Convertigo one
//// can also be configured with a -Pconvertigo.remoteBuild.androidCertificatePassword
// androidCertificatePassword ''
//// set the Android certificate keystore password declared on your phonegapbuild account, default use Convertigo one
//// can also be configured with a -Pconvertigo.remoteBuild.androidCertificateKeystorePassword
// androidCertificateKeystorePassword ''
}
//// the 'localBuild' task depends on 'load' and allows to build mobile native package locally
localBuild {
if (performsMobileBuild) {
dependsOn compileMobileBuilder
}
//// set an array of platforms (Convertigo Platforms object) names to build, empty means all declared platforms
//// can also be configured with a -Pconvertigo.localBuild.platforms as Gradle parameter (names separated by comma)
// platforms = []
//// build mode of the native package, can be 'release' or 'debug' (default)
//// can also be configured with a -Pconvertigo.localBuild.mode as Gradle parameter
//// the Android 'debug' mode doesn't need signing configuration
// mode = 'debug'
//// define where are moved mobile package when the build success
//// can also be configured with a -Pconvertigo.localBuild.packageDestinationDir as Gradle parameter
// packageDestinationDir = file('build/localDir')
//// define the IOS Provisioning Profile file used to sign the IPA package
//// can also be configured with a -Pconvertigo.localBuild.iosProvisioningProfile as Gradle parameter
// iosProvisioningProfile = file('ios.mobileprovision')
//// define the IOS Sign Identity used to sign the IPA package
//// can also be configured with a -Pconvertigo.localBuild.iosSignIdentity as Gradle parameter
// iosSignIdentity = (mode == 'release' ? 'iPhone Distribution' : 'iPhone Developer')
//// define the Android Keystore file used to sign the release APK package
//// can also be configured with a -Pconvertigo.localBuild.androidKeystore as Gradle parameter
// androidKeystore = file('android.keystore')
//// define the Android Keystore password
//// can also be configured with a -Pconvertigo.localBuild.androidKeystorePassword as Gradle parameter
// androidKeystorePassword = ''
//// define the certificate alias, inside the Android Keystore, that sign the release APK package
//// can also be configured with a -Pconvertigo.localBuild.androidAlias as Gradle parameter
// androidAlias = ''
//// define the certificate password, inside the Android Keystore, that sign the release APK package
//// can also be configured with a -Pconvertigo.localBuild.androidPassword as Gradle parameter
// androidPassword = ''
}
//// the 'launchRemoteBuild' task depends on 'remoteBuild' and uploads the mobile source package to the Convertigo Build Gateway
launchRemoteBuild {
}
//// the 'downloadRemoteBuild' task depends on 'launchRemoteBuild' and waits the remote build to finish, then download the native packages (iOS ipa or Android apk)
downloadRemoteBuild {
//// configure the destination of built mobile application packages (default 'build' folder)
//// can also be configured with a -Pconvertigo.downloadRemoteBuild.destinationDir as Gradle parameter
// destinationDir 'build'
doLast {
destinationFiles.each {
println "Downloaded mobile application package: $it"
}
}
}
//// the 'wrapper' task is used to upgrade the Gradle wrapper of the projet
if (!tasks.findByName('wrapper')) {
task wrapper(type: Wrapper) {
group 'build setup'
description 'Generates Gradle wrapper files.'
}
}
wrapper.gradleVersion = '8.5'