forked from simonmartyr/MxPushNotifications
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
142 lines (117 loc) · 3.86 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
apply plugin: 'java'
sourceCompatibility = '1.8'
[compileJava]*.options*.encoding = 'UTF-8'
import org.gradle.api.internal.file.copy.CopySpecInternal
buildscript {
repositories {
mavenCentral()
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'org.owasp:dependency-check-gradle:6.0.2'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.26.0'
}
}
apply plugin: 'org.owasp.dependencycheck'
apply plugin: 'com.github.ben-manes.versions'
project.ext {
PNC_VERSION = '7.4.1'
MXBUILD_VERSION = '9.24.0.2965'
MODULE_NAME = 'PushNotifications'
}
def runtimeLibs = "$buildDir/runtime/bundles"
def monoPath = '/Library/Frameworks/Mono.framework/Versions/Current/Commands'
def userLibDir = "$projectDir/userlib-generated"
def testProject = "$projectDir/PushNotfications.mpr"
configurations {
tar
}
repositories {
mavenCentral()
ivy {
url 'https://cdn.mendix.com/'
patternLayout {
artifact '/[organisation]/[module]-[revision].[ext]'
}
metadataSources {
artifact()
}
}
}
dependencies {
implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.7'
implementation group: 'commons-codec', name: 'commons-codec', version: '1.15'
implementation('com.google.auth:google-auth-library-oauth2-http:1.7.0') {
exclude group: 'com.google.code.gson', module: 'gson'
exclude group: 'com.google.guava', module: 'guava'
}
implementation('com.google.guava:guava') {
version {
strictly '32.0.1-android'
}
}
implementation('com.turo:pushy:0.13.10') {
exclude group: 'io.netty', module: 'netty-codec-http2'
exclude group: 'io.netty', module: 'netty-handler-proxy'
exclude group: 'io.netty', module: 'netty-resolver-dns'
exclude group: 'com.google.code.gson', module: 'gson'
}
implementation('io.netty:netty-codec-http2') {
version {
strictly '4.1.109.Final'
}
}
implementation('io.netty:netty-handler-proxy') {
version {
strictly '4.1.109.Final'
}
}
implementation('io.netty:netty-resolver-dns') {
version {
strictly '4.1.109.Final'
}
}
implementation('com.google.code.gson:gson') {
version {
strictly '2.9.0'
}
}
tar "runtime:mxbuild:${project.MXBUILD_VERSION}@tar.gz"
}
task extractModule( type: Exec ) {
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
executable "$buildDir/modeler/mxutil.exe"
args 'create-module-package', '--filter-required-libs', '--exclude-files=resources/.*', "--package-dir=${projectDir}/dist/${project.PNC_VERSION}/module", testProject, project.MODULE_NAME
} else {
executable "$monoPath/mono"
args "$buildDir/modeler/mxutil.exe", 'create-module-package', '--filter-required-libs', '--exclude-files=resources/.*', "--package-dir=${projectDir}/dist/${project.PNC_VERSION}/module", testProject, project.MODULE_NAME
}
}
extractModule.doFirst {
mkdir "${projectDir}/dist/${project.PNC_VERSION}/module"
}
task copyToUserlib( type: Copy ) {
into userLibDir
from configurations.runtimeClasspath
eachFile { fileCopyDetails ->
def requiredLibFlag = new File(destinationDir, "${fileCopyDetails.name}.${project.MODULE_NAME}.RequiredLib")
requiredLibFlag.write ''
}
}
task untarMxbuild( type: Copy ) {
configurations.tar.findAll{it.name.endsWith('tar.gz')}.each {
from tarTree(resources.gzip(it))
into buildDir
include('**/modeler/**')
includeEmptyDirs = false
}
}
task prepareDeps {
dependsOn 'clean', 'copyToUserlib', 'untarMxbuild'
}
clean {
delete "$userLibDir"
}
tasks.untarMxbuild.shouldRunAfter tasks.copyToUserlib