@@ -2,31 +2,29 @@ plugins {
22 id ' java'
33 id ' jacoco'
44 id ' maven-publish'
5- id ' com. enonic.defaults' version ' 2.1.6 '
6- id ' com. enonic.xp.base' version ' 3.6.2 '
7- id ' com.github .node-gradle.node ' version ' 7.1.0 '
5+ alias( libs . plugins . enonic. defaults )
6+ alias( libs . plugins . enonic. xp. base )
7+ alias( libs . plugins . node. gradle )
88}
99
1010java {
11- sourceCompatibility = JavaVersion . VERSION_11
12- targetCompatibility = sourceCompatibility
11+ toolchain {
12+ languageVersion = JavaLanguageVersion . of(21 )
13+ }
1314}
1415
15-
1616dependencies {
17- // compileOnly: This is used for dependencies that are only needed during
18- // compilation. The library itself is not included in the final application
19- // build.
2017 compileOnly " com.enonic.xp:core-api:${ xpVersion} "
2118 compileOnly " com.enonic.xp:portal-api:${ xpVersion} "
2219 compileOnly " com.enonic.xp:script-api:${ xpVersion} "
2320 compileOnly " com.enonic.xp:admin-api:${ xpVersion} "
2421
25- implementation ' com.enonic. lib:lib-router:3.2.0 '
22+ implementation libs . lib. router
2623
27- testImplementation ' org.mockito:mockito-core:5.18.0'
28- testImplementation ' org.mockito:mockito-junit-jupiter:5.18.0'
29- testImplementation ' org.junit.jupiter:junit-jupiter:5.11.4'
24+ testImplementation platform( libs. mockito. core )
25+ testImplementation libs. junit. jupiter
26+ testImplementation libs. mockito. jupiter
27+ testRuntimeOnly libs. junit. launcher
3028 testImplementation " com.enonic.xp:testing:${ xpVersion} "
3129 testImplementation " com.enonic.xp:admin-api:${ xpVersion} "
3230}
@@ -38,6 +36,7 @@ processResources {
3836}
3937
4038repositories {
39+ mavenLocal()
4140 mavenCentral()
4241 xp. enonicRepo(' dev' )
4342}
@@ -49,8 +48,6 @@ jacocoTestReport {
4948 }
5049}
5150
52- check. dependsOn jacocoTestReport
53-
5451test {
5552 useJUnitPlatform()
5653}
6764 version = ' 20.14.0'
6865}
6966
70- tasks. withType(Copy ) {
67+ tasks. withType( Copy ) . configureEach {
7168 includeEmptyDirs = false
7269}
7370
@@ -87,8 +84,6 @@ tasks.register('npmBuild', NpmTask) {
8784 inputs. dir ' src/main/resources'
8885 outputs. dir ' build/resources/main'
8986}
90- jar. dependsOn npmBuild
91- compileTestJava. dependsOn npmBuild
9287
9388tasks. register(' npmCheck' , NpmTask ) {
9489 dependsOn npmInstall
@@ -101,8 +96,6 @@ tasks.register('npmCheck', NpmTask) {
10196 ]
10297}
10398
104- check. dependsOn npmCheck
105-
10699tasks. register(' npmTest' , NpmTask ) {
107100 args = [
108101 ' run' ,
@@ -115,7 +108,6 @@ tasks.register('npmTest', NpmTask) {
115108 inputs. dir ' src/bun'
116109 outputs. dir ' coverage'
117110}
118- test. dependsOn npmTest
119111
120112tasks. register(' publishToNpm' , NpmTask ) {
121113 onlyIf { ! version. endsWith( ' -SNAPSHOT' ) }
@@ -124,4 +116,8 @@ tasks.register('publishToNpm', NpmTask ) {
124116 workingDir = file(' build/types' )
125117}
126118
119+ jar. dependsOn npmBuild
120+ compileTestJava. dependsOn npmBuild
121+ test. dependsOn npmTest
122+ check. dependsOn npmCheck, jacocoTestReport
127123publish. dependsOn publishToNpm
0 commit comments