forked from nicolas-albert/c8oprj_MyFirstNGX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
196 lines (158 loc) · 7.81 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
buildscript {
repositories {
mavenLocal()
maven {
url "https://m2.convertigo.com"
}
jcenter()
}
dependencies {
classpath 'com.convertigo:gradle-plugin:7.9.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
deploy {
//// deploy the current project to <server> using user/password credentials
//// can also be configured with a -Pconvertigo.deploy.server as Gradle parameter
// 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
// user 'admin'
//// password used by the deploy action, default is 'admin'
//// can also be configured with a -Pconvertigo.deploy.password as Gradle parameter
// 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
}
//// the 'nativeBuild' task depends on 'load' and it's just a configurator for 'launchNativeBuild' and 'downloadNativeBuild'
nativeBuild {
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.nativeBuild.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.nativeBuild.authenticationToken
// authenticationToken ''
//// set the platform used to build application, default is https://build.convertigo.net
//// can also be configured with a -Pconvertigo.nativeBuild.mobileBuilderPlatformURL
// mobileBuilderPlatformURL ''
//// set the iOS certificate title declared on your phonegapbuild account, default use Convertigo one
//// can also be configured with a -Pconvertigo.nativeBuild.iosCertificateTitle
// iosCertificateTitle ''
//// set the iOS certificate password declared on your phonegapbuild account, default use Convertigo one
//// can also be configured with a -Pconvertigo.nativeBuild.iosCertificatePassword
// iosCertificatePassword ''
//// set the Android certificate title declared on your phonegapbuild account, default use Convertigo one
//// can also be configured with a -Pconvertigo.nativeBuild.androidCertificateTitle
// androidCertificateTitle ''
//// set the Android certificate password declared on your phonegapbuild account, default use Convertigo one
//// can also be configured with a -Pconvertigo.nativeBuild.androidCertificatePassword
// androidCertificatePassword ''
//// set the Android certificate keystore password declared on your phonegapbuild account, default use Convertigo one
//// can also be configured with a -Pconvertigo.nativeBuild.androidCertificateKeystorePassword
// androidCertificateKeystorePassword ''
}
//// the 'launchNativeBuild' task depends on 'nativeBuild' and uploads the mobile source package to the Convertigo Phonegap Build Gateway
launchNativeBuild {
}
//// the 'downloadNativeBuild' task depends on 'launchNativeBuild' and waits the remote build to finish, then download the native packages (iOS ipa or Android apk)
downloadNativeBuild {
//// configure the destination of built mobile application packages (default 'build' folder)
//// can also be configured with a -Pconvertigo.downloadNativeBuild.destinationDir as Gradle parameter
// destinationDir 'build'
doLast {
destinationFiles.each {
println "Downloaded mobile application package: $it"
}
}
}
localBuild {
if (performsMobileBuild) {
dependsOn compileMobileBuilder
}
//platforms = ['iOS']
mode = 'debug'
}
//// 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 = '6.1.1'