-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.gradle
130 lines (104 loc) · 3.41 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
// This gradle build depends on Mendix internal resources, the lastest commit
// which did not is 6e1527a5e31347c6914bc34deab31ef4ab46953b. You may restore
// the gradle scripts to that commit if you which to use them at your own risk.
// We don't guarantee that those will keep working in the future.
import com.github.jk1.license.render.*
plugins {
id 'java'
id 'com.mendix.gradle.publish-module-plugin' version '1.20'
id 'net.researchgate.release' version '2.8.1'
id 'com.github.jk1.dependency-license-report' version '2.0'
}
sourceCompatibility = '11'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
project.ext {
mendixPublicApiVersion = '9.18.0'
}
def mprDir = "$projectDir/src/ObjectHandling"
mxMarketplace {
appNumber = 37114
appName = 'ObjectHandling'
moduleName = 'ObjectHandling'
moduleLicense = 'Apache V2'
appDirectory = "src/ObjectHandling"
versionPathPrefix = "_Docs/version " // the path prefix within the module to the version folder
createMigrationFile = true
includeFiles = ["$mprDir/License.txt", "$mprDir/SiemensMendixObjectHandling__4.0.3__READMEOSS.html"]
}
def userLibDir = "$mprDir/userlib"
repositories {
maven {
url 'https://nexus.rnd.mendix.com/repository/repo1-proxy/'
}
maven {
url 'https://nexus.rnd.mendix.com/repository/maven-hosted/'
}
}
configurations {
implementation {
canBeResolved = true
}
}
dependencies {
testImplementation(
[group: 'com.mendix', name: 'public-api', version: "$mendixPublicApiVersion"],
[group: 'junit', name: 'junit', version: '4.13.1'],
[group: 'commons-io', name: 'commons-io', version: '2.11.0'],
[group: 'org.apache.httpcomponents.core5', name: 'httpcore5', version: '5.0.3'],
[group: 'org.apache.httpcomponents.client5', name: 'httpclient5', version: '5.0.3']
)
compileOnly([group: 'com.mendix', name: 'public-api', version: "$mendixPublicApiVersion"])
implementation(
[group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'],
[group: 'org.apache.commons', name: 'commons-text', version: '1.10.0']
)
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation"
}
sourceSets {
main {
java {
srcDir '$mprDir/javasource'
exclude 'unittesting/**'
exclude 'system/UserActionsRegistrar.java'
}
}
test {
java {
srcDirs = ["src/test", "$mprDir/javasource"]
}
}
}
test {
exclude 'unittesting/**'
}
task copyAllToUserlib(type: Copy) {
group "Build"
description "Copies all dependencies to the userlib directory."
from configurations.testCompileClasspath
into userLibDir
eachFile { fileCopyDetails -> new File(destinationDir, "${fileCopyDetails.name}.${project.name}.RequiredLib").write '' }
}
clean {
delete "$userLibDir"
}
tasks.named('mxBuild') {
dependsOn copyAllToUserlib
}
tasks.named('compileJava') {
dependsOn mxBuild
}
release {
tagTemplate = '$name-$version'
}
task afterReleaseBuildTask {
dependsOn 'clean'
dependsOn 'publishModuleToMarketplace'
tasks.findByName('publishModuleToMarketplace').mustRunAfter 'clean'
}
afterReleaseBuild.dependsOn afterReleaseBuildTask
licenseReport {
allowedLicensesFile = new File("$projectDir/allowed-licenses.json")
renderers = [new TextReportRenderer()]
}