Skip to content

Commit f2b774f

Browse files
authored
Merge pull request #43 from mendix/use-publish-plugin-9
Use publish plugin 9
2 parents 434110d + 6f0f3d7 commit f2b774f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+423
-2382
lines changed

Audit trail.mpr

0 Bytes
Binary file not shown.

MAINTAIN.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Building locally
2+
3+
In order to prepare userlib folder to run the project locally, use `./gradlew prepareTest`. To keep only jars that are needed for the release, use `./gradlew prepareMpk`.
4+
5+
`./gradlew mxBuild` builds the app locally.
6+
7+
`./gradlew exportModule` creates an mpk to be released with only necessary jars included in userlib.

build.gradle

Lines changed: 90 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,108 @@
1-
apply plugin: 'application'
1+
plugins {
2+
id 'java'
3+
id 'com.mendix.gradle.publish-module-plugin' version '1.12'
4+
id 'net.researchgate.release' version '2.8.1'
5+
}
26

37
import org.gradle.api.internal.file.copy.CopySpecInternal
48

5-
sourceCompatibility = '1.8'
9+
sourceCompatibility = '11'
610
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
711

8-
repositories {
9-
mavenCentral()
12+
project.ext {
13+
mendixPublicApiVersion = '9.0.5'
14+
userLibDir = 'userlib'
1015
}
1116

1217
configurations.all {
1318
transitive = false
1419
}
1520

21+
mxMarketplace {
22+
moduleName = "AuditTrail"
23+
moduleLicense = "Apache V2"
24+
appNumber = 138
25+
appName = "Audittrail"
26+
appDirectory = "."
27+
versionPathPrefix = "__Version " // the path prefix within the module to the version folder
28+
}
29+
30+
repositories {
31+
maven {
32+
url 'https://nexus.rnd.mendix.com/repository/repo1-proxy/'
33+
}
34+
maven {
35+
url 'https://nexus.rnd.mendix.com/repository/maven-hosted/'
36+
}
37+
}
38+
39+
1640
dependencies {
17-
// TEST_CRM
18-
compile group: 'org.hamcrest', name: 'hamcrest', version: '2.2'
41+
testImplementation(
42+
[group: 'com.mendix', name: 'public-api', version: "$mendixPublicApiVersion"],
43+
44+
// TEST_CRM
45+
[group: 'org.hamcrest', name: 'hamcrest', version: '2.2'],
1946

20-
// UnitTesting
21-
compile group: 'junit', name: 'junit', version: '4.11'
22-
compile group: 'commons-io', name: 'commons-io', version: '2.3'
23-
compile group: 'org.apache.httpcomponents', name: 'httpcore-osgi', version: '4.4.1'
24-
compile group: 'org.apache.httpcomponents', name: 'httpclient-osgi', version: '4.4.1'
47+
// UnitTesting
48+
[group: 'junit', name: 'junit', version: '4.13.1'],
49+
[group: 'commons-io', name: 'commons-io', version: '2.11.0'],
50+
[group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'],
51+
[group: 'org.apache.httpcomponents.core5', name: 'httpcore5', version: '5.0.3'],
52+
[group: 'org.apache.httpcomponents.client5', name: 'httpclient5', version: '5.0.3']
53+
)
2554

26-
// UnitTesting and ObjectHandling
27-
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.1'
55+
compileOnly([group: 'com.mendix', name: 'public-api', version: "$mendixPublicApiVersion"])
2856
}
2957

30-
task copyToUserlib( type: Copy ) {
58+
task copyAllToUserlib(type: Copy) {
3159
from configurations.testCompileClasspath
32-
into 'userlib'
33-
rename 'commons-io-2.3.jar', 'org.apache.commons.io-2.3.0.jar'
34-
rename 'commons-lang3-3.1.jar', 'org.apache.commons.lang3.jar'
35-
rename 'http(.*)-osgi-(.*)', 'org.apache.httpcomponents.http$1_$2'
60+
into userLibDir
61+
}
62+
63+
task copyRuntimeToUserlib(type: Copy) {
64+
from configurations.runtimeClasspath
65+
into userLibDir
66+
eachFile { fileCopyDetails -> new File(destinationDir, "${fileCopyDetails.name}.${project.name}.RequiredLib").write '' }
3667
}
68+
69+
clean {
70+
delete "$userLibDir"
71+
}
72+
73+
task prepareMpk {
74+
dependsOn 'clean'
75+
dependsOn 'copyRuntimeToUserlib'
76+
77+
tasks.findByName('copyRuntimeToUserlib').mustRunAfter 'clean'
78+
}
79+
80+
task prepareTest {
81+
dependsOn 'clean'
82+
dependsOn 'copyAllToUserlib'
83+
84+
tasks.findByName('copyAllToUserlib').mustRunAfter 'clean'
85+
}
86+
87+
test {
88+
exclude 'unittesting/*'
89+
}
90+
91+
release {
92+
tagTemplate = '$name-$version'
93+
}
94+
95+
task afterReleaseBuildTask {
96+
dependsOn 'prepareMpk'
97+
dependsOn 'prepareTest'
98+
dependsOn 'test'
99+
dependsOn 'publishModuleToMarketplace'
100+
101+
tasks.findByName('prepareTest').mustRunAfter 'prepareMpk'
102+
tasks.findByName('test').mustRunAfter 'prepareTest'
103+
tasks.findByName('publishModuleToMarketplace').mustRunAfter 'test'
104+
}
105+
106+
exportModule.dependsOn prepareMpk
107+
mxBuild.dependsOn prepareTest
108+
afterReleaseBuild.dependsOn afterReleaseBuildTask

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
version=9.0.2

gradle/wrapper/gradle-wrapper.jar

2.35 KB
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
4+
networkTimeout=10000
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)